Compare commits

..

5 Commits

Author SHA1 Message Date
Rico Ullmann 8e4c904979
footer.html: remove Google analytics
adjust copyright notice
2023-01-06 00:01:04 +01:00
Rico Ullmann 514eabf49d
header.html: grab local copy of MathJax.js 2023-01-05 23:48:48 +01:00
Rico Ullmann 1237910613
header.html: remove crossorigin="anonymous" from katex ressources
this is not required as we're delivering these ressources from our local system.
2023-01-05 23:43:50 +01:00
Rico Ullmann bd95ccd516
header.html: service katex locally
update to 0.16.4
2023-01-05 23:35:24 +01:00
Rico Ullmann 37f660ebbd
remove useCDN option 2023-01-05 23:31:01 +01:00
8 changed files with 36 additions and 25 deletions

View File

@ -10,7 +10,6 @@ Forked from [Ezhil Theme](https://github.com/vividvilla/ezhil)
![](/images/theme.png)
![](/images/archie-dark.png)
## Feature
- Google Analytics Script
- Callouts
- Tags
- Auto Dark Mode(based on system theme)
@ -77,7 +76,6 @@ paginate=3 # articles per page
[params]
mode="auto" # color-mode → light,dark,toggle or auto
useCDN=false # don't use CDNs for fonts and icons, instead serve them locally.
subtitle = "Minimal and Clean [blog theme for Hugo](https://github.com/athul/archie)"
mathjax = true # enable MathJax support
katex = true # enable KaTeX support

View File

@ -8,7 +8,6 @@ pygmentscodefences = true
pygmentscodefencesguesssyntax = true
[params]
mode="auto"
useCDN=false
subtitle = "Minimal and Clean [blog theme for Hugo](https://github.com/athul/archie)"
[[params.social]]

View File

@ -6,13 +6,14 @@
{{- end -}}
</div>
<div class="footer-info">
{{ dateFormat "2006" now }} {{ with .Site.Copyright }} {{ . }} | {{ end }} <a
href="https://github.com/athul/archie">Archie Theme</a> | Built with <a href="https://gohugo.io">Hugo</a>
{{ if $.Site.Copyright }}
{{ $.Site.Copyright | safeHTML }}
{{ else }}
© {{ now.Year }} Powered by <a href="http://gohugo.io" target="_blank" rel="noopener noreferrer">Hugo</a>
{{ end }}
:: <a href="https://github.com/athul/archie" target="_blank" rel="noopener noreferrer">Archie theme</a>
</div>
</footer>
{{ if not .Site.IsServer }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
{{- if (isset .Site.Params "social") -}}
<script>

View File

@ -22,19 +22,9 @@
{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}}
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
{{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}}
<script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
{{ end }}
{{ if .Site.Params.useCDN | default false -}}
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
{{- else -}}
{{ $fontstyle := resources.Get "css/fonts.css" | fingerprint }}
<link href="{{ $fontstyle.Permalink }}" rel="stylesheet">
{{ end }}
{{ $style := resources.Get "css/main.css" | fingerprint }}
<link rel="stylesheet" type="text/css" media="screen" href="{{ $style.Permalink }}" />
@ -47,9 +37,9 @@
<!-- Mathjax support -->
{{ with .Site.Params.mathjax }}
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
src="js/MathJax.js" integrity="sha384-Ra6zh6uYMmH5ydwCqqMoykyf1T/+ZcnOQfFPhDrp2kI4OIxadnhsvvA2vv9A7xYv">
</script>
<!-- inline Mathjax -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
@ -68,10 +58,11 @@
<!-- KaTeX support -->
{{ with .Site.Params.katex }}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
<link rel="stylesheet" href="css/katex.min.css" integrity="sha384-vKruj+a13U8yHIkAyGgK1J3ArTLzrFGBbBc0tDp4ad/EyewESeXE/Iv67Aj8gKZ0">
<script defer src="js/katex.min.js" integrity="sha384-PwRUT/YqbnEjkZO0zZxNqcxACrXe+j766U2amXcgMg5457rve2Y7I6ZJSm2A0mS4" </script>
<script defer src="auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05"
onload="renderMathInElement(document.body);"></script>
<!-- inline KaTeX -->
<script>
document.addEventListener("DOMContentLoaded", function() {
@ -84,7 +75,7 @@
});
</script>
{{ end }}
<!-- Custom CSS style get applied last -->
{{- if isset .Site.Params "customcss" }}
{{ range .Site.Params.customCSS }}

1
static/css/katex.min.css vendored Normal file

File diff suppressed because one or more lines are too long

19
static/js/MathJax.js Normal file

File diff suppressed because one or more lines are too long

1
static/js/auto-render.min.js vendored Normal file
View File

@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var t={771:function(t){t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var i={};return function(){n.d(i,{default:function(){return s}});var e=n(771),t=n.n(e),r=function(e,t,r){for(var n=r,i=0,a=e.length;n<t.length;){var o=t[n];if(i<=0&&t.slice(n,n+a)===e)return n;"\\"===o?n++:"{"===o?i++:"}"===o&&i--,n++}return-1},a=/^\\begin{/,o=function(e,t){for(var n,i=[],o=new RegExp("("+t.map((function(e){return e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")})).join("|")+")");-1!==(n=e.search(o));){n>0&&(i.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));var l=t.findIndex((function(t){return e.startsWith(t.left)}));if(-1===(n=r(t[l].right,e,t[l].left.length)))break;var d=e.slice(0,n+t[l].right.length),s=a.test(d)?d:e.slice(t[l].left.length,n);i.push({type:"math",data:s,rawData:d,display:t[l].display}),e=e.slice(n+t[l].right.length)}return""!==e&&i.push({type:"text",data:e}),i},l=function(e,r){var n=o(e,r.delimiters);if(1===n.length&&"text"===n[0].type)return null;for(var i=document.createDocumentFragment(),a=0;a<n.length;a++)if("text"===n[a].type)i.appendChild(document.createTextNode(n[a].data));else{var l=document.createElement("span"),d=n[a].data;r.displayMode=n[a].display;try{r.preProcess&&(d=r.preProcess(d)),t().render(d,l,r)}catch(e){if(!(e instanceof t().ParseError))throw e;r.errorCallback("KaTeX auto-render: Failed to parse `"+n[a].data+"` with ",e),i.appendChild(document.createTextNode(n[a].rawData));continue}i.appendChild(l)}return i},d=function e(t,r){for(var n=0;n<t.childNodes.length;n++){var i=t.childNodes[n];if(3===i.nodeType){for(var a=i.textContent,o=i.nextSibling,d=0;o&&o.nodeType===Node.TEXT_NODE;)a+=o.textContent,o=o.nextSibling,d++;var s=l(a,r);if(s){for(var f=0;f<d;f++)i.nextSibling.remove();n+=s.childNodes.length-1,t.replaceChild(s,i)}else n+=d}else 1===i.nodeType&&function(){var t=" "+i.className+" ";-1===r.ignoredTags.indexOf(i.nodeName.toLowerCase())&&r.ignoredClasses.every((function(e){return-1===t.indexOf(" "+e+" ")}))&&e(i,r)}()}},s=function(e,t){if(!e)throw new Error("No element provided to render");var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);r.delimiters=r.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],r.ignoredTags=r.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r.ignoredClasses=r.ignoredClasses||[],r.errorCallback=r.errorCallback||console.error,r.macros=r.macros||{},d(e,r)}}(),i=i.default}()}));

1
static/js/katex.min.js vendored Normal file

File diff suppressed because one or more lines are too long