migrate syntax highlight to js bundle
This commit is contained in:
parent
55c400075c
commit
fbafe4f671
6 changed files with 10 additions and 13 deletions
|
@ -13,3 +13,7 @@ if (process.env.FEATURE_DARKMODE) {
|
||||||
if (process.env.FEATURE_FLOWCHART) {
|
if (process.env.FEATURE_FLOWCHART) {
|
||||||
import('./flowchart');
|
import('./flowchart');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.env.FEATURE_SYNTAXHIGHLIGHT) {
|
||||||
|
import('./syntaxhighlight');
|
||||||
|
}
|
||||||
|
|
3
assets/scripts/features/syntaxhighlight/hljs.js
Normal file
3
assets/scripts/features/syntaxhighlight/hljs.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import hljs from 'highlight.js';
|
||||||
|
|
||||||
|
hljs.highlightAll();
|
3
assets/scripts/features/syntaxhighlight/index.js
Normal file
3
assets/scripts/features/syntaxhighlight/index.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
if (process.env.FEATURE_SYNTAXHIGHLIGHT_HLJS) {
|
||||||
|
import('./hljs');
|
||||||
|
}
|
|
@ -192,11 +192,6 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "scripts" }}
|
{{ define "scripts" }}
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
|
|
||||||
<script>
|
|
||||||
hljs.initHighlightingOnLoad();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-------------- Enable Math support for this page ---------------->
|
<!-------------- Enable Math support for this page ---------------->
|
||||||
{{ if .Params.math }}
|
{{ if .Params.math }}
|
||||||
{{ partial "math.html" . }}
|
{{ partial "math.html" . }}
|
||||||
|
|
|
@ -57,10 +57,6 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "scripts" }}
|
{{ define "scripts" }}
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
|
|
||||||
<script>
|
|
||||||
hljs.initHighlightingOnLoad();
|
|
||||||
</script>
|
|
||||||
{{ if .Params.math }}
|
{{ if .Params.math }}
|
||||||
{{ partial "math.html" . }}
|
{{ partial "math.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -47,10 +47,6 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "scripts" }}
|
{{ define "scripts" }}
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
|
|
||||||
<script>
|
|
||||||
hljs.initHighlightingOnLoad();
|
|
||||||
</script>
|
|
||||||
{{ if .Params.math }}
|
{{ if .Params.math }}
|
||||||
{{ partial "math.html" . }}
|
{{ partial "math.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue