|
| 1 | +{%- if site.footer_scripts -%} |
| 2 | + {%- for script in site.footer_scripts -%} |
| 3 | + {%- if script contains "://" -%} |
| 4 | + {%- capture script_path %}{{ script }}{% endcapture -%} |
| 5 | + {%- else -%} |
| 6 | + {%- capture script_path %}{{ script | absolute_url }}{% endcapture -%} |
| 7 | + {%- endif -%} |
| 8 | + <script src="{{ script_path }}"></script> |
| 9 | + {%- endfor -%} |
| 10 | +{%- else -%} |
| 11 | + <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> |
| 12 | + <script src="{{ '/assets/js/main.min.js' | relative_url }}"></script> |
| 13 | + <script src="https://use.fontawesome.com/releases/v5.0.12/js/all.js"></script> |
| 14 | +{%- endif -%} |
| 15 | + |
| 16 | +<!-- "Old" Tracking ID with Google Analytics 3 |
| 17 | +{%- if jekyll.environment == 'production' and site.google_analytics -%} |
| 18 | + <script> |
| 19 | + if(!(window.doNotTrack === "1" || navigator.doNotTrack === "1" || navigator.doNotTrack === "yes" || navigator.msDoNotTrack === "1")) { |
| 20 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| 21 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| 22 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 23 | + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 24 | + ga('create', '{{ site.google_analytics }}', 'auto'); |
| 25 | + ga('send', 'pageview'); |
| 26 | + } |
| 27 | + </script> |
| 28 | +{%- endif %} |
| 29 | +--> |
| 30 | +{% if site.mathjax == true or site.mathjax.enable == true %} |
| 31 | +<!-- MathJax --> |
| 32 | +{% capture mathjaxjs %}https://cdn.jsdelivr.net/npm/mathjax@3/es5/{{ site.mathjax.combo | default: "tex-svg" }}.js{% endcapture %} |
| 33 | +<script> |
| 34 | +// http://docs.mathjax.org/en/latest/upgrading/v2.html |
| 35 | +MathJax = { |
| 36 | + tex: { |
| 37 | + tags: "{{ site.mathjax.tags | default: 'ams' }}" // eq numbering options: none, ams, all |
| 38 | + }, |
| 39 | + options: { |
| 40 | + renderActions: { |
| 41 | + // for mathjax 3, handle <script "math/tex"> blocks inserted by kramdown |
| 42 | + find: [10, function (doc) { |
| 43 | + for (const node of document.querySelectorAll('script[type^="math/tex"]')) { |
| 44 | + const display = !!node.type.match(/; *mode=display/); |
| 45 | + const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display); |
| 46 | + const text = document.createTextNode(''); |
| 47 | + node.parentNode.replaceChild(text, node); |
| 48 | + math.start = {node: text, delim: '', n: 0}; |
| 49 | + math.end = {node: text, delim: '', n: 0}; |
| 50 | + doc.math.push(math); |
| 51 | + } |
| 52 | + }, ''] |
| 53 | + } |
| 54 | + } |
| 55 | +} |
| 56 | +</script> |
| 57 | + |
| 58 | +<script type="text/javascript" id="MathJax-script" async src="{{ mathjaxjs }}"></script> |
| 59 | +{% endif %} |
| 60 | + |
| 61 | +{%- if page.layout == "search" -%} |
| 62 | + {% include lunr-search-scripts.html %} |
| 63 | +{%- endif -%} |
0 commit comments