Skip to content

Commit 8e80fe7

Browse files
authored
chore(docs): add head meta and link tags to master branch (#5224)
1 parent 5f7f2e5 commit 8e80fe7

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

docs/constants.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export const BASE_URL = 'https://bootstrap-vue.org'
2+
export const BASE_URL_DEV = 'https://dev.bootstrap-vue.org'
3+
export const NETLIFY_URL = 'https://bootstrap-vue.netlify.app'
4+
5+
export const GA_TRACKING_ID = 'UA-89526435-1'
6+
7+
export const TWITTER_HANDLE = '@BootstrapVue'
8+
9+
// --- Google Webmaster tools google-site-verification codes ---
10+
// bootstrap-vue.js.org
11+
// <meta name="google-site-verification" content="H9Mn7ie5Z5KJSjRfsn9nilLn5kFgn7BMEqL_sUhVpzg" />
12+
export const GWT_JS_ORG = 'H9Mn7ie5Z5KJSjRfsn9nilLn5kFgn7BMEqL_sUhVpzg'
13+
// *.bootstrap-vue.org
14+
// <meta name="google-site-verification" content="5E0vyG9CXTfY7McIt2aQppkNA6FQ3b0JJRZzhQ16HW4" />
15+
export const GWT_BV_ORG = '5E0vyG9CXTfY7McIt2aQppkNA6FQ3b0JJRZzhQ16HW4'

docs/layouts/default.js

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1+
import { BASE_URL, GWT_BV_ORG, GWT_JS_ORG } from '~/constants'
12
import Footer from '~/components/footer'
23
import Header from '~/components/header'
34

45
export default {
56
name: 'BVDefaultLayout',
6-
functional: true,
7-
render: h => [h(Header), h('nuxt'), h(Footer)]
7+
render(h) {
8+
return h('div', [h(Header), h('nuxt'), h(Footer)])
9+
},
10+
head() {
11+
// Add canonical URL so all site variations are
12+
// indexed to the same primary URL
13+
return {
14+
link: [
15+
// Add canonical URL so all site variations are
16+
// indexed to the same primary URL
17+
{
18+
hid: 'canonical',
19+
rel: 'canonical',
20+
href: `${BASE_URL}${this.$route.path}`
21+
}
22+
],
23+
meta: [
24+
// Add GWT site verification for *.bootstrap-vue.org
25+
{
26+
hid: 'google-site-verification-bv-org',
27+
name: 'google-site-verification',
28+
content: GWT_BV_ORG
29+
},
30+
// Add GWT site verification for bootstrap-vue.js.org
31+
{
32+
hid: 'google-site-verification-js-org',
33+
name: 'google-site-verification',
34+
content: GWT_JS_ORG
35+
}
36+
]
37+
}
38+
}
839
}

docs/layouts/docs.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { BASE_URL, GWT_BV_ORG, GWT_JS_ORG } from '~/constants'
12
import BVBreadcrumbs from '~/components/breadcrumbs'
23
import BVFeedback from '~/components/feedback'
34
import BVFooter from '~/components/footer'
@@ -73,5 +74,32 @@ export default {
7374
const $footer = h(BVFooter, { props: { isDocs: true } })
7475

7576
return h('div', [$header, $container, $footer])
77+
},
78+
head() {
79+
return {
80+
link: [
81+
// Add canonical URL so all site variations are
82+
// indexed to the same primary URL
83+
{
84+
hid: 'canonical',
85+
rel: 'canonical',
86+
href: `${BASE_URL}${this.$route.path}`
87+
}
88+
],
89+
meta: [
90+
// Add GWT site verification for *.bootstrap-vue.org
91+
{
92+
hid: 'google-site-verification-bv-org',
93+
name: 'google-site-verification',
94+
content: GWT_BV_ORG
95+
},
96+
// Add GWT site verification for bootstrap-vue.js.org
97+
{
98+
hid: 'google-site-verification-js-org',
99+
name: 'google-site-verification',
100+
content: GWT_JS_ORG
101+
}
102+
]
103+
}
76104
}
77105
}

0 commit comments

Comments
 (0)