Skip to content

Commit

Permalink
Fix KaTeX support and fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
blyxyas committed Feb 20, 2024
1 parent 7455983 commit 1510407
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
src: url("/fonts/NeueWorld-Bold.ttf");
}

* {
p {
font-family: "Libre Franklin";
}

Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ <h2 id="sponsor-me">Supporting my work</h2>

<script type="text/javascript" src="https://cdnjs.buymeacoffee.com/1.0.0/button.prod.min.js" data-name="bmc-button" data-slug="blyxyas" data-color="#BD5FFF" data-emoji="" data-font="Lato" data-text="Buy me a coffee" data-outline-color="#000000" data-font-color="#ffffff" data-coffee-color="#FFDD00"></script></p>
</div>
</div>
</div>
{{ if .Params.katex }}{{ partial "katex.html" . }}{{ end }}
2 changes: 2 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Libre+Franklin&display=swap" rel="stylesheet">
<link rel="canonical" href="https://blog.goose.love/" />
<link rel="me" href="https://tech.lgbt/@blyxyas">Mastodon</a>
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}
27 changes: 27 additions & 0 deletions layouts/partials/katex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- CSS -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
integrity="sha384-D+9gmBxUQogRLqvARvNLmA9hS2x//eK1FhVb9PiU86gmcrBrJAQT8okdJ4LMp2uv"
crossorigin="anonymous"
/>

<!-- JS -->
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js" integrity="sha384-j/ZricySXBnNMJy9meJCtyXTKMhIJ42heyr7oAdxTDBy/CYA9hzpMo+YTNV5C+1X" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" integrity="sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
// customised options
// • auto-render specific keys, e.g.:
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
// • rendering keys, e.g.:
throwOnError : false
});
});
</script>

0 comments on commit 1510407

Please sign in to comment.