Skip to content

Commit fbcc592

Browse files
authored
12 Add configuration for search console authorization meta tags (#17)
* PageMeta as separated component * Add verification meta tags * [Fix] add key to iteration * Fix nested configs
1 parent 4b6944e commit fbcc592

File tree

4 files changed

+57
-10
lines changed

4 files changed

+57
-10
lines changed

app.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ interface ExactproDocsOptions {
4747
docsDir: string
4848
}
4949
seo?: {
50+
robots?: RobotsTxtOptions[]
5051
sitemap?: {
5152
baseUrl?: string
5253
}
53-
robots?: RobotsTxtOptions[]
54+
verificationMetaTags?: {
55+
name: string
56+
content: string
57+
}[]
5458
}
5559
}
5660

components/ep/PageMeta.vue

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
~ Copyright 2023 Exactpro (Exactpro Systems Limited)
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<script setup lang="ts">
18+
import { ParsedContent } from '@nuxt/content/dist/runtime/types'
19+
20+
defineProps<{
21+
doc: Pick<ParsedContent, string> | null
22+
}>()
23+
24+
const config = useAppConfig()
25+
const verificationMetaTags = config.exactproDocs.seo?.verificationMetaTags
26+
</script>
27+
28+
<template>
29+
<Head>
30+
<Title>{{ doc ? doc.title : '' }}</Title>
31+
<Meta
32+
v-for="(verification, index) of verificationMetaTags"
33+
:key="index"
34+
:name="verification.name"
35+
:content="verification.content"
36+
/>
37+
</Head>
38+
</template>

docs/app.config.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@
1717
export default defineAppConfig({
1818
exactproDocs: {
1919
title: 'Docs Template Project',
20-
seo: {
21-
sitemap: {
22-
baseUrl: 'https://exactpro.github.io/docs-toolkit'
23-
},
24-
robots: [{ UserAgent: '*' }, { Allow: '/' }]
25-
},
2620
github: {
2721
repoLink: 'https://github.com/exactpro/docs-toolkit',
2822
branch: 'master',
2923
docsDir: '/docs'
24+
},
25+
seo: {
26+
robots: [{ UserAgent: '*' }, { Allow: '/' }],
27+
sitemap: {
28+
baseUrl: 'https://exactpro.github.io/docs-toolkit'
29+
},
30+
verificationMetaTags: [
31+
// <meta name="google-site-verification" content="PYzR06VK4UIZvGdBkMh_TkqOu83QxapFJknyAR58yJA" />
32+
{
33+
name: 'google-site-verification',
34+
content: 'PYzR06VK4UIZvGdBkMh_TkqOu83QxapFJknyAR58yJA'
35+
}
36+
]
3037
}
3138
}
3239
})

pages/[...slug].vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
-->
1616

1717
<template>
18-
<Head>
19-
<Title>{{ doc ? doc.title : '' }}</Title>
20-
</Head>
18+
<EpPageMeta :doc="doc" />
2119
<NuxtLayout>
2220
<div class="px-4 mt-10 mb-96">
2321
<article class="mb-10">

0 commit comments

Comments
 (0)