add disable animation, mermaid support

Signed-off-by: GitHub Action <action@github.com>
This commit is contained in:
GitHub Action
2024-10-23 17:21:35 +00:00
parent 08494a1088
commit cdef5afeed
6 changed files with 17 additions and 11 deletions

View File

@ -6,6 +6,7 @@ $dark-grey: #3b3e48 !default;
$highlight-grey: #7d828a !default; $highlight-grey: #7d828a !default;
$midnightblue: #2c3e50 !default; $midnightblue: #2c3e50 !default;
$typewriter: hsl(172, 100%, 36%) !default; $typewriter: hsl(172, 100%, 36%) !default;
$codebackground: #272822 !default;
// Scroll to Top Default colors // Scroll to Top Default colors
$stt-stroke: #ccc !default; $stt-stroke: #ccc !default;

View File

@ -1,9 +1,7 @@
@import "predefined.scss"; @import "predefined.scss";
@import "normalize.scss"; @import "normalize.scss";
@import "syntax.scss"; @import "syntax.scss";
{{ if ne false .Site.Params.usesAnimation }}
@import "animate.scss"; @import "animate.scss";
{{ end }}
@import "scroll.scss"; @import "scroll.scss";
@import "socialshare.scss"; @import "socialshare.scss";
{{ if (fileExists "assets/scss/userstyles.scss") }} {{ if (fileExists "assets/scss/userstyles.scss") }}
@ -66,7 +64,9 @@ pre {
background: $midnightblue; background: $midnightblue;
overflow-x: auto; overflow-x: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
&.mermaid {
background: $codebackground;
}
code { code {
padding: 0; padding: 0;
margin: 0; margin: 0;

View File

@ -119,8 +119,7 @@ expiryDate = ["expiryDate"]
# allowRobots = "index, follow" # allowRobots = "index, follow"
# siteNoIndex = false # siteNoIndex = false
# noIndexPages = ["404 Page not found"] # noIndexPages = ["404 Page not found"]
# usesAnimation = true # Defaults to true # usesAnimation = true
[[params.socialLinks]] [[params.socialLinks]]
name = "mastodon" name = "mastodon"

View File

@ -0,0 +1,5 @@
{{ .Page.Store.Set "hasMermaid" true -}}
<pre class="mermaid">
{{- .Inner | safeHTML }}
</pre>

View File

@ -46,12 +46,7 @@
<script defer src="{{ $c_js.Permalink }}" {{ printf "integrity=%q" $c_js.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script> <script defer src="{{ $c_js.Permalink }}" {{ printf "integrity=%q" $c_js.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{- end }} {{- end }}
{{- partial "mathjax.html" . -}} {{- partial "mathjax.html" . -}}
{{ if .Page.Store.Get "hasMermaid" }} {{- partial "mermaid.html" . -}}
<script defer type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true,theme: 'dark' });
</script>
{{ end }}
{{- if templates.Exists "partials/extra-foot.html" -}}{{- partial "extra-foot.html" . -}}{{- end }} {{- if templates.Exists "partials/extra-foot.html" -}}{{- partial "extra-foot.html" . -}}{{- end }}
</body> </body>

View File

@ -0,0 +1,6 @@
{{- if .Page.Store.Get "hasMermaid" -}}
<script defer async type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true,theme: 'dark' });
</script>
{{- end -}}