File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change
1
+ // A function that replaces all external links with a target="_blank" attribute on DOM load
2
+ function externalLinks ( ) {
3
+ const a = document . getElementsByTagName ( "a" ) ;
4
+ for ( i = 0 ; i < a . length ; i ++ ) {
5
+ if ( a [ i ] . getAttribute ( "href" ) && a [ i ] . hostname !== location . hostname )
6
+ a [ i ] . target = "_blank" ;
7
+ }
8
+ }
9
+
10
+ document . addEventListener ( "DOMContentLoaded" , externalLinks ) ;
Original file line number Diff line number Diff line change 2
2
< html lang ="en ">
3
3
4
4
< head >
5
+ <!-- Meta tags -->
5
6
< meta charset ="UTF-8 ">
6
- < title > {{ block "title" . }}{{ .Title }}{{ end }}</ title >
7
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
8
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
9
+ <!-- Dependencies -->
7
10
< link rel ="preconnect " href ="https://fonts.googleapis.com ">
8
11
< link rel ="preconnect " href ="https://fonts.gstatic.com " crossorigin >
9
12
< link
14
17
< link rel ="stylesheet " href ="/js/katex/katex.min.css ">
15
18
< script defer src ="/js/katex/katex.min.js "> </ script >
16
19
< script defer src ="/js/katex/contrib/auto-render.min.js "> </ script >
17
-
20
+ <!-- Custom styles -->
18
21
{{ $styles := resources.Get "scss/main.scss" | toCSS | minify | fingerprint }}
19
22
< link rel ="stylesheet " href ="{{ $styles.Permalink }} ">
23
+ <!-- Custom scripts -->
24
+ {{ $scripts := resources.Get "js/main.js" | minify | fingerprint }}
25
+ < script defer src ="{{ $scripts.Permalink }} "> </ script >
26
+ <!-- Title -->
27
+ < title > {{ block "title" . }}{{ .Title }}{{ end }}</ title >
28
+ <!-- Head block -->
20
29
{{ block "head" . }}{{ end }}
21
30
</ head >
22
31
You can’t perform that action at this time.
0 commit comments