summaryrefslogtreecommitdiff
path: root/themes/hugo-coder/layouts/partials/posts
diff options
context:
space:
mode:
Diffstat (limited to 'themes/hugo-coder/layouts/partials/posts')
m---------themes/hugo-coder0
-rw-r--r--themes/hugo-coder/layouts/partials/posts/commento.html4
-rw-r--r--themes/hugo-coder/layouts/partials/posts/disqus.html3
-rw-r--r--themes/hugo-coder/layouts/partials/posts/math.html38
-rw-r--r--themes/hugo-coder/layouts/partials/posts/series.html29
-rw-r--r--themes/hugo-coder/layouts/partials/posts/utterances.html12
6 files changed, 86 insertions, 0 deletions
diff --git a/themes/hugo-coder b/themes/hugo-coder
deleted file mode 160000
Subproject 55b2a150f990bc56364dba347bc9acc6aab07be
diff --git a/themes/hugo-coder/layouts/partials/posts/commento.html b/themes/hugo-coder/layouts/partials/posts/commento.html
new file mode 100644
index 0000000..93a245e
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/posts/commento.html
@@ -0,0 +1,4 @@
1{{- if and (isset .Site.Params "commentourl") (not (eq .Site.Params.commentoURL "" )) (eq (.Params.disableComments | default false) false) -}}
2<div id="commento"></div>
3<script src="{{ .Site.Params.commentoURL }}/js/commento.js"></script>
4{{- end -}}
diff --git a/themes/hugo-coder/layouts/partials/posts/disqus.html b/themes/hugo-coder/layouts/partials/posts/disqus.html
new file mode 100644
index 0000000..b0ffb1f
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/posts/disqus.html
@@ -0,0 +1,3 @@
1{{- if and (not (eq (.Site.DisqusShortname | default "") "")) (eq (.Params.disableComments | default false) false) -}}
2 {{ template "_internal/disqus.html" . }}
3{{- end -}}
diff --git a/themes/hugo-coder/layouts/partials/posts/math.html b/themes/hugo-coder/layouts/partials/posts/math.html
new file mode 100644
index 0000000..bc39ce5
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/posts/math.html
@@ -0,0 +1,38 @@
1{{- if or (.Params.math) (.Site.Params.math) -}}
2 <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
3 {{/* The file is already minified */}}
4 <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
5 <script>
6 MathJax = {
7 tex: {
8 inlineMath: [
9 ['$', '$'], ['\\(', '\\)']
10 ],
11 processEscapes: true,
12 processEnvironments: true
13 },
14 options: {
15 skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
16 }
17 };
18 </script>
19{{- end -}}
20{{- if or (.Params.katex) (.Site.Params.katex) -}}
21 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.css"
22 integrity="sha384-Um5gpz1odJg5Z4HAmzPtgZKdTBHZdw8S29IecapCSB31ligYPhHQZMIlWLYQGVoc" crossorigin="anonymous">
23 {{/* The loading of KaTeX is deferred to speed up page rendering */}}
24 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/katex.min.js"
25 integrity="sha384-YNHdsYkH6gMx9y3mRkmcJ2mFUjTd0qNQQvY9VYZgQd7DcN7env35GzlmFaZ23JGp" crossorigin="anonymous"></script>
26 <script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.11/dist/contrib/auto-render.min.js"
27 integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"
28 onload="renderMathInElement(document.body,
29 {
30 delimiters: [
31 {left: '$$', right: '$$', display:true},
32 {left: '$', right: '$', display:false},
33 {left: '\\(', right: '\\)', display: false},
34 {left: '\\[', right: '\\]', display: true}
35 ]
36 }
37 );"></script>
38{{- end -}}
diff --git a/themes/hugo-coder/layouts/partials/posts/series.html b/themes/hugo-coder/layouts/partials/posts/series.html
new file mode 100644
index 0000000..d08a83d
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/posts/series.html
@@ -0,0 +1,29 @@
1{{ $currentPageUrl := .RelPermalink }}
2{{ if .Params.series }}
3<section class="see-also">
4 {{ range .Params.series }}
5 {{ $name := . | urlize }}
6 {{ $series := index $.Site.Taxonomies.series $name }}
7 {{ if gt (len $series.Pages) 1 }}
8 <h3 id="{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
9 {{ i18n "see_also" | default "See also in" }} {{ . }}
10 <a class="heading-link" href="#{{ i18n "see_also" | default "See also in" | anchorize }}-{{ anchorize . | safeURL }}">
11 <i class="fa fa-link" aria-hidden="true"></i>
12 </a>
13 </h3>
14 <nav>
15 <ul>
16 {{ $maxItems := $.Site.Params.maxSeeAlsoItems | default 5 }}
17 {{ range first (add $maxItems 1) $series.Pages }}
18 {{ if ne .RelPermalink $currentPageUrl }}
19 <li>
20 <a href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
21 </li>
22 {{ end }}
23 {{ end }}
24 </ul>
25 </nav>
26 {{ end }}
27 {{ end }}
28</section>
29{{ end }}
diff --git a/themes/hugo-coder/layouts/partials/posts/utterances.html b/themes/hugo-coder/layouts/partials/posts/utterances.html
new file mode 100644
index 0000000..0feea41
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/posts/utterances.html
@@ -0,0 +1,12 @@
1{{- if isset .Site.Params "utterances" -}}
2 {{- if and (isset .Site.Params.utterances "repo") (not (eq .Site.Params.utterances.repo "" )) (eq (.Params.disable_comments | default false) false) -}}
3 <script src="https://utteranc.es/client.js"
4 repo= "{{ .Site.Params.utterances.repo }}"
5 issue-term="{{ default "title" .Site.Params.utterances.issueTerm }}"
6 {{ if isset .Site.Params.utterances "label" }}label="{{ .Site.Params.utterances.label }}"{{ end }}
7 theme="{{ default "github-light" .Site.Params.utterances.theme }}"
8 crossorigin="anonymous"
9 async>
10 </script>
11 {{- end -}}
12{{- end -}}