You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
872 B
19 lines
872 B
3 years ago
|
{{- if (.Site.Params.highlightjs) -}}
|
||
|
{{ if (or (not (isset .Params "highlight")) (and (isset .Params "highlight") .Params.highlight)) }}
|
||
|
{{ $.Scratch.Set "hl_languages" (union (.Site.Params.highlightjslanguages) (.Params.highlightjslanguages)) }}
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
|
||
|
{{ with $.Scratch.Get "hl_languages" }}
|
||
|
{{ range . }}
|
||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/languages/{{.}}.min.js"></script>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
<script type="text/javascript">
|
||
|
{{ with $.Scratch.Get "hl_languages" }}
|
||
|
hljs.configure({languages: [{{(delimit . ", ")}}]});
|
||
|
{{ end }}
|
||
|
hljs.initHighlightingOnLoad();
|
||
|
</script>
|
||
|
{{ $.Scratch.Delete "hl_languages" }}
|
||
|
{{ end }}
|
||
|
{{- end -}}
|