Support custom_theme_options param to customize asset compilation

This commit is contained in:
dzello
2019-02-06 14:10:39 +01:00
parent 8ee5f12eaf
commit dfda8c0cd4
+3 -2
View File
@@ -1,12 +1,13 @@
<!-- Theme used for presentation -->
{{- $reveal_location := $.Param "reveal_hugo.reveal_cdn" | default "reveal-js" -}}
{{- $highlight_location := $.Param "reveal_hugo.highlight_cdn" | default "highlight-js" -}}
{{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
<link rel="stylesheet" href="{{ printf "%s/css/reveal.css" $reveal_location | relURL }}">
{{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
{{- if $custom_theme -}}
{{- $custom_theme_options := $.Param "reveal_hugo.custom_theme_options" | default dict -}}
{{- if $.Param "reveal_hugo.custom_theme_compile" -}}
{{ $asset := resources.Get $custom_theme | toCSS | minify | fingerprint }}
{{ $asset := resources.Get $custom_theme | toCSS $custom_theme_options | minify | fingerprint }}
<link rel="stylesheet" href="{{ $asset.Permalink }}" id="theme">
{{- else -}}
<link rel="stylesheet" href="{{ $custom_theme | relURL }}" id="theme">