summaryrefslogtreecommitdiff
path: root/themes/hugo-coder/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'themes/hugo-coder/layouts')
m---------themes/hugo-coder0
-rw-r--r--themes/hugo-coder/layouts/404.html3
-rw-r--r--themes/hugo-coder/layouts/_default/_markup/render-heading.html6
-rw-r--r--themes/hugo-coder/layouts/_default/baseof.html160
-rw-r--r--themes/hugo-coder/layouts/_default/list.html11
-rw-r--r--themes/hugo-coder/layouts/_default/single.html7
-rw-r--r--themes/hugo-coder/layouts/_default/terms.html11
-rw-r--r--themes/hugo-coder/layouts/index.html3
-rw-r--r--themes/hugo-coder/layouts/partials/404.html7
-rw-r--r--themes/hugo-coder/layouts/partials/analytics/cloudflare.html4
-rw-r--r--themes/hugo-coder/layouts/partials/analytics/fathom.html13
-rw-r--r--themes/hugo-coder/layouts/partials/analytics/goatcounter.html2
-rw-r--r--themes/hugo-coder/layouts/partials/analytics/googletagmanager.html9
-rw-r--r--themes/hugo-coder/layouts/partials/analytics/matomo.html13
-rw-r--r--themes/hugo-coder/layouts/partials/analytics/plausible.html1
-rw-r--r--themes/hugo-coder/layouts/partials/csp.html1
-rw-r--r--themes/hugo-coder/layouts/partials/float.html7
-rw-r--r--themes/hugo-coder/layouts/partials/footer.html26
-rw-r--r--themes/hugo-coder/layouts/partials/header.html39
-rw-r--r--themes/hugo-coder/layouts/partials/home.html35
-rw-r--r--themes/hugo-coder/layouts/partials/list.html22
-rw-r--r--themes/hugo-coder/layouts/partials/page.html13
-rw-r--r--themes/hugo-coder/layouts/partials/pagination.html48
-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
-rw-r--r--themes/hugo-coder/layouts/partials/taxonomy/authors.html9
-rw-r--r--themes/hugo-coder/layouts/partials/taxonomy/categories.html9
-rw-r--r--themes/hugo-coder/layouts/partials/taxonomy/tags.html11
-rw-r--r--themes/hugo-coder/layouts/partials/terms.html28
-rw-r--r--themes/hugo-coder/layouts/posts/li.html4
-rw-r--r--themes/hugo-coder/layouts/posts/list.html21
-rw-r--r--themes/hugo-coder/layouts/posts/single.html52
-rw-r--r--themes/hugo-coder/layouts/shortcodes/notice.html12
36 files changed, 673 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/404.html b/themes/hugo-coder/layouts/404.html
new file mode 100644
index 0000000..23ecb19
--- /dev/null
+++ b/themes/hugo-coder/layouts/404.html
@@ -0,0 +1,3 @@
1{{ define "content" }}
2 {{ partial "404.html" . }}
3{{ end }}
diff --git a/themes/hugo-coder/layouts/_default/_markup/render-heading.html b/themes/hugo-coder/layouts/_default/_markup/render-heading.html
new file mode 100644
index 0000000..712241b
--- /dev/null
+++ b/themes/hugo-coder/layouts/_default/_markup/render-heading.html
@@ -0,0 +1,6 @@
1<h{{ .Level }} id="{{ .Anchor | safeURL }}">
2 {{ .Text | safeHTML }}
3 <a class="heading-link" href="#{{ .Anchor | safeURL }}">
4 <i class="fa fa-link" aria-hidden="true"></i>
5 </a>
6</h{{ .Level }}>
diff --git a/themes/hugo-coder/layouts/_default/baseof.html b/themes/hugo-coder/layouts/_default/baseof.html
new file mode 100644
index 0000000..89635ee
--- /dev/null
+++ b/themes/hugo-coder/layouts/_default/baseof.html
@@ -0,0 +1,160 @@
1<!DOCTYPE html>
2<html lang="{{ .Site.Language.Lang }}">
3
4 <head>
5 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <meta http-equiv="Content-Language" content="{{ .Site.Language.Lang }}">
8 <meta name="color-scheme" content="light dark">
9
10 {{ if .Site.Params.csp }}
11 {{ partial "csp.html" . }}
12 {{ end }}
13
14 {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
15 <meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}">
16 <meta name="keywords" content="{{ (delimit .Keywords ",") | default .Site.Params.keywords }}">
17
18 {{ template "_internal/twitter_cards.html" . }}
19 {{ template "_internal/opengraph.html" . }}
20
21 <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
22
23 {{ if .Permalink }}
24 <link rel="canonical" href="{{ .Permalink }}">
25 {{ end }}
26
27 <link rel="preload" href="/fonts/forkawesome-webfont.woff2?v=1.2.0" as="font" type="font/woff2" crossorigin>
28
29 {{ if .Site.IsServer }}
30 {{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
31 {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
32 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
33 {{ else }}
34 {{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
35 {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
36 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
37 {{ end }}
38
39 {{ if .Site.Params.rtl }}
40 {{ if .Site.IsServer }}
41 {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
42 {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
43 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
44 {{ else }}
45 {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
46 {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
47 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
48 {{ end }}
49 {{ end }}
50
51 {{ if or (eq .Site.Params.colorScheme "auto") (eq .Site.Params.colorScheme "dark") }}
52 {{ if .Site.IsServer }}
53 {{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
54 {{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
55 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
56 {{ else }}
57 {{ $cssOpts := (dict "targetPath" "css/coder-dark.css" ) }}
58 {{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts | minify | fingerprint }}
59 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
60 {{ end }}
61 {{ end }}
62
63 {{ range .Site.Params.customCSS }}
64 <link rel="stylesheet" href="{{ . | relURL }}" />
65 {{ end }}
66
67 {{ range .Site.Params.customSCSS }}
68 {{/* We don't change the targetPath to because it's transparent to users */}}
69 {{ if $.Site.IsServer }}
70 {{ $cssOpts := (dict "enableSourceMap" true ) }}
71 {{ $styles := resources.Get . | toCSS $cssOpts }}
72 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
73 {{ else }}
74 {{ $styles := resources.Get . | toCSS | minify | fingerprint }}
75 <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
76 {{ end }}
77 {{ end }}
78
79 <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | relURL }}" sizes="32x32">
80 <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | relURL }}" sizes="16x16">
81
82 <link rel="apple-touch-icon" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
83 <link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
84
85 {{ range .AlternativeOutputFormats -}}
86 {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
87 {{ end -}}
88
89 {{ if .Site.Params.enableTwemoji }}
90 <script defer src="https://twemoji.maxcdn.com/v/13.0.2/twemoji.min.js"
91 integrity="sha384-wyB/MspSJ/r2bT2kCj44qtsYRYlpzO2oAPhRj5myrWD63dt6qWv4x8AZe7Fl3K3b" crossorigin="anonymous"></script>
92 {{ end }}
93
94 {{ hugo.Generator }}
95 </head>
96
97 {{ $csClass := "colorscheme-light" }}
98 {{ if eq .Site.Params.colorScheme "dark" }}
99 {{ $csClass = "colorscheme-dark" }}
100 {{ else if eq .Site.Params.colorScheme "auto" }}
101 {{ $csClass = "colorscheme-auto" }}
102 {{ end }}
103 <body class="preload-transitions {{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}"
104 onload="{{ if .Site.Params.enableTwemoji }} twemoji.parse(document.body); {{ end }}"
105 >
106 <script src="//cdnjs.cloudflare.com/ajax/libs/Snowstorm/20131208/snowstorm-min.js"></script>
107 <script>snowStorm.followMouse = false;</script>
108 <script src="//cdnjs.cloudflare.com/ajax/libs/Snowstorm/20131208/snowstorm-min.js"></script>
109 <script>snowStorm.followMouse = false;</script>
110 {{ partial "float" . }}
111 <main class="wrapper">
112 {{ partial "header.html" . }}
113
114 <div class="content">
115 {{ block "content" . }}{{ end }}
116 </div>
117
118 {{ partial "footer.html" . }}
119 </main>
120
121 {{ if .Site.IsServer }}
122 {{ $script := resources.Get "js/coder.js" }}
123 <script src="{{ $script.RelPermalink }}"></script>
124 {{ else }}
125 {{ $script := resources.Get "js/coder.js" | minify | fingerprint }}
126 <script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
127 {{ end }}
128
129 {{ range .Site.Params.customJS }}
130 <script src="{{ . | relURL }}"></script>
131 {{ end }}
132
133 {{ template "_internal/google_analytics.html" . }}
134
135 {{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
136 {{- partial "analytics/fathom" . -}}
137 {{ end }}
138
139 {{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
140 {{- partial "analytics/plausible" . -}}
141 {{ end }}
142
143 {{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
144 {{- partial "analytics/goatcounter" . -}}
145 {{ end }}
146
147 {{ if and .Site.Params.cloudflare .Site.Params.cloudflare.token }}
148 {{- partial "analytics/cloudflare" . -}}
149 {{ end }}
150
151 {{ if and .Site.Params.matomo .Site.Params.matomo.serverURL }}
152 {{- partial "analytics/matomo" . -}}
153 {{ end }}
154
155 {{ if and .Site.Params.googleTagManager .Site.Params.googleTagManager.id }}
156 {{- partial "analytics/googletagmanager" . -}}
157 {{ end }}
158 </body>
159
160</html>
diff --git a/themes/hugo-coder/layouts/_default/list.html b/themes/hugo-coder/layouts/_default/list.html
new file mode 100644
index 0000000..e35b04c
--- /dev/null
+++ b/themes/hugo-coder/layouts/_default/list.html
@@ -0,0 +1,11 @@
1{{ define "title" }}
2 {{- if eq .Kind "term" -}}
3 {{- i18n .Data.Singular | title -}}
4 {{- print ": " -}}
5 {{- end -}}
6
7 {{- .Title }} · {{ .Site.Title -}}
8{{ end }}
9{{ define "content" }}
10 {{ partial "list.html" . }}
11{{ end }}
diff --git a/themes/hugo-coder/layouts/_default/single.html b/themes/hugo-coder/layouts/_default/single.html
new file mode 100644
index 0000000..6150c6a
--- /dev/null
+++ b/themes/hugo-coder/layouts/_default/single.html
@@ -0,0 +1,7 @@
1{{ define "title" }}
2 {{ .Title }} · {{ .Site.Title }}
3{{ end }}
4{{ define "content" }}
5 {{ partial "page.html" . }}
6 {{ partial "posts/math.html" . }}
7{{ end }}
diff --git a/themes/hugo-coder/layouts/_default/terms.html b/themes/hugo-coder/layouts/_default/terms.html
new file mode 100644
index 0000000..9d35888
--- /dev/null
+++ b/themes/hugo-coder/layouts/_default/terms.html
@@ -0,0 +1,11 @@
1{{ define "title" }}
2 {{- if eq .Kind "term" -}}
3 {{- i18n .Data.Singular | title -}}
4 {{- print ": " -}}
5 {{- end -}}
6
7 {{- .Title }} · {{ .Site.Title -}}
8{{ end }}
9{{ define "content" }}
10 {{ partial "terms.html" . }}
11{{ end }}
diff --git a/themes/hugo-coder/layouts/index.html b/themes/hugo-coder/layouts/index.html
new file mode 100644
index 0000000..b829b61
--- /dev/null
+++ b/themes/hugo-coder/layouts/index.html
@@ -0,0 +1,3 @@
1{{ define "content" }}
2 {{ partial "home.html" . }}
3{{ end }}
diff --git a/themes/hugo-coder/layouts/partials/404.html b/themes/hugo-coder/layouts/partials/404.html
new file mode 100644
index 0000000..a884c68
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/404.html
@@ -0,0 +1,7 @@
1<section class="container centered">
2 <div class="error">
3 <h1>404</h1>
4 <h2>{{ i18n "page_not_found" }}</h2>
5 <p>{{ i18n "page_does_not_exist" }}<br />{{ i18n "head_back" .Site.BaseURL | safeHTML }}</p>
6 </div>
7</section>
diff --git a/themes/hugo-coder/layouts/partials/analytics/cloudflare.html b/themes/hugo-coder/layouts/partials/analytics/cloudflare.html
new file mode 100644
index 0000000..d8a732f
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/analytics/cloudflare.html
@@ -0,0 +1,4 @@
1<!-- Cloudflare Web Analytics -->
2<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
3 data-cf-beacon='{"token": "{{ $.Site.Params.cloudflare.token }}"}'></script>
4<!-- End Cloudflare Web Analytics -->
diff --git a/themes/hugo-coder/layouts/partials/analytics/fathom.html b/themes/hugo-coder/layouts/partials/analytics/fathom.html
new file mode 100644
index 0000000..13e7cfc
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/analytics/fathom.html
@@ -0,0 +1,13 @@
1<script>
2(function(f, a, t, h, o, m){
3 a[h]=a[h]||function(){
4 (a[h].q=a[h].q||[]).push(arguments)
5 };
6 o=f.createElement('script'),
7 m=f.getElementsByTagName('script')[0];
8 o.async=1; o.src=t; o.id='fathom-script';
9 m.parentNode.insertBefore(o,m)
10})(document, window, '//{{ .Site.Params.fathomAnalytics.serverURL | default "cdn.usefathom.com" }}/tracker.js', 'fathom');
11fathom('set', 'siteId', '{{ .Site.Params.fathomAnalytics.siteID }}');
12fathom('trackPageview');
13</script>
diff --git a/themes/hugo-coder/layouts/partials/analytics/goatcounter.html b/themes/hugo-coder/layouts/partials/analytics/goatcounter.html
new file mode 100644
index 0000000..5ba3063
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/analytics/goatcounter.html
@@ -0,0 +1,2 @@
1<script data-goatcounter="https://{{ $.Site.Params.goatCounter.code }}.goatcounter.com/count"
2 async src="//gc.zgo.at/count.js"></script>
diff --git a/themes/hugo-coder/layouts/partials/analytics/googletagmanager.html b/themes/hugo-coder/layouts/partials/analytics/googletagmanager.html
new file mode 100644
index 0000000..2d2581d
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/analytics/googletagmanager.html
@@ -0,0 +1,9 @@
1<!-- Global site tag (gtag.js) - Google Analytics -->
2<script async src="https://www.googletagmanager.com/gtag/js?id={{ $.Site.Params.googleTagManager.id }}"></script>
3<script>
4 window.dataLayer = window.dataLayer || [];
5 function gtag(){dataLayer.push(arguments);}
6 gtag('js', new Date());
7
8 gtag('config', '{{ $.Site.Params.googleTagManager.id }}');
9</script>
diff --git a/themes/hugo-coder/layouts/partials/analytics/matomo.html b/themes/hugo-coder/layouts/partials/analytics/matomo.html
new file mode 100644
index 0000000..8fabb63
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/analytics/matomo.html
@@ -0,0 +1,13 @@
1<script type="application/javascript">
2 var _paq = window._paq = window._paq || [];
3 /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
4 _paq.push(['trackPageView']);
5 _paq.push(['enableLinkTracking']);
6 (function() {
7 var u="https://{{ $.Site.Params.matomo.serverURL }}/";
8 _paq.push(['setTrackerUrl', u+'matomo.php']);
9 _paq.push(['setSiteId', '{{ $.Site.Params.matomo.siteID | default "1" }}']);
10 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
11 g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
12 })();
13</script>
diff --git a/themes/hugo-coder/layouts/partials/analytics/plausible.html b/themes/hugo-coder/layouts/partials/analytics/plausible.html
new file mode 100644
index 0000000..8999972
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/analytics/plausible.html
@@ -0,0 +1 @@
<script async defer data-domain="{{ .Site.Params.plausibleAnalytics.domain }}" src="https://{{ .Site.Params.plausibleAnalytics.serverURL | default "plausible.io" }}/js/plausible.js"></script>
diff --git a/themes/hugo-coder/layouts/partials/csp.html b/themes/hugo-coder/layouts/partials/csp.html
new file mode 100644
index 0000000..e9238a4
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/csp.html
@@ -0,0 +1 @@
{{ printf `<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests; block-all-mixed-content; default-src 'self'; child-src %s; font-src %s; form-action %s; frame-src %s; img-src %s; object-src %s; style-src %s; script-src %s; prefetch-src %s; connect-src %s;">` (delimit .Site.Params.csp.childsrc " ") (delimit .Site.Params.csp.fontsrc " ") (delimit .Site.Params.csp.formaction " ") (delimit .Site.Params.csp.framesrc " ") (delimit .Site.Params.csp.imgsrc " ") (delimit .Site.Params.csp.objectsrc " ") (delimit .Site.Params.csp.stylesrc " ") (delimit .Site.Params.csp.scriptsrc " ") (delimit .Site.Params.csp.prefetchsrc " ") (delimit .Site.Params.csp.connectsrc " ") | safeHTML }}
diff --git a/themes/hugo-coder/layouts/partials/float.html b/themes/hugo-coder/layouts/partials/float.html
new file mode 100644
index 0000000..623047d
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/float.html
@@ -0,0 +1,7 @@
1{{ if not .Site.Params.hideColorSchemeToggle }}
2<div class="float-container">
3 <a id="dark-mode-toggle" class="colorscheme-toggle">
4 <i class="fa fa-adjust fa-fw" aria-hidden="true"></i>
5 </a>
6</div>
7{{ end }}
diff --git a/themes/hugo-coder/layouts/partials/footer.html b/themes/hugo-coder/layouts/partials/footer.html
new file mode 100644
index 0000000..c184381
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/footer.html
@@ -0,0 +1,26 @@
1{{ if not .Site.Params.hideFooter | default false }}
2 <footer class="footer">
3 <section class="container">
4 {{ with .Site.Params.footerContent | safeHTML }}
5 <p>{{ . }}</p>
6 {{ end }}
7 {{ if not .Site.Params.hideCopyright }}
8 ©
9 {{ if (and (.Site.Params.since) (lt .Site.Params.since now.Year)) }}
10 {{ .Site.Params.since }} -
11 {{ end }}
12 {{ now.Year }}
13 {{ with .Site.Params.author }} {{ . }} {{ end }}
14 {{ end }}
15 {{ if not .Site.Params.hideCredits }}
16 {{ if not .Site.Params.hideCopyright }} · {{ end }}
17 {{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
18 {{ end }}
19 {{ if .Site.Params.commit }}
20 {{ if .GitInfo }}
21 [<a href="{{ .Site.Params.commit }}/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>]
22 {{ end }}
23 {{ end }}
24 </section>
25 </footer>
26{{ end }}
diff --git a/themes/hugo-coder/layouts/partials/header.html b/themes/hugo-coder/layouts/partials/header.html
new file mode 100644
index 0000000..4b7924e
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/header.html
@@ -0,0 +1,39 @@
1<nav class="navigation">
2 <section class="container">
3 <a class="navigation-title" href="{{ .Site.BaseURL | relLangURL }}">
4 {{ .Site.Title }}
5 </a>
6 {{ if or .Site.Menus.main .Site.IsMultiLingual }}
7 <input type="checkbox" id="menu-toggle" />
8 <label class="menu-button float-right" for="menu-toggle">
9 <i class="fa fa-bars fa-fw" aria-hidden="true"></i>
10 </label>
11 <ul class="navigation-list">
12 {{ with .Site.Menus.main}}
13 {{ range sort . }}
14 <li class="navigation-item">
15 <a class="navigation-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
16 </li>
17 {{ end }}
18 {{ end }}
19 {{ if .Site.IsMultiLingual }}
20 {{ $node := . }}
21 {{ .Scratch.Set "separator" true }}
22 {{ range (default .Site.Home.AllTranslations .Translations) }}
23 {{ if ne $.Site.Language .Language }}
24 {{ if $node.Scratch.Get "separator" }}
25 <li class="navigation-item menu-separator">
26 <span>|</span>
27 </li>
28 {{ $node.Scratch.Set "separator" false }}
29 {{ end }}
30 <li class="navigation-item">
31 <a href="{{ .Permalink }}">{{ .Language.LanguageName | emojify }}</a>
32 </li>
33 {{ end }}
34 {{ end }}
35 {{ end }}
36 </ul>
37 {{ end }}
38 </section>
39</nav>
diff --git a/themes/hugo-coder/layouts/partials/home.html b/themes/hugo-coder/layouts/partials/home.html
new file mode 100644
index 0000000..ff640dd
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/home.html
@@ -0,0 +1,35 @@
1<section class="container centered">
2 <div class="about">
3 {{ if and (isset .Site.Params "avatarurl") (not (isset .Site.Params "gravatar")) }}
4 {{ with .Site.Params.avatarURL }}
5 <div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
6 {{ end }}
7 {{ end }}
8 {{ with .Site.Params.gravatar }}
9 <div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" alt="gravatar"></div>
10 {{ end }}
11 <h1>{{ .Site.Params.author }}</h1>
12 {{ if reflect.IsSlice .Site.Params.info }}
13 <h2>{{ range .Site.Params.info }}{{.}}<br>{{ end}}</h2>
14 {{ else }}
15 <h2>{{ .Site.Params.info }}</h2>
16 {{ end }}
17 {{ with .Site.Params.social }}
18 <ul>
19 {{ range sort . "weight" }}
20 {{ if .icon }}
21 <li>
22 <a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }} {{ if .type }}type="{{ .type }}"{{ end }}>
23 <i class="{{ .icon }}" aria-hidden="true"></i>
24 </a>
25 </li>
26 {{ else }}
27 <li>
28 <a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }}>{{ .name }}</a>
29 </li>
30 {{ end }}
31 {{ end }}
32 </ul>
33 {{ end }}
34 </div>
35</section>
diff --git a/themes/hugo-coder/layouts/partials/list.html b/themes/hugo-coder/layouts/partials/list.html
new file mode 100644
index 0000000..243e1af
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/list.html
@@ -0,0 +1,22 @@
1<section class="container list">
2 <h1 class="title">
3 <a class="title-link" href="{{ .Permalink | safeURL }}">
4 {{- if eq .Kind "term" -}}
5 {{- i18n .Data.Singular | title -}}
6 {{- print ": " -}}
7 {{- end -}}
8
9 {{- i18n (lower .Title) | default .Title | title -}}
10 </a>
11 </h1>
12 {{ .Content }}
13 <ul>
14 {{ range .Paginator.Pages }}
15 <li>
16 <span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
17 <a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
18 </li>
19 {{ end }}
20 </ul>
21 {{ partial "pagination.html" . }}
22</section>
diff --git a/themes/hugo-coder/layouts/partials/page.html b/themes/hugo-coder/layouts/partials/page.html
new file mode 100644
index 0000000..656f2f1
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/page.html
@@ -0,0 +1,13 @@
1<section class="container page">
2 <article>
3 <header>
4 <h1 class="title">
5 <a class="title-link" href="{{ .Permalink | safeURL }}">
6 {{ .Title }}
7 </a>
8 </h1>
9 </header>
10
11 {{ .Content }}
12 </article>
13</section>
diff --git a/themes/hugo-coder/layouts/partials/pagination.html b/themes/hugo-coder/layouts/partials/pagination.html
new file mode 100644
index 0000000..1e004b8
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/pagination.html
@@ -0,0 +1,48 @@
1{{ $paginator := .Paginator }}
2{{ $adjacent_links := 2 }}
3{{ $max_links := (add (mul $adjacent_links 2) 1) }}
4{{ $lower_limit := (add $adjacent_links 1) }}
5{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
6{{ if gt $paginator.TotalPages 1 }}
7<ul class="pagination">
8 {{ if $paginator.HasPrev }}
9 {{ if ne $paginator.PageNumber 1 }}
10 <li><a href="{{ $paginator.First.URL }}">&laquo;</a></li>
11 {{ end }}
12 <li class="hidden"><a href="{{ $paginator.Prev.URL }}">&lsaquo;</a></li>
13 {{ end }}
14 {{ range $paginator.Pagers }}
15 {{ $.Scratch.Set "page_number_flag" false }}
16 {{ if gt $paginator.TotalPages $max_links }}
17 {{ if le $paginator.PageNumber $lower_limit }}
18 {{ if le .PageNumber $max_links }}
19 {{ $.Scratch.Set "page_number_flag" true }}
20 {{ end }}
21 {{ else if ge $paginator.PageNumber $upper_limit }}
22 {{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
23 {{ $.Scratch.Set "page_number_flag" true }}
24 {{ end }}
25 {{ else }}
26 {{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
27 {{ $.Scratch.Set "page_number_flag" true }}
28 {{ end }}
29 {{ end }}
30 {{ else }}
31 {{ $.Scratch.Set "page_number_flag" true }}
32 {{ end }}
33 {{ if eq ($.Scratch.Get "page_number_flag") true }}
34 {{ if eq . $paginator }}
35 <li>{{ .PageNumber }}</li>
36 {{ else }}
37 <li><a href="{{ .URL }}">{{ .PageNumber }}</a></li>
38 {{ end }}
39 {{ end }}
40 {{ end }}
41 {{ if $paginator.HasNext }}
42 <li class="hidden"><a href="{{ $paginator.Next.URL }}">&rsaquo;</a></li>
43 {{ if ne $paginator.PageNumber $paginator.TotalPages }}
44 <li><a href="{{ $paginator.Last.URL }}">&raquo;</a></li>
45 {{ end }}
46 {{ end }}
47</ul>
48{{ end }}
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 -}}
diff --git a/themes/hugo-coder/layouts/partials/taxonomy/authors.html b/themes/hugo-coder/layouts/partials/taxonomy/authors.html
new file mode 100644
index 0000000..366d8d8
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/taxonomy/authors.html
@@ -0,0 +1,9 @@
1<div class="authors">
2 <i class="fa fa-user" aria-hidden="true"></i>
3 {{- range $index, $el := . -}}
4 {{- if gt $index 0 }}
5 <span class="separator">•</span>
6 {{- end }}
7 <a href="{{ ( printf "authors/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
8 {{- end -}}
9 </div> \ No newline at end of file
diff --git a/themes/hugo-coder/layouts/partials/taxonomy/categories.html b/themes/hugo-coder/layouts/partials/taxonomy/categories.html
new file mode 100644
index 0000000..b592f4e
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/taxonomy/categories.html
@@ -0,0 +1,9 @@
1<div class="categories">
2 <i class="fa fa-folder" aria-hidden="true"></i>
3 {{- range $index, $el := . -}}
4 {{- if gt $index 0 }}
5 <span class="separator">•</span>
6 {{- end }}
7 <a href="{{ ( printf "categories/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
8 {{- end -}}
9</div>
diff --git a/themes/hugo-coder/layouts/partials/taxonomy/tags.html b/themes/hugo-coder/layouts/partials/taxonomy/tags.html
new file mode 100644
index 0000000..1be1ec0
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/taxonomy/tags.html
@@ -0,0 +1,11 @@
1<div class="tags">
2 <i class="fa fa-tag" aria-hidden="true"></i>
3 {{- range $index, $el := . -}}
4 {{- if gt $index 0 }}
5 <span class="separator">•</span>
6 {{- end }}
7 <span class="tag">
8 <a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
9 </span>
10 {{- end -}}
11</div>
diff --git a/themes/hugo-coder/layouts/partials/terms.html b/themes/hugo-coder/layouts/partials/terms.html
new file mode 100644
index 0000000..7d51e57
--- /dev/null
+++ b/themes/hugo-coder/layouts/partials/terms.html
@@ -0,0 +1,28 @@
1<section class="container taxonomy">
2 <h1 class="title">
3 <a class="title-link" href="{{ .Permalink | safeURL }}">
4 {{- if eq .Kind "term" -}}
5 {{- i18n .Data.Singular | title -}}
6 {{- print ": " -}}
7 {{- end -}}
8
9 {{- i18n (lower .Title) | default .Title | title -}}
10 </a>
11 </h1>
12 {{ .Content }}
13 <ul>
14 {{ $type := .Type }}
15 {{ range $key, $value := .Data.Terms.Alphabetical }}
16 {{ $name := .Name }}
17 {{ $count := .Count }}
18 {{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
19 <li>
20 <span class="taxonomy-element">
21 <a href="{{ .Permalink }}">{{ .Name }}</a>
22 <sup>{{ $count }}</sup>
23 </span>
24 </li>
25 {{ end }}
26 {{ end }}
27 </ul>
28</section>
diff --git a/themes/hugo-coder/layouts/posts/li.html b/themes/hugo-coder/layouts/posts/li.html
new file mode 100644
index 0000000..dd58396
--- /dev/null
+++ b/themes/hugo-coder/layouts/posts/li.html
@@ -0,0 +1,4 @@
1<li>
2 <span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
3 <a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
4</li>
diff --git a/themes/hugo-coder/layouts/posts/list.html b/themes/hugo-coder/layouts/posts/list.html
new file mode 100644
index 0000000..8ed6850
--- /dev/null
+++ b/themes/hugo-coder/layouts/posts/list.html
@@ -0,0 +1,21 @@
1{{ define "title" }}
2 {{ title (i18n (lower .Title)) | default .Title }} · {{ .Site.Title }}
3{{ end }}
4{{ define "content" }}
5 <section class="container list">
6 <h1 class="title">
7 <a class="title-link" href="{{ .Permalink | safeURL }}">
8 {{ title (i18n (lower .Title)) | default .Title }}
9 </a>
10 </h1>
11 {{ .Content }}
12 <ul>
13 e
14 {{- range .Paginator.Pages -}}
15 {{- .Render "li" -}}
16 {{- end -}}
17 </ul>
18
19 {{ partial "pagination.html" . }}
20 </section>
21{{ end }}
diff --git a/themes/hugo-coder/layouts/posts/single.html b/themes/hugo-coder/layouts/posts/single.html
new file mode 100644
index 0000000..61f11f7
--- /dev/null
+++ b/themes/hugo-coder/layouts/posts/single.html
@@ -0,0 +1,52 @@
1{{ define "title" }}
2 {{ .Title }} · {{ .Site.Title }}
3{{ end }}
4{{ define "content" }}
5 <section class="container post">
6 <article>
7 <header>
8 <div class="post-title">
9 <h1 class="title">
10 <a class="title-link" href="{{ .Permalink | safeURL }}">
11 {{ .Title }}
12 </a>
13 </h1>
14 </div>
15 <div class="post-meta">
16 <div class="date">
17 <span class="posted-on">
18 <i class="fa fa-calendar" aria-hidden="true"></i>
19 <time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
20 {{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
21 </time>
22 </span>
23 <span class="reading-time">
24 <i class="fa fa-clock-o" aria-hidden="true"></i>
25 {{ i18n "reading_time" .ReadingTime }}
26 </span>
27 </div>
28 {{ with .Page.Params.Authors }}{{ partial "taxonomy/authors.html" . }}{{ end }}
29 {{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
30 {{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }}
31 </div>
32 </header>
33
34 <div>
35 {{ if .Params.featuredImage }}
36 <img src='{{ .Params.featuredImage }}' alt="Featured image"/>
37 {{ end }}
38 {{ .Content }}
39 </div>
40
41
42 <footer>
43 {{ partial "posts/series.html" . }}
44 {{ partial "posts/disqus.html" . }}
45 {{ partial "posts/commento.html" . }}
46 {{ partial "posts/utterances.html" . }}
47 </footer>
48 </article>
49
50 {{ partial "posts/math.html" . }}
51 </section>
52{{ end }}
diff --git a/themes/hugo-coder/layouts/shortcodes/notice.html b/themes/hugo-coder/layouts/shortcodes/notice.html
new file mode 100644
index 0000000..96685d5
--- /dev/null
+++ b/themes/hugo-coder/layouts/shortcodes/notice.html
@@ -0,0 +1,12 @@
1{{- $type := .Get 0 -}}
2{{- $title := .Get 1 | default $type -}}
3{{- $inner := .Inner | .Page.RenderString | chomp -}}
4{{- $icon := dict "note" "fa-sticky-note" "tip" "fa-lightbulb-o" "example" "fa-file-text" "question" "fa-question" "info" "fa-exclamation-circle" "warning" "fa-exclamation-triangle" "error" "fa-times-circle" -}}
5<div class="notice {{ $type }}">
6 <div class="notice-title">
7 <i class="fa {{ index $icon $type }}" aria-hidden="true"></i>{{ i18n $title | default $title | humanize }}
8 </div>
9 <div class="notice-content">
10 {{- $inner -}}
11 </div>
12</div>