11import { HeadConfig } from "vitepress/types/shared" ;
22
3- export const head : HeadConfig [ ] = [
4- [ 'link' , { rel : "icon" , type : "image/png" , sizes : "96x96" , href : "/favicon-96x96.png" } ] ,
5- [ 'link' , { rel : "icon" , type : "image/svg+xml" , href : "/favicon.svg" } ] ,
6- [ 'link' , { rel : "shortcut icon" , href : "/favicon.ico" } ] ,
7- [ 'link' , { rel : "apple-touch-icon" , sizes : "180x180" , href : "/apple-touch-icon.png" } ] ,
8- [ 'link' , { rel : "manifest" , href : "/site.webmanifest" } ] ,
9- [ 'meta' , { name : "apple-mobile-web-app-title" , content : "JRTC" } ] ,
3+ const isProd = process . env . NODE_ENV === 'production' ;
104
11- // Security headers
12- [
13- 'meta' ,
5+ const head : HeadConfig [ ] = [
6+ [ 'link' , { rel : "icon" , type : "image/png" , sizes : "96x96" , href : "/favicon-96x96.png" } ] ,
7+ [ 'link' , { rel : "icon" , type : "image/svg+xml" , href : "/favicon.svg" } ] ,
8+ [ 'link' , { rel : "shortcut icon" , href : "/favicon.ico" } ] ,
9+ [ 'link' , { rel : "apple-touch-icon" , sizes : "180x180" , href : "/apple-touch-icon.png" } ] ,
10+ [ 'link' , { rel : "manifest" , href : "/site.webmanifest" } ] ,
11+ [ 'meta' , { name : "apple-mobile-web-app-title" , content : "JRTC" } ] ,
12+ ]
13+
14+ if ( isProd ) {
15+ head . push ( [
16+ 'script' ,
1417 {
15- 'http-equiv' : 'Content-Security-Policy' ,
16- content :
17- "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https:;" ,
18+ async : '' ,
19+ src : 'https://eu.umami.is/script.js' ,
20+ 'data-website-id' : '126654a9-5f07-4b57-ad7e-023eda3980ff' ,
21+ 'data-domains' : 'jrtc.dev' ,
22+ 'data-do-not-track' : 'true'
1823 } ,
19- ] ,
20- [ 'meta' , { 'http-equiv' : 'X-Content-Type-Options' , content : 'nosniff' } ] ,
21- [ 'meta' , { 'http-equiv' : 'X-Frame-Options' , content : 'SAMEORIGIN' } ] ,
22- [ 'meta' , { 'http-equiv' : 'X-XSS-Protection' , content : '1; mode=block' } ] ,
23- [ 'meta' , { name : 'referrer' , content : 'strict-origin-when-cross-origin' } ] ,
24- ]
24+ ] )
25+ }
26+
27+ export { head }
0 commit comments