Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/peaceiris/hugo-theme-iris.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShohei Ueda <30958501+peaceiris@users.noreply.github.com>2022-04-24 07:01:45 +0300
committerGitHub <noreply@github.com>2022-04-24 07:01:45 +0300
commit0741f5dc6b1ab16139c66462a3bbbf91d854fb66 (patch)
treea32b24a07dc4b55502e7d2535f3a0cd94c532c55
parent8876cc3707937c2e16bd8ab42d7fae2f7fc9873e (diff)
feat: manage reveal.js with npm (#515)
-rw-r--r--exampleSite/config/_default/config.yaml2
-rw-r--r--exampleSite/package-lock.json16
-rw-r--r--exampleSite/package.json3
-rw-r--r--layouts/partials/head.html4
-rw-r--r--layouts/partials/revealjs/js.html12
5 files changed, 27 insertions, 10 deletions
diff --git a/exampleSite/config/_default/config.yaml b/exampleSite/config/_default/config.yaml
index a3e7ee46..f5a4b1d1 100644
--- a/exampleSite/config/_default/config.yaml
+++ b/exampleSite/config/_default/config.yaml
@@ -10,6 +10,8 @@ module:
target: static
- source: node_modules/mathjax
target: assets/mathjax
+ - source: node_modules/reveal.js
+ target: assets/reveal.js
- source: node_modules/mathjax/es5/output/chtml/fonts/woff-v2
target: static/mathjax/es5/output/chtml/fonts/woff-v2
diff --git a/exampleSite/package-lock.json b/exampleSite/package-lock.json
index 70c5d043..fd6bf1ff 100644
--- a/exampleSite/package-lock.json
+++ b/exampleSite/package-lock.json
@@ -10,7 +10,8 @@
"license": "MIT",
"dependencies": {
"bulma": "^0.9.3",
- "mathjax": "^3.2.0"
+ "mathjax": "^3.2.0",
+ "reveal.js": "^4.0.2"
}
},
"node_modules/bulma": {
@@ -22,6 +23,14 @@
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.2.0.tgz",
"integrity": "sha512-PL+rdYRK4Wxif+SQ94zP/L0sv6/oW/1WdQiIx0Jvn9FZaU5W9E6nlIv8liYAXBNPL2Fw/i+o/mZ1212eSzn0Cw=="
+ },
+ "node_modules/reveal.js": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-4.3.1.tgz",
+ "integrity": "sha512-1kyEnWeUkaCdBdX//XXq9dtBK95ppvIlSwlHelrP8/wrX6LcsYp4HT9WTFoFEOUBfVqkm8C2aHQ367o+UKfcxw==",
+ "engines": {
+ "node": ">=10.0.0"
+ }
}
},
"dependencies": {
@@ -34,6 +43,11 @@
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.2.0.tgz",
"integrity": "sha512-PL+rdYRK4Wxif+SQ94zP/L0sv6/oW/1WdQiIx0Jvn9FZaU5W9E6nlIv8liYAXBNPL2Fw/i+o/mZ1212eSzn0Cw=="
+ },
+ "reveal.js": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/reveal.js/-/reveal.js-4.3.1.tgz",
+ "integrity": "sha512-1kyEnWeUkaCdBdX//XXq9dtBK95ppvIlSwlHelrP8/wrX6LcsYp4HT9WTFoFEOUBfVqkm8C2aHQ367o+UKfcxw=="
}
}
}
diff --git a/exampleSite/package.json b/exampleSite/package.json
index c8b51f97..ea27c4b3 100644
--- a/exampleSite/package.json
+++ b/exampleSite/package.json
@@ -8,7 +8,8 @@
},
"dependencies": {
"bulma": "^0.9.3",
- "mathjax": "^3.2.0"
+ "mathjax": "^3.2.0",
+ "reveal.js": "^4.0.2"
},
"description": "",
"license": "MIT",
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 04aee674..a7f2bb6b 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -4,9 +4,9 @@
{{ if $.Params.slide }}
<style>
- {{ $cssMain := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/reveal.css" | toCSS | minify }}
+ {{ $cssMain := resources.Get "reveal.js/dist/reveal.css" | toCSS | minify }}
{{ $cssMain.Content | safeCSS }}
- {{ $cssTheme := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/theme/white.css" | toCSS | minify }}
+ {{ $cssTheme := resources.Get "reveal.js/dist/theme/white.css" | toCSS | minify }}
{{ $cssTheme.Content | safeCSS }}
</style>
{{ else }}
diff --git a/layouts/partials/revealjs/js.html b/layouts/partials/revealjs/js.html
index 43f55634..bddfc459 100644
--- a/layouts/partials/revealjs/js.html
+++ b/layouts/partials/revealjs/js.html
@@ -1,24 +1,24 @@
-{{ $revealjs := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/dist/reveal.js" }}
+{{ $revealjs := resources.Get "reveal.js/dist/reveal.js" }}
{{ $revealjsHash := $revealjs | resources.Fingerprint "sha512" }}
<script src="{{ $revealjsHash.Permalink }}" integrity="{{ $revealjsHash.Data.Integrity }}"></script>
-{{ $markdown := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/plugin/markdown/markdown.js" }}
+{{ $markdown := resources.Get "reveal.js/plugin/markdown/markdown.js" }}
{{ $markdownHash := $markdown | resources.Fingerprint "sha512" }}
<script src="{{ $markdownHash.Permalink }}" integrity="{{ $markdownHash.Data.Integrity }}"></script>
-{{ $highlight := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/plugin/highlight/highlight.js" }}
+{{ $highlight := resources.Get "reveal.js/plugin/highlight/highlight.js" }}
{{ $highlightHash := $highlight | resources.Fingerprint "sha512" }}
<script src="{{ $highlightHash.Permalink }}" integrity="{{ $highlightHash.Data.Integrity }}"></script>
-{{ $zoom := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/plugin/zoom/zoom.js" }}
+{{ $zoom := resources.Get "reveal.js/plugin/zoom/zoom.js" }}
{{ $zoomHash := $zoom | resources.Fingerprint "sha512" }}
<script src="{{ $zoomHash.Permalink }}" integrity="{{ $zoomHash.Data.Integrity }}"></script>
-{{ $notes := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/plugin/notes/notes.js" }}
+{{ $notes := resources.Get "reveal.js/plugin/notes/notes.js" }}
{{ $notesHash := $notes | resources.Fingerprint "sha512" }}
<script src="{{ $notesHash.Permalink }}" integrity="{{ $notesHash.Data.Integrity }}"></script>
-{{ $math := resources.GetRemote "https://cdn.jsdelivr.net/npm/reveal.js@4.3.1/plugin/math/math.js" }}
+{{ $math := resources.Get "reveal.js/plugin/math/math.js" }}
{{ $mathHash := $math | resources.Fingerprint "sha512" }}
<script src="{{ $mathHash.Permalink }}" integrity="{{ $mathHash.Data.Integrity }}"></script>