diff options
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/_markup/render-codeblock.html | 6 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..6e1a075 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,6 @@ +<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html --> +{{ .Page.Store.Set "hasCodeBlock" true }} + +<!-- https://www.veriphor.com/articles/code-block-render-hooks/ --> +{{ $result := transform.HighlightCodeBlock . }} +{{ $result.Wrapped }}
\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index fdfa47c..475d6f9 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,8 +14,10 @@ {{ $style := resources.Get "style.css" | minify }} <link href="{{ $style.RelPermalink }}" rel="stylesheet"> - {{ $syntax := resources.Get "syntax.css" | minify }} - <link href="{{ $syntax.RelPermalink }}" rel="stylesheet"> + {{ if (.Page.Store.Get "hasCodeBlock") }} + {{ $syntax := resources.Get "syntax.css" | minify }} + <link href="{{ $syntax.RelPermalink }}" rel="stylesheet"> + {{ end }} {{ with .Params.style }} {{ $extra := resources.Get . | minify }} |