Initial Commit
This commit is contained in:
4
themes/hugo-coder/layouts/partials/posts/commento.html
Normal file
4
themes/hugo-coder/layouts/partials/posts/commento.html
Normal file
@ -0,0 +1,4 @@
|
||||
{{- if and (isset .Site.Params "commentourl") (not (eq .Site.Params.commentoURL "" )) (eq (.Params.disableComments | default false) false) -}}
|
||||
<div id="commento"></div>
|
||||
<script src="{{ .Site.Params.commentoURL }}/js/commento.js"></script>
|
||||
{{- end -}}
|
3
themes/hugo-coder/layouts/partials/posts/disqus.html
Normal file
3
themes/hugo-coder/layouts/partials/posts/disqus.html
Normal file
@ -0,0 +1,3 @@
|
||||
{{- if and (not (eq (.Site.DisqusShortname | default "") "")) (eq (.Params.disableComments | default false) false) -}}
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{- end -}}
|
19
themes/hugo-coder/layouts/partials/posts/math.html
Normal file
19
themes/hugo-coder/layouts/partials/posts/math.html
Normal file
@ -0,0 +1,19 @@
|
||||
{{- if or (.Params.math) (.Site.Params.math) (.Params.katex) (.Site.Params.katex) -}}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css"
|
||||
integrity="sha384-R4558gYOUz8mP9YWpZJjofhk+zx0AS11p36HnD2ZKj/6JR5z27gSSULCNHIRReVs" crossorigin="anonymous">
|
||||
{{/* The loading of KaTeX is deferred to speed up page rendering */}}
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js"
|
||||
integrity="sha384-z1fJDqw8ZApjGO3/unPWUPsIymfsJmyrDVWC8Tv/a1HeOtGmkwNd/7xUS0Xcnvsx" crossorigin="anonymous"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/contrib/auto-render.min.js"
|
||||
integrity="sha384-+XBljXPPiv+OzfbB3cVmLHf4hdUFHlWNZN5spNQ7rmHTXpd7WvJum6fIACpNNfIR" crossorigin="anonymous"
|
||||
onload="renderMathInElement(document.body,
|
||||
{
|
||||
delimiters: [
|
||||
{left: '$$', right: '$$', display:true},
|
||||
{left: '$', right: '$', display:false},
|
||||
{left: '\\(', right: '\\)', display: false},
|
||||
{left: '\\[', right: '\\]', display: true}
|
||||
]
|
||||
}
|
||||
);"></script>
|
||||
{{- end -}}
|
30
themes/hugo-coder/layouts/partials/posts/series.html
Normal file
30
themes/hugo-coder/layouts/partials/posts/series.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{ $currentPageUrl := .RelPermalink }}
|
||||
{{ if .Params.series }}
|
||||
<section class="see-also">
|
||||
{{ range .Params.series }}
|
||||
{{ $name := . | urlize }}
|
||||
{{ $series := index $.Site.Taxonomies.series $name }}
|
||||
{{ if gt (len $series.Pages) 1 }}
|
||||
<h3 id="{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
|
||||
{{ i18n "see_also" | default "See also in" }} {{ . }}
|
||||
<a class="heading-link" href="#{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
|
||||
<i class="fa fa-link" aria-hidden="true" title="{{ i18n "link_to_heading" | default "Link to heading" }}"></i>
|
||||
<span class="sr-only">{{ i18n "link_to_heading" | default "Link to heading" }}</span>
|
||||
</a>
|
||||
</h3>
|
||||
<nav>
|
||||
<ul>
|
||||
{{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
|
||||
{{ range first (add $maxItems 1) $series.Pages }}
|
||||
{{ if ne .RelPermalink $currentPageUrl }}
|
||||
<li>
|
||||
<a href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
24
themes/hugo-coder/layouts/partials/posts/utterances.html
Normal file
24
themes/hugo-coder/layouts/partials/posts/utterances.html
Normal file
@ -0,0 +1,24 @@
|
||||
{{- if isset .Site.Params "utterances" -}}
|
||||
{{- if and (isset .Site.Params.utterances "repo") (not (eq .Site.Params.utterances.repo "" )) (eq (.Params.disableComments | default false) false) -}}
|
||||
<div class="comments">
|
||||
<script>
|
||||
|
||||
let getTheme = window.localStorage && window.localStorage.getItem("colorscheme");
|
||||
|
||||
getTheme = getTheme == null ? '{{$.Site.Params.utterances.theme}}' : getTheme;
|
||||
|
||||
let theme = getTheme === 'dark' ? 'github-dark' : 'github-light';
|
||||
let s = document.createElement('script');
|
||||
s.src = 'https://utteranc.es/client.js';
|
||||
s.setAttribute('repo', '{{ .Site.Params.utterances.repo }}');
|
||||
s.setAttribute('issue-term', '{{ default "title" .Site.Params.utterances.issueTerm }}');
|
||||
s.setAttribute('theme', theme);
|
||||
s.setAttribute('crossorigin', 'anonymous');
|
||||
s.setAttribute('async', '');
|
||||
document.querySelector('div.comments').innerHTML = '';
|
||||
document.querySelector('div.comments').appendChild(s);
|
||||
|
||||
</script>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user