@@ -19,6 +19,7 @@ import PrimaryNavigation from './components/PrimaryNavigation.vue';
1919import NotificationBannerModule from ' ./components/NotificationBannerModule.vue' ;
2020import FooterModule from ' ./components/FooterModule.vue' ;
2121import NotFound from ' ./views/NotFound.vue' ;
22+ import { useGenericGlobalsStore } from ' ./stores/genericGlobals' ;
2223import { useSeoMeta } from ' @unhead/vue' ;
2324
2425export default {
@@ -42,6 +43,20 @@ export default {
4243 });
4344 },
4445 head () {
46+
47+ const isProductionSite = useGenericGlobalsStore ().isProductionWebsite ;
48+
49+ if (! isProductionSite) {
50+
51+ // Particularly for the test CVE website (test.cve.org), prevent
52+ // any search engine from crawling the content. This should only
53+ // be allowed for the production website.
54+
55+ return {
56+ meta: [{name: ' robots' , content: ' noindex, nofollow' }]
57+ }
58+ }
59+
4560 // Remove any trailing and leading slashes on the base URL and
4661 // path suffix so we know what we're dealing with and we control
4762 // the slash separating the two components.
@@ -50,8 +65,7 @@ export default {
5065 const suffix = this .$route .fullPath .replace (/ ^ \/ + / , ' ' );
5166
5267 return {
53- link: [{rel: ' canonical' ,
54- content: ` ${ baseURL} /${ suffix} ` }]
68+ link: [{rel: ' canonical' , href: ` ${ baseURL} /${ suffix} ` }]
5569 }
5670 }
5771}
0 commit comments