theme.html 1.7 KB

12345678910111213141516171819202122232425262728
  1. <!-- Theme used for presentation -->
  2. {{- $reveal_location := $.Param "reveal_hugo.reveal_cdn" | default "reveal-js" -}}
  3. {{- $highlight_location := $.Param "reveal_hugo.highlight_cdn" | default "highlight-js" -}}
  4. {{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
  5. <link rel="stylesheet" href="{{ printf "%s/css/reset.css" $reveal_location | relURL }}">
  6. <link rel="stylesheet" href="{{ printf "%s/css/reveal.css" $reveal_location | relURL }}">
  7. {{- $custom_theme := $.Param "reveal_hugo.custom_theme" -}}
  8. {{- if $custom_theme -}}
  9. {{- $custom_theme_options := $.Param "reveal_hugo.custom_theme_options" | default dict -}}
  10. {{- if $.Param "reveal_hugo.custom_theme_compile" -}}
  11. {{ $asset := resources.Get $custom_theme | resources.ExecuteAsTemplate "_.scss" . | toCSS $custom_theme_options | minify | fingerprint }}
  12. <link rel="stylesheet" href="{{ $asset.Permalink | relURL }}" id="theme">
  13. {{- else -}}
  14. <link rel="stylesheet" href="{{ $custom_theme | relURL }}" id="theme">
  15. {{- end -}}
  16. {{ else -}}
  17. {{- $theme := $.Param "reveal_hugo.theme" | default "black" -}}
  18. <link rel="stylesheet" href="{{ printf "%s/css/theme/%s.css" $reveal_location $theme | relURL }}" id="theme">
  19. {{ end -}}
  20. {{ if $.Param "reveal_hugo.load_default_plugins" | default true -}}
  21. <!-- Theme used for syntax highlighting of code -->
  22. {{- $highlight_theme := $.Param "reveal_hugo.highlight_theme" | default "default" -}}
  23. <link rel="stylesheet" href="{{ printf "%s/%s.min.css" $highlight_location $highlight_theme | relURL }}">
  24. {{- end }}
  25. {{- $custom_css := $.Param "reveal_hugo.custom_css" -}}
  26. {{- if $custom_css -}}
  27. <link rel="stylesheet" href="{{ $custom_css | relURL }}" id="custom_css">
  28. {{- end -}}