@@ -16,18 +16,15 @@ html(lang=locale).h-100
16
16
link( rel ="alternate" , href =` ${ config .urls .web } /${ language .locale }${ ctx .pathWithoutLocale } ` , hreflang =language .locale )
17
17
18
18
//- generated with https://realfavicongenerator.net
19
- link( rel ="apple-touch-icon" , sizes ="152x152" , href =manifest (' img/apple-touch-icon.png' ))
20
- link( rel ="icon" , type ="image/png" , href =manifest (' img/favicon-32x32.png' ), sizes ="32x32" )
21
- link( rel ="icon" , type ="image/png" , href =manifest (' img/favicon-16x16.png' ), sizes ="16x16" )
22
- link( rel ="manifest" , href ="/manifest.json" )
23
-
24
- //- add mask-icon
25
- //- <https://goo.gl/PMBfKu>
26
- //- link(rel="mask-icon", href=manifest('img/safari-pinned-tab.svg'), color=config.appColor)
19
+ link( rel ="apple-touch-icon" , sizes ="152x152" , href =manifest (' img/apple-touch-icon.png' ), integrity =manifest (' img/apple-touch-icon.png' , ' integrity' ), crossorigin ='anonymous' )
20
+ link( rel ="icon" , type ="image/png" , href =manifest (' img/favicon-32x32.png' ), sizes ="32x32" , integrity =manifest (' img/favicon-32x32.png' , ' integrity' ), crossorigin ='anonymous' )
21
+ link( rel ="icon" , type ="image/png" , href =manifest (' img/favicon-16x16.png' ), sizes ="16x16" , integrity =manifest (' img/favicon-16x16.png' , ' integrity' ), crossorigin ='anonymous' )
22
+ link( rel ="manifest" , href =manifest (' site.webmanifest' ), integrity =manifest (' site.webmanifest' , ' integrity' ), crossorigin ='anonymous' )
23
+ link( rel ="mask-icon" , href =manifest (' img/safari-pinned-tab.svg' ), integrity =manifest (' img/safari-pinned-tab.svg' , ' integrity' ), color =config .appColor , crossorigin ='anonymous' )
27
24
meta( name ="apple-mobile-web-app-title" , content =config .appName )
28
25
meta( name ="application-name" , content =config .appName )
29
26
meta( name ="msapplication-TileColor" , content =config .appColor )
30
- meta( name ="theme-color" , content =config . appColor )
27
+ meta( name ="theme-color" , content ="#ffffff" )
31
28
32
29
//- csrf token
33
30
meta( name ="csrf-token" , content =ctx .csrf )
@@ -36,7 +33,7 @@ html(lang=locale).h-100
36
33
37
34
//- add opengraph tags to your structured data pages
38
35
block opengraph
39
- link( rel ='image_src' , type ='image/png' , href =manifest (' img/social.png' ))
36
+ link( rel ='image_src' , type ='image/png' , href =manifest (' img/social.png' ), integrity = manifest ( ' img/social.png ' , ' integrity ' ), crossorigin = 'anonymous' )
40
37
meta( property ='og:title' , content =meta .title )
41
38
meta( property ='og:url' , content =` ${ config .urls .web }${ ctx .pathWithoutLocale } ` )
42
39
meta( property ='og:description' , content =meta .description )
@@ -49,12 +46,26 @@ html(lang=locale).h-100
49
46
50
47
//- css file
51
48
block stylesheets
52
- if config .env === ' production'
53
- link( rel ="stylesheet" , href =manifest (' css/app.css' ) integrity =manifest (' css/app.css' , ' integrity' ), crossorigin ="anonymous" )
54
- else
55
- link( rel ="stylesheet" , href =manifest (' css/app.css' ))
56
-
57
- body( role ='document' , class =[' /register' , ' /login' , config .verifyRoute ].includes (ctx .pathWithoutLocale ) ? ' pt-0' : '' ) .d-flex.flex-column.h-100
49
+ link( rel ="stylesheet" , href =manifest (' css/app.css' ), integrity =manifest (' css/app.css' , ' integrity' ), crossorigin ='anonymous' )
50
+
51
+ //- preload and prefetch content
52
+ //- <https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content>
53
+ //- <https://developers.google.com/speed/pagespeed/insights/>
54
+ block preload
55
+ each asset in [ ' fonts/fa-brands-400.woff' , ' fonts/fa-solid-900.woff' ]
56
+ //- integrity attribute not currently supported
57
+ //- <https://crbug.com/981419>
58
+ link( rel ='preload' , href =manifest (asset), as ='font' , crossorigin ='anonymous' )
59
+
60
+ block prefetch
61
+ each asset in [' img/github-logo.svg' , ' img/google-logo.svg' ]
62
+ link( rel ='prefetch' , href =manifest (asset), as ='image' , crossorigin ='anonymous' )
63
+ each asset in [ ' fonts/fa-brands-400.ttf' , ' fonts/fa-solid-900.ttf' ]
64
+ //- integrity attribute not currently supported
65
+ //- <https://crbug.com/981419>
66
+ link( rel ='prefetch' , href =manifest (asset), as ='font' , crossorigin ='anonymous' )
67
+
68
+ body( role ='document' ) .d-flex.flex-column.min-h-100
58
69
59
70
//- spinner
60
71
block spinner
@@ -65,13 +76,14 @@ html(lang=locale).h-100
65
76
include _nav
66
77
67
78
//- body
68
- main( role ='main' ) .flex-shrink-0
69
- block body
79
+ main( role ='main' ) .flex-grow-1.d-flex.flex-column.flex-grow-1
80
+ block body
70
81
71
82
//- footer
72
83
block footer
73
84
include _footer
74
85
86
+ //- scripts
75
87
block scripts
76
88
//- flash messaging (with koa-better-flash and sweetalert2)
77
89
script .
@@ -122,11 +134,6 @@ html(lang=locale).h-100
122
134
id: " #{ctx.sessionId}"
123
135
};
124
136
125
- //- factor bundle (common shared assets across all files)
126
- script( src =manifest (' js/factor-bundle.js' ) integrity =manifest (' js/factor-bundle.js' , ' integrity' ) crossorigin ="anonymous" )
127
-
128
- //- uncaught (handles errors, similar to TraceKit but with CabinJS + StackTrace.JS)
129
- script( src =manifest (' js/uncaught.js' ) integrity =manifest (' js/uncaught.js' , ' integrity' ) crossorigin ="anonymous" )
130
-
131
- //- scripts
132
- script( src =manifest (' js/core.js' ) integrity =manifest (' js/core.js' , ' integrity' ) crossorigin ="anonymous" )
137
+ //- build
138
+ if ! isBot (ctx .get (' User-Agent' ))
139
+ script( async , src =manifest (' js/build.js' ), integrity =manifest (' js/build.js' , ' integrity' ), crossorigin ='anonymous' )
0 commit comments