diff --git a/modules/wowchemy-plugin-reveal/README.md b/modules/wowchemy-plugin-reveal/README.md new file mode 100644 index 00000000..ae28a319 --- /dev/null +++ b/modules/wowchemy-plugin-reveal/README.md @@ -0,0 +1,22 @@ +# wowchemy-plugin-reveal + +A Wowchemy/Hugo plugin for [Reveal.JS](https://revealjs.com/). + +Empowers you to easily create, share, and present slide decks using the open, future-proof Markdown standard. + +Supports math, syntax highlighting, diagrams, speaker notes, and much more! + +## Install + +1. Add the module to your `config/_default/config.yaml` alongside the core Wowchemy module: + + ```yaml + module: + imports: + - path: github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy + - path: github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal + ``` + +## Usage + +[View the documentation](https://wowchemy.com/docs/content/slides/) diff --git a/modules/wowchemy/assets/js/wowchemy-slides.js b/modules/wowchemy-plugin-reveal/assets/js/wowchemy-slides.js similarity index 92% rename from modules/wowchemy/assets/js/wowchemy-slides.js rename to modules/wowchemy-plugin-reveal/assets/js/wowchemy-slides.js index 4e1a851a..edadf8f3 100644 --- a/modules/wowchemy/assets/js/wowchemy-slides.js +++ b/modules/wowchemy-plugin-reveal/assets/js/wowchemy-slides.js @@ -1,3 +1,10 @@ +/************************************************* + * Wowchemy - https://wowchemy.com/ + * License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md + * + * Reveal.JS integration + **************************************************/ + /* global RevealMarkdown, RevealSearch, RevealNotes, RevealMath, RevealZoom, Reveal, mermaid, RevealMenu */ diff --git a/modules/wowchemy-plugin-reveal/config.yaml b/modules/wowchemy-plugin-reveal/config.yaml new file mode 100644 index 00000000..51a337e7 --- /dev/null +++ b/modules/wowchemy-plugin-reveal/config.yaml @@ -0,0 +1,6 @@ +module: + mounts: + - source: assets + target: assets + - source: layouts + target: layouts diff --git a/modules/wowchemy-plugin-reveal/go.mod b/modules/wowchemy-plugin-reveal/go.mod new file mode 100644 index 00000000..32c22ffa --- /dev/null +++ b/modules/wowchemy-plugin-reveal/go.mod @@ -0,0 +1,3 @@ +module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal + +go 1.15 diff --git a/modules/wowchemy/layouts/partials/slides.html b/modules/wowchemy-plugin-reveal/layouts/partials/slides.html similarity index 100% rename from modules/wowchemy/layouts/partials/slides.html rename to modules/wowchemy-plugin-reveal/layouts/partials/slides.html diff --git a/modules/wowchemy/layouts/shortcodes/fragment.html b/modules/wowchemy-plugin-reveal/layouts/shortcodes/fragment.html similarity index 100% rename from modules/wowchemy/layouts/shortcodes/fragment.html rename to modules/wowchemy-plugin-reveal/layouts/shortcodes/fragment.html diff --git a/modules/wowchemy/layouts/shortcodes/slide.html b/modules/wowchemy-plugin-reveal/layouts/shortcodes/slide.html similarity index 100% rename from modules/wowchemy/layouts/shortcodes/slide.html rename to modules/wowchemy-plugin-reveal/layouts/shortcodes/slide.html diff --git a/modules/wowchemy/layouts/shortcodes/speaker_note.html b/modules/wowchemy-plugin-reveal/layouts/shortcodes/speaker_note.html similarity index 100% rename from modules/wowchemy/layouts/shortcodes/speaker_note.html rename to modules/wowchemy-plugin-reveal/layouts/shortcodes/speaker_note.html diff --git a/modules/wowchemy/layouts/slides/baseof.html b/modules/wowchemy-plugin-reveal/layouts/slides/baseof.html similarity index 90% rename from modules/wowchemy/layouts/slides/baseof.html rename to modules/wowchemy-plugin-reveal/layouts/slides/baseof.html index e5c86bcc..5e93251f 100644 --- a/modules/wowchemy/layouts/slides/baseof.html +++ b/modules/wowchemy-plugin-reveal/layouts/slides/baseof.html @@ -4,7 +4,6 @@ {{ $cdn_url_reveal := "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1" }} {{ $js := site.Data.assets.js }} - {{ $css := site.Data.assets.css }} @@ -38,9 +37,12 @@ {{ end }} {{/* Load any Reveal CSS customizations */}} - {{ $css_custom := resources.Get "css/reveal_custom.css" }} - {{ $style := slice $css_custom | resources.Concat "css/reveal_custom.css" | resources.Minify }} - + {{ $custom_reveal_css := printf "css/reveal_custom.css" }} + {{ if (fileExists (printf "assets/%s" $custom_reveal_css)) }} + {{ $css_custom := resources.Get "css/reveal_custom.css" }} + {{ $style := slice $css_custom | resources.Concat "css/reveal_custom.css" | resources.Minify }} + + {{ end }} diff --git a/modules/wowchemy/layouts/slides/list.html b/modules/wowchemy-plugin-reveal/layouts/slides/list.html similarity index 100% rename from modules/wowchemy/layouts/slides/list.html rename to modules/wowchemy-plugin-reveal/layouts/slides/list.html diff --git a/modules/wowchemy/layouts/slides/single.html b/modules/wowchemy-plugin-reveal/layouts/slides/single.html similarity index 100% rename from modules/wowchemy/layouts/slides/single.html rename to modules/wowchemy-plugin-reveal/layouts/slides/single.html diff --git a/modules/wowchemy/assets/css/reveal_custom.css b/modules/wowchemy/assets/css/reveal_custom.css deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/view-starter-dev.sh b/scripts/view-starter-dev.sh index f9201a55..7ae8c59c 100755 --- a/scripts/view-starter-dev.sh +++ b/scripts/view-starter-dev.sh @@ -3,6 +3,7 @@ HUGOxPARAMSxCMSxLOCAL_BACKEND=true \ HUGO_MODULE_REPLACEMENTS="github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy/v5 -> ../../../modules/wowchemy, github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify -> ../../../modules/wowchemy-plugin-netlify, +github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal -> ../../../modules/wowchemy-plugin-reveal, github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-netlify-cms -> ../../../modules/wowchemy-plugin-netlify-cms" \ -hugo server --panicOnWarning --renderStaticToDisk -F --port 80 --bind 0.0.0.0 \ +hugo server --panicOnWarning --renderStaticToDisk -F --port 8081 --bind 0.0.0.0 \ --source "starters/$1"