refactor: move Reveal.JS plugin to its own module

```
module:
  imports:
    - path: github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal
```

See #2792
This commit is contained in:
George Cushen committed 2022-08-15 18:06:37 +01:00
1 parent 22e2a7cf74
commit b49528cf1e
13 files changed
+46 -5

No files matched your search

+22
View File
@@ -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/)
@@ -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
*/
@@ -0,0 +1,6 @@
module:
mounts:
- source: assets
target: assets
- source: layouts
target: layouts
+3
View File
@@ -0,0 +1,3 @@
module github.com/wowchemy/wowchemy-hugo-themes/modules/wowchemy-plugin-reveal
go 1.15
@@ -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 }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@@ -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 }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ $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 }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
{{ end }}
</head>
<body>
Whitespace-only changes.
+2 -1
View File
@@ -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"