mermaid support
This commit is contained in:
parent
0c9211f27b
commit
e7eb6932e2
19 changed files with 125 additions and 124 deletions
|
@ -5,14 +5,14 @@
|
|||
<main>
|
||||
<h1>{{ .Title }}</h1>
|
||||
<div class="sm-1 mtb-1">
|
||||
Posted at — {{ dateFormat "Jan 2, 2006" .Date }}
|
||||
Posted at — {{ dateFormat .Site.Params.timeformat .Date }}
|
||||
{{ if .Draft }}
|
||||
<span class="tag ml-1">
|
||||
DRAFT
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
<p>{{ .Description }}</p>
|
||||
<p>{{ .Description | markdownify | safeHTML }}</p>
|
||||
<article class="md">
|
||||
{{ .Content }}
|
||||
</article>
|
||||
|
@ -21,6 +21,10 @@
|
|||
{{ partial "math.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or .Params.mermaid .Site.Params.mermaid }}
|
||||
{{ partial "mermaid.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Params.comment (eq .Site.Params.comment "disqus")}}
|
||||
{{ partial "disqus.html" . }}
|
||||
{{ end }}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
{{ $paginator := .Paginate (where .Site.RegularPages "Kind" "page") }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div class="row row-mob mb-1 mb-1_5-mob gap-3">
|
||||
<div class="sm-2-mob mb-0_5-mob mw-6">{{ dateFormat "Jan 2, 2006" .Date }}</div>
|
||||
<div class="sm-2-mob mb-0_5-mob mw-6">{{ dateFormat .Site.Params.timeformat .Date }}</div>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&display=swap"
|
||||
rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://unpkg.com/normalize.css">
|
||||
{{ $hash := now.Unix }}
|
||||
{{ $options := (dict "targetPath" (printf `minima.%d.css` $hash) "outputStyle" "compressed" "enableSourceMap" true) }}
|
||||
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
|
||||
|
||||
<script src="/js/main.js"></script>
|
||||
{{ $options := (dict "targetPath" (printf `minima.%d.js` $hash) "minify" true) }}
|
||||
{{ $js := resources.Get "js/main.js" | js.Build $options }}
|
||||
<script defer type="text/javascript" src="{{ $js.RelPermalink }}"></script>
|
||||
</head>
|
||||
<script>
|
||||
try {
|
||||
|
|
4
layouts/partials/mermaid.html
Normal file
4
layouts/partials/mermaid.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script>
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
1
layouts/shortcodes/mermaid.html
Normal file
1
layouts/shortcodes/mermaid.html
Normal file
|
@ -0,0 +1 @@
|
|||
<p class="mermaid">{{ safeHTML .Inner }}</p>
|
Loading…
Add table
Add a link
Reference in a new issue