Add reveal_hugo.load_default_plugins option

This commit is contained in:
Kostas Chatzikokolakis
2019-09-11 13:40:22 +03:00
parent 68429eccc3
commit cd5ca462ac
3 changed files with 14 additions and 9 deletions
+7 -5
View File
@@ -47,12 +47,14 @@
</script>
<!-- load Reveal.js plugins after Reveal.js is initialized -->
<script type="text/javascript" src="{{ printf "%s/lib/js/classList.js" $reveal_location | relURL }}"></script>
{{ $default_plugins := slice "plugin/markdown/marked.js" "plugin/markdown/markdown.js" "plugin/highlight/highlight.js" "plugin/zoom-js/zoom.js" }}
{{ range $default_plugins }}
<script type="text/javascript" src="{{ printf "%s/%s" $reveal_location . | relURL }}"></script>
{{ if $.Param "reveal_hugo.load_default_plugins" | default true }}
{{ $default_plugins := slice "plugin/markdown/marked.js" "plugin/markdown/markdown.js" "plugin/highlight/highlight.js" "plugin/zoom-js/zoom.js" }}
{{ range $default_plugins }}
<script type="text/javascript" src="{{ printf "%s/%s" $reveal_location . | relURL }}"></script>
{{ end }}
<!-- always use local version of the notes plugin since HTML file it requires isn't on CDN -->
<script type="text/javascript" src="{{ "reveal-js/plugin/notes/notes.js" | relURL }}"></script>
{{ end }}
<!-- always use local version of the notes plugin since HTML file it requires isn't on CDN -->
<script type="text/javascript" src="{{ "reveal-js/plugin/notes/notes.js" | relURL }}"></script>
<!-- load custom plugins locally only (not CDN since many plugins won't exist there) -->
{{ range $.Param "reveal_hugo.plugins" }}
<script type="text/javascript" src="{{ . | relURL }}"></script>
+5 -3
View File
@@ -16,6 +16,8 @@
{{- $theme := $.Param "reveal_hugo.theme" | default "black" -}}
<link rel="stylesheet" href="{{ printf "%s/css/theme/%s.css" $reveal_location $theme | relURL }}" id="theme">
{{ end -}}
<!-- Theme used for syntax highlighting of code -->
{{- $highlight_theme := $.Param "reveal_hugo.highlight_theme" | default "default" -}}
<link rel="stylesheet" href="{{ printf "%s/%s.min.css" $highlight_location $highlight_theme | relURL }}">
{{ if $.Param "reveal_hugo.load_default_plugins" | default true -}}
<!-- Theme used for syntax highlighting of code -->
{{- $highlight_theme := $.Param "reveal_hugo.highlight_theme" | default "default" -}}
<link rel="stylesheet" href="{{ printf "%s/%s.min.css" $highlight_location $highlight_theme | relURL }}">
{{- end }}