Skip to content

Commit

Permalink
feat: add meta description
Browse files Browse the repository at this point in the history
  • Loading branch information
feerglas committed Oct 21, 2020
1 parent 18a9d8d commit e5135ed
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/pages/Cantons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

<script>
import Flags from '../assets/flags/Index.vue';
import getMetaInfo from '../helpers/meta';
export default {
components: {
Expand Down Expand Up @@ -82,6 +83,17 @@ export default {
return cantons;
}
},
metaInfo() {
const lang = this.$i18n.locale;
const route = this.$route.fullPath;
const description = this.$t('seo.description.cantons');
return getMetaInfo({
description,
lang,
route
});
}
};
Expand Down
12 changes: 12 additions & 0 deletions src/pages/Holidays.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import {
getLastHolidayOfEachYear,
getNextHolidayAfterDate
} from '../helpers/date';
import getMetaInfo from '../helpers/meta';
import HolidaysInfoLine from '../components/HolidaysInfoLine.vue';
import HolidaysTable from '../components/HolidaysTable.vue';
import YearsSelector from '../components/YearsSelector.vue';
Expand All @@ -87,6 +88,17 @@ export default {
nextHoliday: false
};
},
metaInfo() {
const lang = this.$i18n.locale;
const route = this.$route.fullPath;
const description = this.$t('seo.description.holidays');
return getMetaInfo({
description,
lang,
route
});
},
methods: {
handleFilter(holidays) {
this.filteredHolidays = holidays;
Expand Down
13 changes: 11 additions & 2 deletions src/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,23 @@
</template>

<script>
import getMetaInfo from '../helpers/meta';
import SocialLinks from '../components/SocialLinks.vue';
export default {
components: {
SocialLinks
},
metaInfo: {
title: 'feiertaCH'
metaInfo() {
const lang = this.$i18n.locale;
const route = this.$route.fullPath;
const description = this.$t('seo.description.home');
return getMetaInfo({
description,
lang,
route
});
}
};
</script>
Expand Down
14 changes: 14 additions & 0 deletions src/templates/Canton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import {
import Flag from '../assets/flags/Index.vue';
import HolidaysInfoLine from '../components/HolidaysInfoLine.vue';
import HolidaysTable from '../components/HolidaysTable.vue';
import getMetaInfo from '../helpers/meta';
import YearsSelector from '../components/YearsSelector.vue';
export default {
Expand All @@ -113,6 +114,19 @@ export default {
nextHoliday: false
};
},
metaInfo() {
const lang = this.$i18n.locale;
const route = this.$route.fullPath;
const description = this.$t('seo.description.canton', {
canton: this.$page.canton.name[this.$i18n.locale]
});
return getMetaInfo({
description,
lang,
route
});
},
methods: {
handleFilter(holidays) {
this.filteredHolidays = holidays;
Expand Down

0 comments on commit e5135ed

Please sign in to comment.