From ad823cc4d72edbab10f0dadf99b30df91c3f7c50 Mon Sep 17 00:00:00 2001 From: Dimitar Trendafilov Date: Sun, 16 Aug 2020 08:38:04 +0300 Subject: Squashed 'website/themes/reveal-hugo/' content from commit ff9f389 git-subtree-dir: website/themes/reveal-hugo git-subtree-split: ff9f389743ae2fe5c5cc6101455db0616e8548e2 --- layouts/_default/baseof.reveal.html | 36 ++++++++++++++++++ layouts/_default/bundle.reveal.html | 4 ++ layouts/_default/index.reveal.html | 4 ++ layouts/_default/list.reveal.html | 4 ++ layouts/_default/single.reveal.html | 0 layouts/partials/layout/head.html | 7 ++++ layouts/partials/layout/javascript.html | 63 ++++++++++++++++++++++++++++++++ layouts/partials/layout/theme.html | 28 ++++++++++++++ layouts/partials/reveal-hugo/body.html | 1 + layouts/partials/reveal-hugo/end.html | 1 + layouts/partials/reveal-hugo/head.html | 1 + layouts/partials/reveal-hugo/slides.html | 26 +++++++++++++ layouts/shortcodes/frag.html | 4 ++ layouts/shortcodes/fragment.html | 6 +++ layouts/shortcodes/markdown.html | 8 ++++ layouts/shortcodes/note.html | 4 ++ layouts/shortcodes/section.html | 5 +++ layouts/shortcodes/slide.html | 63 ++++++++++++++++++++++++++++++++ 18 files changed, 265 insertions(+) create mode 100644 layouts/_default/baseof.reveal.html create mode 100644 layouts/_default/bundle.reveal.html create mode 100644 layouts/_default/index.reveal.html create mode 100644 layouts/_default/list.reveal.html create mode 100644 layouts/_default/single.reveal.html create mode 100644 layouts/partials/layout/head.html create mode 100644 layouts/partials/layout/javascript.html create mode 100644 layouts/partials/layout/theme.html create mode 100644 layouts/partials/reveal-hugo/body.html create mode 100644 layouts/partials/reveal-hugo/end.html create mode 100644 layouts/partials/reveal-hugo/head.html create mode 100644 layouts/partials/reveal-hugo/slides.html create mode 100644 layouts/shortcodes/frag.html create mode 100644 layouts/shortcodes/fragment.html create mode 100644 layouts/shortcodes/markdown.html create mode 100644 layouts/shortcodes/note.html create mode 100644 layouts/shortcodes/section.html create mode 100644 layouts/shortcodes/slide.html (limited to 'layouts') diff --git a/layouts/_default/baseof.reveal.html b/layouts/_default/baseof.reveal.html new file mode 100644 index 0000000..a25a4d7 --- /dev/null +++ b/layouts/_default/baseof.reveal.html @@ -0,0 +1,36 @@ + + + + {{ partial "layout/head" . }} + {{ partial "layout/theme" . }} + + {{- partial "reveal-hugo/head" . -}} + + {{- $sectionHeadPartial := printf "%s/reveal-hugo/head" (.Page.Section | default "home") -}} + {{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }} + + +
+
+ {{- block "main" . -}}{{- end -}} +
+ + {{- partial "reveal-hugo/end" . -}} + + {{- $sectionHeadPartial := printf "%s/reveal-hugo/end" (.Page.Section | default "home") -}} + {{- if fileExists (printf "layouts/partials/%s.html" $sectionHeadPartial) -}}{{ partial $sectionHeadPartial . }}{{- end }} +
+ {{- partial "layout/javascript" . }} + + {{- partial "reveal-hugo/body" . }} + + {{- $sectionBodyPartial := printf "%s/reveal-hugo/body" (.Page.Section | default "home") -}} + {{- if fileExists (printf "layouts/partials/%s.html" $sectionBodyPartial) -}}{{ partial $sectionBodyPartial . }}{{- end }} + + diff --git a/layouts/_default/bundle.reveal.html b/layouts/_default/bundle.reveal.html new file mode 100644 index 0000000..62fb5c8 --- /dev/null +++ b/layouts/_default/bundle.reveal.html @@ -0,0 +1,4 @@ +{{ define "main" }} + {{ partial "reveal-hugo/slides" (slice .Page) }} + {{ partial "reveal-hugo/slides" (.Resources.ByType "page") }} +{{ end }} diff --git a/layouts/_default/index.reveal.html b/layouts/_default/index.reveal.html new file mode 100644 index 0000000..1b4b67c --- /dev/null +++ b/layouts/_default/index.reveal.html @@ -0,0 +1,4 @@ +{{ define "main" }} + {{ partial "reveal-hugo/slides" (slice .Page) }} + {{ partial "reveal-hugo/slides" (where .Site.RegularPages "Type" "home") }} +{{ end }} diff --git a/layouts/_default/list.reveal.html b/layouts/_default/list.reveal.html new file mode 100644 index 0000000..63e4b9d --- /dev/null +++ b/layouts/_default/list.reveal.html @@ -0,0 +1,4 @@ +{{ define "main" }} + {{ partial "reveal-hugo/slides" (slice .Page) }} + {{ partial "reveal-hugo/slides" (where .Pages "Kind" "page") }} +{{ end }} diff --git a/layouts/_default/single.reveal.html b/layouts/_default/single.reveal.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/layout/head.html b/layouts/partials/layout/head.html new file mode 100644 index 0000000..085923a --- /dev/null +++ b/layouts/partials/layout/head.html @@ -0,0 +1,7 @@ + +{{ or .Page.Title .Site.Title }} +{{ with $.Param "description" }}{{ end }} +{{ with .Site.Author.name }}{{ end }} + + + \ No newline at end of file diff --git a/layouts/partials/layout/javascript.html b/layouts/partials/layout/javascript.html new file mode 100644 index 0000000..fe99cb9 --- /dev/null +++ b/layouts/partials/layout/javascript.html @@ -0,0 +1,63 @@ + + + + +{{- $reveal_location := $.Param "reveal_hugo.reveal_cdn" | default "reveal-js" -}} + + + + + + + + + + +{{ 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 }} + + {{ end }} + + +{{ end }} + +{{ range $.Param "reveal_hugo.plugins" }} + +{{ end }} +{{- $custom_js := $.Param "reveal_hugo.custom_js" -}} +{{- if $custom_js -}} + +{{- end -}} diff --git a/layouts/partials/layout/theme.html b/layouts/partials/layout/theme.html new file mode 100644 index 0000000..a4f7c86 --- /dev/null +++ b/layouts/partials/layout/theme.html @@ -0,0 +1,28 @@ + +{{- $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" -}} + + +{{- $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 | resources.ExecuteAsTemplate "_.scss" . | toCSS $custom_theme_options | minify | fingerprint }} + + {{- else -}} + + {{- end -}} +{{ else -}} + {{- $theme := $.Param "reveal_hugo.theme" | default "black" -}} + +{{ end -}} +{{ if $.Param "reveal_hugo.load_default_plugins" | default true -}} + + {{- $highlight_theme := $.Param "reveal_hugo.highlight_theme" | default "default" -}} + +{{- end }} +{{- $custom_css := $.Param "reveal_hugo.custom_css" -}} +{{- if $custom_css -}} + +{{- end -}} diff --git a/layouts/partials/reveal-hugo/body.html b/layouts/partials/reveal-hugo/body.html new file mode 100644 index 0000000..f2dd4bf --- /dev/null +++ b/layouts/partials/reveal-hugo/body.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/partials/reveal-hugo/end.html b/layouts/partials/reveal-hugo/end.html new file mode 100644 index 0000000..1ca9f46 --- /dev/null +++ b/layouts/partials/reveal-hugo/end.html @@ -0,0 +1 @@ + diff --git a/layouts/partials/reveal-hugo/head.html b/layouts/partials/reveal-hugo/head.html new file mode 100644 index 0000000..ed1e892 --- /dev/null +++ b/layouts/partials/reveal-hugo/head.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/partials/reveal-hugo/slides.html b/layouts/partials/reveal-hugo/slides.html new file mode 100644 index 0000000..0bed8a9 --- /dev/null +++ b/layouts/partials/reveal-hugo/slides.html @@ -0,0 +1,26 @@ + +{{ range . -}} + + {{- if ne (len .Content) 0 -}} + + {{- $content := replace .Content "
\n\n
" "
" -}} + + + {{- $content := replaceRE ` + {{- $content := replaceRE `()` `$1" data-line-numbers>` $content -}} + + {{- $content := replaceRE `()` `$1" data-line-numbers="$2">` $content -}} + + {{- $content := replace $content "
" "
" -}} + + {{- range (split $content "
") -}} + + {{- if not (in . "data-noprocess") -}} +
+ {{- end -}} + {{- . | safeHTML -}} +
+ {{- end -}} + {{- end -}} +{{- end }} diff --git a/layouts/shortcodes/frag.html b/layouts/shortcodes/frag.html new file mode 100644 index 0000000..c1de8c8 --- /dev/null +++ b/layouts/shortcodes/frag.html @@ -0,0 +1,4 @@ + + {{ .Get "c" }} + \ No newline at end of file diff --git a/layouts/shortcodes/fragment.html b/layouts/shortcodes/fragment.html new file mode 100644 index 0000000..bcd5627 --- /dev/null +++ b/layouts/shortcodes/fragment.html @@ -0,0 +1,6 @@ +{{/* Render .Inner before processing the shortcode. */}} +{{ $_hugo_config := `{ "version": 1 }` }} + + {{ .Inner }} + \ No newline at end of file diff --git a/layouts/shortcodes/markdown.html b/layouts/shortcodes/markdown.html new file mode 100644 index 0000000..f5effbc --- /dev/null +++ b/layouts/shortcodes/markdown.html @@ -0,0 +1,8 @@ +
+ +
\ No newline at end of file diff --git a/layouts/shortcodes/note.html b/layouts/shortcodes/note.html new file mode 100644 index 0000000..f5ee55e --- /dev/null +++ b/layouts/shortcodes/note.html @@ -0,0 +1,4 @@ +{{/* Markdown is not rendered inside