|
44 | 44 |
|
45 | 45 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
46 | 46 |
|
| 47 | + {%- comment -%} |
| 48 | + We put these scripts in the head section, but use "defer" loading to allow the |
| 49 | + browser to start loading them as soon as possible. Actual execution of deferred |
| 50 | + scripts happens once the HTML is fully parsed. |
| 51 | + see https://flaviocopes.com/javascript-async-defer/#with-defer-in-the-head |
| 52 | + {%- endcomment -%} |
| 53 | + {%- if page.landing == true -%} |
| 54 | + <!-- landing page scripts --> |
| 55 | + <script defer src="/js/theme-switcher.js"></script> |
| 56 | + <script defer src="/js/jquery.js"></script> |
| 57 | + <script defer src="/js/bootstrap.min.js"></script> |
| 58 | + <script defer src="/js/search.js"></script> |
| 59 | + {%- else -%} |
| 60 | + <script defer src="/js/theme-switcher.js"></script> |
| 61 | + <script defer src="/js/anchorlinks.js"></script> |
| 62 | + <script defer src="/js/jquery.js"></script> |
| 63 | + <script defer src="/js/bootstrap.min.js"></script> |
| 64 | + <script defer src="/js/docs.js"></script> |
| 65 | + <script defer src="/js/search.js"></script> |
| 66 | + {%- endif -%} |
| 67 | + |
47 | 68 | {%- comment -%}
|
48 | 69 | preload fonts: https://www.freecodecamp.org/news/web-fonts-in-2018-f191a48367e8/
|
49 | 70 | we only preload the "woff2" variants, as older formats (woff, eot) are only used
|
50 |
| - by older browsers, and we don't optimize for those. For fontawesome we "prefetch" |
51 |
| - to allow the browser to pre-heat the cache, but not load it if the page does not |
52 |
| - use it. |
| 71 | + by older browsers, and we don't optimize for those. |
53 | 72 | {%- endcomment -%}
|
54 |
| - <link rel="prefetch" as="font" href="/fonts/fontawesome-webfont.woff2?v=4.7.0" type="font/woff2" crossorigin="anonymous"> |
55 |
| - <link rel="preload" as="font" href="/fonts/glyphicons-halflings-regular.woff2" type="font/woff2" crossorigin="anonymous"> |
56 |
| - <link rel="preload" as="font" href="/fonts/geomanist/hinted-Geomanist-Book.woff2" type="font/woff2" crossorigin="anonymous"> |
| 73 | + <link rel="preload" as="font" href="/fonts/geomanist/hinted-Geomanist-Book.woff2" type="font/woff2" crossorigin="anonymous"> |
| 74 | + <link rel="preload" as="font" href="/fonts/geomanist/hinted-Geomanist-Regular.woff2" type="font/woff2" crossorigin="anonymous"> |
| 75 | + <link rel="preload" as="font" href="/fonts/glyphicons-halflings-regular.woff2" type="font/woff2" crossorigin="anonymous"> |
| 76 | + <link rel="preload" as="font" href="/fonts/fontawesome-webfont.woff2?v=4.7.0" type="font/woff2" crossorigin="anonymous"> |
57 | 77 |
|
58 | 78 | <link rel="stylesheet" href="/css/font-awesome.min.css">
|
59 | 79 | <link rel="stylesheet" href="/css/bootstrap.min.css">
|
|
0 commit comments