Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 6ce55ae

Browse files
feat: update deps and introduce canonical urls
1 parent b3fb605 commit 6ce55ae

File tree

5 files changed

+412
-393
lines changed

5 files changed

+412
-393
lines changed

layouts/default.vue

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,19 @@ export default {
3333
this.checkForHash(this.$route)
3434
},
3535
head () {
36-
return this.$nuxtI18nSeo()
36+
const i18nSeo = this.$nuxtI18nSeo()
37+
const baseUrl = process.env.baseUrl
38+
const { path } = this.$route
39+
const pathWithSlash = path.endsWith('/') ? path : `${path}/`
40+
41+
return {
42+
htmlAttrs: i18nSeo.htmlAttrs,
43+
meta: i18nSeo.meta,
44+
link: [
45+
{ rel: 'canonical', href: `${baseUrl}${pathWithSlash}` },
46+
...i18nSeo.link
47+
]
48+
}
3749
},
3850
methods: {
3951
hideContactUsModal () {

nuxt.config.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const titleTemplate = c => c ? `${c} - Developmint` : 'Developmint'
66
const isProd = process.env.NODE_ENV === 'production'
77
const isDev = !isProd
88

9-
const baseUrl = process.env.BASE_URL || 'https://developmint.de/'
9+
const baseUrl = process.env.BASE_URL || 'https://www.developmint.de'
1010

1111
const { theme: { colors } } = resolveConfig(rawTailwindConfig)
1212

@@ -109,7 +109,7 @@ export default {
109109
description: 'Developmint is an experienced Software agency based in Dresden (Germany). Let your visions become' +
110110
' reality with us!',
111111
author: 'Developmint',
112-
ogHost: baseUrl,
112+
ogHost: `${baseUrl}/`,
113113
ogSiteName: 'Developmint',
114114
ogImage: {
115115
path: 'logo.png'
@@ -171,7 +171,13 @@ export default {
171171
'/de/datenschutz',
172172
'/disclaimer',
173173
'/de/haftungsausschluss'
174-
]
174+
],
175+
filter ({ routes }) {
176+
return routes.map((route) => {
177+
route.url = route.url.endsWith('/') ? route.url : `${route.url}/`
178+
return route
179+
})
180+
}
175181
},
176182

177183
webfontloader: {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
"eslint-plugin-nuxt": "^0.4.3",
2323
"intersection-observer": "^0.7.0",
2424
"nuxt-edge": "^3.0.0-25886174.42eefa0e",
25-
"nuxt-i18n": "^5.12.7",
25+
"nuxt-i18n": "^6.0.1",
2626
"nuxt-svg-loader": "^1.0.1",
2727
"nuxt-webfontloader": "^1.1.0",
2828
"postcss-nested": "^4.1.2",
2929
"sendmail": "^1.6.1",
3030
"shifty": "^2.8.0",
31-
"validator": "^10.11.0",
31+
"validator": "^11.1.0",
3232
"vue-cookieconsent-component": "^1.2.0",
3333
"vue-if-bot": "^1.2.0",
3434
"vue-observe-visibility": "^0.4.4",
@@ -39,11 +39,11 @@
3939
"@nuxtjs/eslint-config": "^1.0.1",
4040
"@nuxtjs/proxy": "^1.3.3",
4141
"babel-eslint": "^10.0.2",
42-
"eslint": "^5.16.0",
42+
"eslint": "^6.1.0",
4343
"eslint-loader": "^2.2.1",
44-
"husky": "^1.3.1",
44+
"husky": "^3.0.3",
4545
"netlify-lambda": "^1.5.1",
46-
"standard-version": "^5.0.2"
46+
"standard-version": "^7.0.0"
4747
},
4848
"husky": {
4949
"hooks": {

plugins/vue-prototype-extensions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Vue.prototype.$createSeo = function (slug, baseMetaArray = []) {
77
const defaultMetaArray = [
88
{
99
name: 'og:url',
10-
content: `${process.env.baseUrl}${this.$route.path.substr(1)}`
10+
content: `${process.env.baseUrl}${this.$route.path}`
1111
}
1212
]
1313

@@ -32,6 +32,6 @@ const retrieveMetaObjectArray = (metaObject) => {
3232
name: n,
3333
property: n,
3434
// Fix url when the meta information is og:image
35-
content: wrappedName.includes('og:image') ? process.env.baseUrl + metaObject.content.substr(1) : metaObject.content
35+
content: wrappedName.includes('og:image') ? process.env.baseUrl + metaObject.content : metaObject.content
3636
}))
3737
}

0 commit comments

Comments
 (0)