Fixing hightlight-js embedding error 'hljs is not defined' when highlightjs is not configured in hugo
This commit is contained in:
parent
3520ff123d
commit
5046967a61
1 changed files with 6 additions and 6 deletions
|
@ -7,12 +7,12 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/languages/{{.}}.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/languages/{{.}}.min.js"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{{ with $.Scratch.Get "hl_languages" }}
|
{{ with $.Scratch.Get "hl_languages" }}
|
||||||
hljs.configure({languages: [{{(delimit . ", ")}}]});
|
hljs.configure({languages: [{{(delimit . ", ")}}]});
|
||||||
{{ end }}
|
{{ end }}
|
||||||
hljs.initHighlightingOnLoad();
|
hljs.initHighlightingOnLoad();
|
||||||
</script>
|
</script>
|
||||||
|
{{ end }}
|
||||||
{{ $.Scratch.Delete "hl_languages" }}
|
{{ $.Scratch.Delete "hl_languages" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue