Merge pull request #450 from rlemaitre/main
Integrate utteranc.es comment system
This commit is contained in:
commit
2adc4af46e
4 changed files with 76 additions and 0 deletions
|
@ -156,6 +156,42 @@ disableHugoGeneratorInject = false
|
|||
# [params.commento]
|
||||
# url = ""
|
||||
|
||||
# Utteranc.es is a lightweight comments widget built on GitHub issues.
|
||||
# See https://utteranc.es/ for documentation
|
||||
# Uncomment this to enable Utteranc.es.
|
||||
#
|
||||
# [params.utterances]
|
||||
# Your GitHub repository
|
||||
#
|
||||
# repository = ""
|
||||
|
||||
# label used for GitHub issues
|
||||
#
|
||||
# label = ""
|
||||
|
||||
# Blog Post <-> Issue mapping. This parameter is optional. Possible values are:
|
||||
# - pathname
|
||||
# - url
|
||||
# - title
|
||||
# - og:title
|
||||
# - issue number
|
||||
# - specific term
|
||||
#
|
||||
# issueTerm = ""
|
||||
|
||||
# Theme used: possible values are:
|
||||
# - github-light
|
||||
# - github-dark
|
||||
# - preferred-color-scheme
|
||||
# - github-dark-orange
|
||||
# - icy-dark
|
||||
# - dark-blue
|
||||
# - photon-dark
|
||||
# - boxy-light
|
||||
# - gruvbox-dark
|
||||
#
|
||||
# theme = ""
|
||||
|
||||
# Uncomment this if you want a portrait on your start page
|
||||
#
|
||||
# [params.portrait]
|
||||
|
|
4
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
4
layouts/_default/_markup/render-codeblock-mermaid.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
<pre class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</pre>
|
||||
{{ .Page.Store.Set "hasMermaid" true }}
|
|
@ -9,3 +9,28 @@
|
|||
<script src="{{ $val }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
|
||||
const settings = localStorage.getItem('theme') === 'dark' ?
|
||||
{
|
||||
startOnLoad: true,
|
||||
theme: 'dark',
|
||||
darkMode: true,
|
||||
themeVariables: {
|
||||
tertiaryColor: '#dee3ed'
|
||||
}
|
||||
}
|
||||
:
|
||||
{
|
||||
startOnLoad: true,
|
||||
theme: 'base',
|
||||
darkMode: false,
|
||||
themeVariables: {
|
||||
tertiaryColor: '#dee3ed'
|
||||
}
|
||||
}
|
||||
;
|
||||
mermaid.initialize(settings);
|
||||
</script>
|
||||
{{ end }}
|
|
@ -135,5 +135,16 @@
|
|||
<div id="commento"></div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.Utterances.Repository }}
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo="{{ .Site.Params.Utterances.Repository }}"
|
||||
{{ if .Site.Params.Utterances.Label }}label="{{ .Site.Params.Utterances.Label }}"{{ end }}
|
||||
issue-term="{{ .Site.Params.Utterances.IssueTerm }}"
|
||||
theme="{{ .Site.Params.Utterances.Theme }}"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue