replace to work with Hugo before 0.48 #40
This commit is contained in:
parent
3510227568
commit
effb7d3e5f
1 changed files with 4 additions and 4 deletions
|
@ -1,19 +1,19 @@
|
|||
{{ if .Site.Params.highlightjs }}
|
||||
{{ if or (not (isset .Params "highlight")) (.Params.highlight) }}
|
||||
{{ .Scratch.Set "hl_languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }}
|
||||
{{ $.Scratch.Set "hl_languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
|
||||
{{ with .Scratch.Get "hl_languages" }}
|
||||
{{ with $.Scratch.Get "hl_languages" }}
|
||||
{{ range . }}
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/{{.}}.min.js"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
<script type="text/javascript">
|
||||
{{ with .Scratch.Get "hl_languages" }}
|
||||
{{ with $.Scratch.Get "hl_languages" }}
|
||||
hljs.configure({languages: [{{(delimit . ", ")}}]});
|
||||
{{ end }}
|
||||
hljs.initHighlightingOnLoad();
|
||||
</script>
|
||||
{{ .Scratch.Delete "hl_languages" }}
|
||||
{{ $.Scratch.Delete "hl_languages" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue