first commit
This commit is contained in:
3
themes/hugo-coder/layouts/404.html
Normal file
3
themes/hugo-coder/layouts/404.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ define "content" }}
|
||||
{{ partial "404.html" . }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,6 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||
{{ .Text | safeHTML }}
|
||||
<a class="heading-link" href="#{{ .Anchor | safeURL }}">
|
||||
<i class="fa fa-link" aria-hidden="true"></i>
|
||||
</a>
|
||||
</h{{ .Level }}>
|
||||
161
themes/hugo-coder/layouts/_default/baseof.html
Normal file
161
themes/hugo-coder/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,161 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Content-Language" content="{{ .Site.Language.Lang }}">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
|
||||
{{ if .Site.Params.csp }}
|
||||
{{ partial "csp.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
|
||||
<meta name="description" content="{{ .Description | default (.Summary | default .Site.Params.description ) }}">
|
||||
<meta name="keywords" content="{{ (delimit .Keywords ",") | default .Site.Params.keywords }}">
|
||||
|
||||
{{ template "_internal/twitter_cards.html" . }}
|
||||
{{ template "_internal/opengraph.html" . }}
|
||||
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{ if .Permalink }}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{ end }}
|
||||
|
||||
<link rel="preload" href="/fonts/forkawesome-webfont.woff2?v=1.2.0" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.rtl }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if or (eq .Site.Params.colorScheme "auto") (eq .Site.Params.colorScheme "dark") }}
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $cssOpts := (dict "targetPath" "css/coder-dark.css" ) }}
|
||||
{{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customCSS }}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $styles := resources.Get . }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $styles := resources.Get . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customSCSS }}
|
||||
{{/* We don't change the targetPath to because it's transparent to users */}}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $cssOpts := (dict "enableSourceMap" true ) }}
|
||||
{{ $styles := resources.Get . | toCSS $cssOpts }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
|
||||
{{ else }}
|
||||
{{ $styles := resources.Get . | toCSS | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | relURL }}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | relURL }}" sizes="16x16">
|
||||
|
||||
<link rel="apple-touch-icon" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{ hugo.Generator }}
|
||||
</head>
|
||||
|
||||
{{ $csClass := "colorscheme-light" }}
|
||||
{{ if eq .Site.Params.colorScheme "dark" }}
|
||||
{{ $csClass = "colorscheme-dark" }}
|
||||
{{ else if eq .Site.Params.colorScheme "auto" }}
|
||||
{{ $csClass = "colorscheme-auto" }}
|
||||
{{ end }}
|
||||
<body class="preload-transitions {{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}">
|
||||
{{ partial "float" . }}
|
||||
<main class="wrapper">
|
||||
{{ partial "header.html" . }}
|
||||
|
||||
<div class="content">
|
||||
{{ block "content" . }}{{ end }}
|
||||
</div>
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
</main>
|
||||
|
||||
{{ if .Site.IsServer }}
|
||||
{{ $script := resources.Get "js/coder.js" }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get "js/coder.js" | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ range .Site.Params.customJS }}
|
||||
{{ if $.Site.IsServer }}
|
||||
{{ $script := resources.Get . }}
|
||||
<script src="{{ $script.RelPermalink }}"></script>
|
||||
{{ else }}
|
||||
{{ $script := resources.Get . | minify | fingerprint }}
|
||||
<script src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
{{ if and .Site.Params.fathomAnalytics .Site.Params.fathomAnalytics.siteID }}
|
||||
{{- partial "analytics/fathom" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.plausibleAnalytics .Site.Params.plausibleAnalytics.domain }}
|
||||
{{- partial "analytics/plausible" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.goatCounter .Site.Params.goatCounter.code }}
|
||||
{{- partial "analytics/goatcounter" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.cloudflare .Site.Params.cloudflare.token }}
|
||||
{{- partial "analytics/cloudflare" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.matomo .Site.Params.matomo.serverURL }}
|
||||
{{- partial "analytics/matomo" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ if and .Site.Params.googleTagManager .Site.Params.googleTagManager.id }}
|
||||
{{- partial "analytics/googletagmanager" . -}}
|
||||
{{ end }}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
10
themes/hugo-coder/layouts/_default/list.html
Normal file
10
themes/hugo-coder/layouts/_default/list.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ define "title" }}
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Plural 1 | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
{{- i18n (lower .Title) | default .Title | title }} · {{ .Site.Title -}}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
{{ partial "list.html" . }}
|
||||
{{ end }}
|
||||
7
themes/hugo-coder/layouts/_default/single.html
Normal file
7
themes/hugo-coder/layouts/_default/single.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ define "title" }}
|
||||
{{ .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
{{ partial "page.html" . }}
|
||||
{{ partial "posts/math.html" . }}
|
||||
{{ end }}
|
||||
10
themes/hugo-coder/layouts/_default/terms.html
Normal file
10
themes/hugo-coder/layouts/_default/terms.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ define "title" }}
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Plural | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
{{- i18n (lower .Title) | default .Title | title }} · {{ .Site.Title -}}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
{{ partial "terms.html" . }}
|
||||
{{ end }}
|
||||
3
themes/hugo-coder/layouts/index.html
Normal file
3
themes/hugo-coder/layouts/index.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ define "content" }}
|
||||
{{ partial "home.html" . }}
|
||||
{{ end }}
|
||||
7
themes/hugo-coder/layouts/partials/404.html
Normal file
7
themes/hugo-coder/layouts/partials/404.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<section class="container centered">
|
||||
<div class="error">
|
||||
<h1>404</h1>
|
||||
<h2>{{ i18n "page_not_found" }}</h2>
|
||||
<p>{{ i18n "page_does_not_exist" }}<br />{{ i18n "head_back" .Site.BaseURL | safeHTML }}</p>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!-- Cloudflare Web Analytics -->
|
||||
<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
|
||||
data-cf-beacon='{"token": "{{ $.Site.Params.cloudflare.token }}"}'></script>
|
||||
<!-- End Cloudflare Web Analytics -->
|
||||
13
themes/hugo-coder/layouts/partials/analytics/fathom.html
Normal file
13
themes/hugo-coder/layouts/partials/analytics/fathom.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<script>
|
||||
(function(f, a, t, h, o, m){
|
||||
a[h]=a[h]||function(){
|
||||
(a[h].q=a[h].q||[]).push(arguments)
|
||||
};
|
||||
o=f.createElement('script'),
|
||||
m=f.getElementsByTagName('script')[0];
|
||||
o.async=1; o.src=t; o.id='fathom-script';
|
||||
m.parentNode.insertBefore(o,m)
|
||||
})(document, window, '//{{ .Site.Params.fathomAnalytics.serverURL | default "cdn.usefathom.com" }}/tracker.js', 'fathom');
|
||||
fathom('set', 'siteId', '{{ .Site.Params.fathomAnalytics.siteID }}');
|
||||
fathom('trackPageview');
|
||||
</script>
|
||||
@@ -0,0 +1,2 @@
|
||||
<script data-goatcounter="https://{{ $.Site.Params.goatCounter.code }}.goatcounter.com/count"
|
||||
async src="//gc.zgo.at/count.js"></script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $.Site.Params.googleTagManager.id }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ $.Site.Params.googleTagManager.id }}');
|
||||
</script>
|
||||
13
themes/hugo-coder/layouts/partials/analytics/matomo.html
Normal file
13
themes/hugo-coder/layouts/partials/analytics/matomo.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<script type="application/javascript">
|
||||
var _paq = window._paq = window._paq || [];
|
||||
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="https://{{ $.Site.Params.matomo.serverURL }}/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '{{ $.Site.Params.matomo.siteID | default "1" }}']);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
@@ -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>
|
||||
1
themes/hugo-coder/layouts/partials/csp.html
Normal file
1
themes/hugo-coder/layouts/partials/csp.html
Normal file
@@ -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 }}
|
||||
7
themes/hugo-coder/layouts/partials/float.html
Normal file
7
themes/hugo-coder/layouts/partials/float.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{{ if not .Site.Params.hideColorSchemeToggle }}
|
||||
<div class="float-container">
|
||||
<a id="dark-mode-toggle" class="colorscheme-toggle">
|
||||
<i class="fa fa-adjust fa-fw" aria-hidden="true"></i>
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
15
themes/hugo-coder/layouts/partials/footer.html
Normal file
15
themes/hugo-coder/layouts/partials/footer.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<footer class="footer">
|
||||
<section class="container">
|
||||
©
|
||||
{{ if (and .Site.Params.since (lt .Site.Params.since now.Year)) }}
|
||||
{{ .Site.Params.since }} -
|
||||
{{ end }}
|
||||
{{ now.Year }}
|
||||
{{ with .Site.Params.author }} {{ . }} {{ end }}
|
||||
·
|
||||
{{ i18n "powered_by" }} <a href="https://gohugo.io/">Hugo</a> & <a href="https://github.com/luizdepra/hugo-coder/">Coder</a>.
|
||||
{{ if (and .Site.Params.commit .GitInfo) }}
|
||||
[<a href="{{ .Site.Params.commit }}/{{ .GitInfo.Hash }}">{{ .GitInfo.AbbreviatedHash }}</a>]
|
||||
{{ end }}
|
||||
</section>
|
||||
</footer>
|
||||
39
themes/hugo-coder/layouts/partials/header.html
Normal file
39
themes/hugo-coder/layouts/partials/header.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<nav class="navigation">
|
||||
<section class="container">
|
||||
<a class="navigation-title" href="{{ .Site.BaseURL | relLangURL }}">
|
||||
{{ .Site.Title }}
|
||||
</a>
|
||||
{{ if or .Site.Menus.main .Site.IsMultiLingual }}
|
||||
<input type="checkbox" id="menu-toggle" />
|
||||
<label class="menu-button float-right" for="menu-toggle">
|
||||
<i class="fa fa-bars fa-fw" aria-hidden="true"></i>
|
||||
</label>
|
||||
<ul class="navigation-list">
|
||||
{{ with .Site.Menus.main}}
|
||||
{{ range sort . }}
|
||||
<li class="navigation-item">
|
||||
<a class="navigation-link" href="{{ index (apply (slice .URL) (.Params.urlFunc | default "relLangURL") ".") 0 }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Site.IsMultiLingual }}
|
||||
{{ $node := . }}
|
||||
{{ .Scratch.Set "separator" true }}
|
||||
{{ range (default .Site.Home.AllTranslations .Translations) }}
|
||||
{{ if ne $.Site.Language .Language }}
|
||||
{{ if $node.Scratch.Get "separator" }}
|
||||
<li class="navigation-item menu-separator">
|
||||
<span>|</span>
|
||||
</li>
|
||||
{{ $node.Scratch.Set "separator" false }}
|
||||
{{ end }}
|
||||
<li class="navigation-item">
|
||||
<a href="{{ .Permalink }}">{{ .Language.LanguageName | emojify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</section>
|
||||
</nav>
|
||||
35
themes/hugo-coder/layouts/partials/home.html
Normal file
35
themes/hugo-coder/layouts/partials/home.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<section class="container centered">
|
||||
<div class="about">
|
||||
{{ if and (isset .Site.Params "avatarurl") (not (isset .Site.Params "gravatar")) }}
|
||||
{{ with .Site.Params.avatarURL }}
|
||||
<div class="avatar"><img src="{{ . | relURL }}" alt="avatar"></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Site.Params.gravatar }}
|
||||
<div class="avatar"><img src="https://www.gravatar.com/avatar/{{md5 .}}?s=240&d=mp" alt="gravatar"></div>
|
||||
{{ end }}
|
||||
<h1>{{ .Site.Params.author }}</h1>
|
||||
{{ if reflect.IsSlice .Site.Params.info }}
|
||||
<h2>{{ range .Site.Params.info }}{{.}}<br>{{ end}}</h2>
|
||||
{{ else }}
|
||||
<h2>{{ .Site.Params.info }}</h2>
|
||||
{{ end }}
|
||||
{{ with .Site.Params.social }}
|
||||
<ul>
|
||||
{{ range sort . "weight" }}
|
||||
{{ if .icon }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }} {{ if .type }}type="{{ .type }}"{{ end }}>
|
||||
<i class="{{ .icon }}" aria-hidden="true"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .url | safeURL }}" aria-label="{{ .name }}" {{ if .rel }}rel="{{ .rel }}"{{ end }} {{ if .target }}target="{{ .target }}"{{ end }}>{{ .name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
21
themes/hugo-coder/layouts/partials/list.html
Normal file
21
themes/hugo-coder/layouts/partials/list.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<section class="container list">
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Plural 1 | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
{{- i18n (lower .Title) | default .Title | title -}}
|
||||
</a>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ range .Paginator.Pages }}
|
||||
<li>
|
||||
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
13
themes/hugo-coder/layouts/partials/page.html
Normal file
13
themes/hugo-coder/layouts/partials/page.html
Normal file
@@ -0,0 +1,13 @@
|
||||
<section class="container page">
|
||||
<article>
|
||||
<header>
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
{{ .Content }}
|
||||
</article>
|
||||
</section>
|
||||
48
themes/hugo-coder/layouts/partials/pagination.html
Normal file
48
themes/hugo-coder/layouts/partials/pagination.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{{ $paginator := .Paginator }}
|
||||
{{ $adjacent_links := 2 }}
|
||||
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
|
||||
{{ $lower_limit := (add $adjacent_links 1) }}
|
||||
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
|
||||
{{ if gt $paginator.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
{{ if $paginator.HasPrev }}
|
||||
{{ if ne $paginator.PageNumber 1 }}
|
||||
<li><a href="{{ $paginator.First.URL }}">«</a></li>
|
||||
{{ end }}
|
||||
<li class="hidden"><a href="{{ $paginator.Prev.URL }}">‹</a></li>
|
||||
{{ end }}
|
||||
{{ range $paginator.Pagers }}
|
||||
{{ $.Scratch.Set "page_number_flag" false }}
|
||||
{{ if gt $paginator.TotalPages $max_links }}
|
||||
{{ if le $paginator.PageNumber $lower_limit }}
|
||||
{{ if le .PageNumber $max_links }}
|
||||
{{ $.Scratch.Set "page_number_flag" true }}
|
||||
{{ end }}
|
||||
{{ else if ge $paginator.PageNumber $upper_limit }}
|
||||
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
|
||||
{{ $.Scratch.Set "page_number_flag" true }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
|
||||
{{ $.Scratch.Set "page_number_flag" true }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $.Scratch.Set "page_number_flag" true }}
|
||||
{{ end }}
|
||||
{{ if eq ($.Scratch.Get "page_number_flag") true }}
|
||||
{{ if eq . $paginator }}
|
||||
<li>{{ .PageNumber }}</li>
|
||||
{{ else }}
|
||||
<li><a href="{{ .URL }}">{{ .PageNumber }}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if $paginator.HasNext }}
|
||||
<li class="hidden"><a href="{{ $paginator.Next.URL }}">›</a></li>
|
||||
{{ if ne $paginator.PageNumber $paginator.TotalPages }}
|
||||
<li><a href="{{ $paginator.Last.URL }}">»</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
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 -}}
|
||||
29
themes/hugo-coder/layouts/partials/posts/series.html
Normal file
29
themes/hugo-coder/layouts/partials/posts/series.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{{ $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"></i>
|
||||
</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 }}
|
||||
12
themes/hugo-coder/layouts/partials/posts/utterances.html
Normal file
12
themes/hugo-coder/layouts/partials/posts/utterances.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- if isset .Site.Params "utterances" -}}
|
||||
{{- if and (isset .Site.Params.utterances "repo") (not (eq .Site.Params.utterances.repo "" )) (eq (.Params.disable_comments | default false) false) -}}
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo= "{{ .Site.Params.utterances.repo }}"
|
||||
issue-term="{{ default "title" .Site.Params.utterances.issueTerm }}"
|
||||
{{ if isset .Site.Params.utterances "label" }}label="{{ .Site.Params.utterances.label }}"{{ end }}
|
||||
theme="{{ default "github-light" .Site.Params.utterances.theme }}"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
</script>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
9
themes/hugo-coder/layouts/partials/taxonomy/authors.html
Normal file
9
themes/hugo-coder/layouts/partials/taxonomy/authors.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="authors">
|
||||
<i class="fa fa-user" aria-hidden="true"></i>
|
||||
{{- range $index, $el := . -}}
|
||||
{{- if gt $index 0 }}
|
||||
<span class="separator">•</span>
|
||||
{{- end }}
|
||||
<a href="{{ ( printf "authors/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<div class="categories">
|
||||
<i class="fa fa-folder" aria-hidden="true"></i>
|
||||
{{- range $index, $el := . -}}
|
||||
{{- if gt $index 0 }}
|
||||
<span class="separator">•</span>
|
||||
{{- end }}
|
||||
<a href="{{ ( printf "categories/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
11
themes/hugo-coder/layouts/partials/taxonomy/tags.html
Normal file
11
themes/hugo-coder/layouts/partials/taxonomy/tags.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<div class="tags">
|
||||
<i class="fa fa-tag" aria-hidden="true"></i>
|
||||
{{- range $index, $el := . -}}
|
||||
{{- if gt $index 0 }}
|
||||
<span class="separator">•</span>
|
||||
{{- end }}
|
||||
<span class="tag">
|
||||
<a href="{{ ( printf "tags/%s/" ( . | urlize ) ) | relLangURL }}">{{ . }}</a>
|
||||
</span>
|
||||
{{- end -}}
|
||||
</div>
|
||||
27
themes/hugo-coder/layouts/partials/terms.html
Normal file
27
themes/hugo-coder/layouts/partials/terms.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<section class="container taxonomy">
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{- if eq .Kind "term" -}}
|
||||
{{- i18n .Data.Plural | title -}}
|
||||
{{- print ": " -}}
|
||||
{{- end -}}
|
||||
{{- i18n (lower .Title) | default .Title | title -}}
|
||||
</a>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ $type := .Type }}
|
||||
{{ range $key, $value := .Data.Terms.Alphabetical }}
|
||||
{{ $name := .Name }}
|
||||
{{ $count := .Count }}
|
||||
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
|
||||
<li>
|
||||
<span class="taxonomy-element">
|
||||
<a href="{{ .Permalink }}">{{ .Name }}</a>
|
||||
<sup>{{ $count }}</sup>
|
||||
</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</section>
|
||||
4
themes/hugo-coder/layouts/posts/li.html
Normal file
4
themes/hugo-coder/layouts/posts/li.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<li>
|
||||
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
|
||||
<a class="title" href="{{ .Params.externalLink | default .RelPermalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
20
themes/hugo-coder/layouts/posts/list.html
Normal file
20
themes/hugo-coder/layouts/posts/list.html
Normal file
@@ -0,0 +1,20 @@
|
||||
{{ define "title" }}
|
||||
{{ title (i18n (lower .Title)) | default .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<section class="container list">
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{ title (i18n (lower .Title)) | default .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{- range .Paginator.Pages -}}
|
||||
{{- .Render "li" -}}
|
||||
{{- end -}}
|
||||
</ul>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
52
themes/hugo-coder/layouts/posts/single.html
Normal file
52
themes/hugo-coder/layouts/posts/single.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{{ define "title" }}
|
||||
{{ .Title }} · {{ .Site.Title }}
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<section class="container post">
|
||||
<article>
|
||||
<header>
|
||||
<div class="post-title">
|
||||
<h1 class="title">
|
||||
<a class="title-link" href="{{ .Permalink | safeURL }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="post-meta">
|
||||
<div class="date">
|
||||
<span class="posted-on">
|
||||
<i class="fa fa-calendar" aria-hidden="true"></i>
|
||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
||||
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}
|
||||
</time>
|
||||
</span>
|
||||
<span class="reading-time">
|
||||
<i class="fa fa-clock-o" aria-hidden="true"></i>
|
||||
{{ i18n "reading_time" .ReadingTime }}
|
||||
</span>
|
||||
</div>
|
||||
{{ with .Page.Params.Authors }}{{ partial "taxonomy/authors.html" . }}{{ end }}
|
||||
{{ with .Page.Params.Categories }}{{ partial "taxonomy/categories.html" . }}{{ end }}
|
||||
{{ with .Page.Params.Tags }}{{ partial "taxonomy/tags.html" . }}{{ end }}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div>
|
||||
{{ if .Params.featuredImage }}
|
||||
<img src='{{ .Params.featuredImage }}' alt="Featured image"/>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
|
||||
<footer>
|
||||
{{ partial "posts/series.html" . }}
|
||||
{{ partial "posts/disqus.html" . }}
|
||||
{{ partial "posts/commento.html" . }}
|
||||
{{ partial "posts/utterances.html" . }}
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
{{ partial "posts/math.html" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
12
themes/hugo-coder/layouts/shortcodes/notice.html
Normal file
12
themes/hugo-coder/layouts/shortcodes/notice.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{- $type := .Get 0 -}}
|
||||
{{- $title := .Get 1 | default $type -}}
|
||||
{{- $inner := .Inner | .Page.RenderString | chomp -}}
|
||||
{{- $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" -}}
|
||||
<div class="notice {{ $type }}">
|
||||
<div class="notice-title">
|
||||
<i class="fa {{ index $icon $type }}" aria-hidden="true"></i>{{ i18n $title | default $title | humanize }}
|
||||
</div>
|
||||
<div class="notice-content">
|
||||
{{- $inner -}}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user