layouts: add TikZJax support

Using the `tikz` shortcode, and adding the `tikz: true` metadata to a
page's frontmatter, allows me to write TikZ diagram and have them
rendered in the browser using JavaScript
This commit is contained in:
Bruno BELANYI 2020-10-16 22:12:09 +02:00
parent a164d46508
commit 60f577f739
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,5 @@
<!-- TikZJax support -->
{{ if (.Params.tikz) }}
<link rel="stylesheet" type="text/css" href="https://tikzjax.com/v1/fonts.css">
<script async src="https://tikzjax.com/v1/tikzjax.js"></script>
{{ end }}

View file

@ -0,0 +1,3 @@
<script type="text/tikz">
{{.Inner}}
</script>