Initial commit for Hugo site.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
{{ define "main" -}}
|
||||
<h1>404: Page not found</h1>
|
||||
<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ .Site.BaseURL }}">Head back home</a> to try finding it again.</p>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,2 @@
|
||||
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
{{- /* This comment removes trailing newlines. */ -}}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{ partial "head/head.html" . }}
|
||||
<body class="{{if .Site.Params.layoutReverse}}layout-reverse {{end}}{{if .Site.Params.dark_mode}}dark-theme{{end}}">
|
||||
<div class="wrapper">
|
||||
{{ partial "sidebar/sidebar.html" . }}
|
||||
<main class="content container">
|
||||
{{ block "main" . -}}{{- end }}
|
||||
</main>
|
||||
{{ block "sidebar" . }}{{ end }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
{{ define "main" -}}
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<ul class="entries">
|
||||
{{ range .Pages.GroupByDate "2006" }}
|
||||
<h3 style="text-align: center;">{{ .Key }}</h3>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<span class="title">
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
</span>
|
||||
<span class="published">
|
||||
<time class="pull-right post-list">{{ .Date | time.Format ":date_long" }}</time>
|
||||
</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{ define "main" -}}
|
||||
<div class="post">
|
||||
{{ partial "post/info.html" . }}
|
||||
{{ .Content }}
|
||||
{{ if (.Site.Params.listmonk) }}
|
||||
{{ partial "post/listmonk_email_newsletters.html" . }}
|
||||
{{ end }}
|
||||
{{ partial "post/navigation.html" . }}
|
||||
{{ if or (.Site.Params.remark42) (.Site.DisqusShortname) }}
|
||||
{{ partial "post/comments.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{ define "sidebar" }}
|
||||
{{ if and (not .Params.hideToc) (not .Site.Params.hideToc) }}
|
||||
{{ partial "table_of_contents.html" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{ define "main" -}}
|
||||
{{ if .Site.Params.light_dark }}
|
||||
{{ partial "light_dark.html" . }}
|
||||
{{ end }}
|
||||
<div class="post">
|
||||
{{ with .Site.GetPage "/about" }}
|
||||
{{ if .Pages }}
|
||||
{{ range .Pages }}
|
||||
<h1 class="post-title">{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<h1 class="post-title">{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if (.Site.Params.listmonk) }}
|
||||
{{ partial "post/listmonk_email_newsletters.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{{ define "main" -}}
|
||||
<div class="posts">
|
||||
{{ $frontPageTypes := default (slice "posts") .Site.Params.front_page_content }}
|
||||
{{ range (.Paginate (where .Site.RegularPages "Type" "in" $frontPageTypes)).Pages }}
|
||||
<article class="post">
|
||||
{{ partial "post/info.html" . }}
|
||||
{{ if or (.Site.Params.noSummary) (.Params.noSummary) }}
|
||||
{{ .Content }}
|
||||
{{ else }}
|
||||
{{ .Summary }}
|
||||
{{ if .Truncated }}
|
||||
<div class="read-more-link">
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</article>
|
||||
{{- end }}
|
||||
</div>
|
||||
{{ partial "pagination.html" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,41 @@
|
||||
<style>
|
||||
body {
|
||||
--sidebar-bg-color: {{ with .Site.Params.sidebar_bg_color }}{{ . }}{{ else }}#202020{{ end }};
|
||||
--sidebar-img-border-color: {{ with .Site.Params.sidebar_img_border_color }}{{ . }}{{ else }}#515151{{ end }};
|
||||
--sidebar-p-color: {{ with .Site.Params.sidebar_p_color }}{{ . }}{{ else }}#909090{{ end }};
|
||||
--sidebar-h1-color: {{ with .Site.Params.sidebar_h1_color }}{{ . }}{{ else }}#FFF{{ end }};
|
||||
--sidebar-a-color: {{ with .Site.Params.sidebar_a_color }}{{ . }}{{ else }}#FFF{{ end }};
|
||||
--sidebar-socials-color: {{ with .Site.Params.sidebar_socials_color }}{{ . }}{{ else }}#FFF{{ end }};
|
||||
--text-color: {{ with .Site.Params.text_color }}{{ . }}{{ else }}#222{{ end }};
|
||||
--bkg-color: {{ with .Site.Params.content_bg_color }}{{ . }}{{ else }}#FAF9F6{{ end }};
|
||||
--post-title-color: {{ with .Site.Params.post_title_color }}{{ . }}{{ else }}#303030{{ end }};
|
||||
--list-color: {{ with .Site.Params.list_color }}{{ . }}{{ else }}#5a5a5a{{ end }};
|
||||
--link-color: {{ with .Site.Params.link_color }}{{ . }}{{ else }}#268bd2{{ end }};
|
||||
--date-color: {{ with .Site.Params.date_color }}{{ . }}{{ else }}#515151{{ end }};
|
||||
--table-border-color: {{ with .Site.Params.table_border_color }}{{ . }}{{ else }}#E5E5E5{{ end }};
|
||||
--table-stripe-color: {{ with .Site.Params.table_stripe_color }}{{ . }}{{ else }}#F9F9F9{{ end }};
|
||||
--code-color: {{ with .Site.Params.code_color }}{{ . }}{{ else }}#000{{ end }};
|
||||
--code-background-color: {{ with .Site.Params.code_background_color }}{{ . }}{{ else }}#E5E5E5{{ end }};
|
||||
--code-block-color: {{ with .Site.Params.code_block_color }}{{ . }}{{ else }}#fff{{ end }};
|
||||
--code-block-background-color: {{ with .Site.Params.code_block_background_color }}{{ . }}{{ else }}#272822{{ end }};
|
||||
--moon-sun-color: {{ with .Site.Params.moon_sun_color }}{{ . }}{{ else }}#FFF{{ end }};
|
||||
--moon-sun-background-color: {{ with .Site.Params.moon_sun_background_color }}{{ . }}{{ else }}#515151{{ end }};
|
||||
}
|
||||
body.dark-theme {
|
||||
--text-color: {{ with .Site.Params.text_color_dark }}{{ . }}{{ else }}#eee{{ end }};
|
||||
--bkg-color: {{ with .Site.Params.content_bg_color_dark }}{{ . }}{{ else }}#121212{{ end }};
|
||||
--post-title-color: {{ with .Site.Params.post_title_color_dark }}{{ . }}{{ else }}#DBE2E9{{ end }};
|
||||
--list-color: {{ with .Site.Params.list_color_dark }}{{ . }}{{ else }}#9d9d9d{{ end }};
|
||||
--link-color: {{ with .Site.Params.link_color_dark }}{{ . }}{{ else }}#268bd2{{ end }};
|
||||
--date-color: {{ with .Site.Params.date_color_dark }}{{ . }}{{ else }}#9a9a9a{{ end }};
|
||||
--table-border-color: {{ with .Site.Params.table_border_color_dark }}{{ . }}{{ else }}#515151{{ end }};
|
||||
--table-stripe-color: {{ with .Site.Params.table_stripe_color_dark }}{{ . }}{{ else }}#202020{{ end }};
|
||||
--code-color: {{ with .Site.Params.code_color_dark }}{{ . }}{{ else }}#fff{{ end }};
|
||||
--code-background-color: {{ with .Site.Params.code_background_color_dark }}{{ . }}{{ else }}#515151{{ end }};
|
||||
--code-block-color: {{ with .Site.Params.code_block_color_dark }}{{ . }}{{ else }}#fff{{ end }};
|
||||
--code-block-background-color: {{ with .Site.Params.code_block_background_color_dark }}{{ . }}{{ else }}#272822{{ end }};
|
||||
}
|
||||
body {
|
||||
background-color: var(--bkg-color);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}>
|
||||
<head>
|
||||
{{ partial "head/scripts.html" . }}
|
||||
|
||||
<!-- Content Type -->
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- Enable responsiveness on mobile devices-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- favicon -->
|
||||
<link rel="icon" href={{ .Site.Params.favicon | default "/favicon.png" }}>
|
||||
|
||||
<!-- META -->
|
||||
{{ partial "head/meta.html" . }}
|
||||
|
||||
<!-- CSS stylesheets -->
|
||||
{{ partial "head/stylesheets.html" . }}
|
||||
|
||||
<!-- Custom style tag for parameterized CSS -->
|
||||
{{ partial "head/css.html" . }}
|
||||
</head>
|
||||
@@ -0,0 +1,127 @@
|
||||
{{ .Scratch.Set "title" .Site.Title }}
|
||||
|
||||
{{ .Scratch.Set "publisherIcon" .Site.Params.favicon }}
|
||||
{{ if .Site.Params.publisherIcon }}
|
||||
{{ .Scratch.Set "publisherIcon" .Site.Params.publisher_icon }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Kind "home" }}
|
||||
{{ .Scratch.Set "title" $.Site.Params.brand }}
|
||||
{{ .Scratch.Set "description" .Site.Params.Description }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "description" .Description }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsSection }}
|
||||
{{ .Scratch.Set "title" ($.Site.Params.brand) }}
|
||||
{{ .Scratch.Add "title" " - " }}
|
||||
{{ .Scratch.Add "title" .LinkTitle }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsPage }}
|
||||
{{ .Scratch.Set "title" ($.Site.Params.brand) }}
|
||||
{{ .Scratch.Add "title" " - " }}
|
||||
{{ .Scratch.Add "title" .LinkTitle }}
|
||||
{{ end }}
|
||||
|
||||
{{ "<!-- Open Graph image and Twitter Card metadata -->" | safeHTML }}
|
||||
{{ $image_path := .Params.image | default .Site.Params.og_image -}}
|
||||
{{ $image_path_local := printf "assets/%s" $image_path -}}
|
||||
{{ $image_ext := trim (path.Ext $image_path | lower) "." -}}
|
||||
{{ if fileExists $image_path_local -}}
|
||||
{{ $image_path:= resources.Get $image_path}}
|
||||
<meta property="og:image" content="{{ $image_path.RelPermalink }}" />
|
||||
{{/* If not SVG, read image aspect ratio and define Twitter Card and Open Graph width and height */ -}}
|
||||
{{ if ne $image_ext "svg" -}}
|
||||
{{ with (imageConfig $image_path_local) -}}
|
||||
{{ if (and (gt .Width 144) (gt .Height 144)) -}}
|
||||
<meta name="twitter:image" content="{{ $image_path.RelPermalink }}"/>
|
||||
<meta name="twitter:card" content="summary{{ if (and (gt .Width 300) (gt .Height 157) (not (eq .Width .Height))) }}_large_image{{ end }}">
|
||||
{{ end -}}
|
||||
<meta property="og:image:width" content="{{ .Width }}">
|
||||
<meta property="og:image:height" content="{{ .Height }}">
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
<meta property="og:image:type" content="image/{{ if eq $image_ext `svg` }}svg+xml{{ else }}{{ replaceRE `^jpg$` `jpeg` $image_ext }}{{ end }}">
|
||||
{{ end -}}
|
||||
|
||||
<!-- Title Tags -->
|
||||
<title itemprop="name">{{ .Scratch.Get "title" }}</title>
|
||||
<meta property="og:title" content={{ .Scratch.Get "title" }} />
|
||||
<meta name="twitter:title" content={{ .Scratch.Get "title" }} />
|
||||
<meta itemprop="name" content={{ .Scratch.Get "title" }} />
|
||||
<meta name="application-name" content={{ .Scratch.Get "title" }} />
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}" />
|
||||
|
||||
<!-- Description Tags -->
|
||||
<meta name="description" content="{{ .Scratch.Get "description" }}" />
|
||||
<meta itemprop="description" content="{{ .Scratch.Get "description" }}" />
|
||||
<meta property="og:description" content="{{ .Scratch.Get "description" }}" />
|
||||
<meta name="twitter:description" content="{{ .Scratch.Get "description" }}" />
|
||||
|
||||
<!-- Link Tags -->
|
||||
<base href="{{ .Permalink }}" />
|
||||
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
|
||||
<meta name="url" content="{{ .Permalink }}" />
|
||||
<meta name="twitter:url" content="{{ .Permalink }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
|
||||
<!-- Date Tags -->
|
||||
<meta property="og:updated_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}" />
|
||||
|
||||
<!-- Sitemap & Alternate Outputs -->
|
||||
<link rel="sitemap" type="application/xml" title="Sitemap" href='{{ "sitemap.xml" | absURL }}' />
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
{{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
<!-- Search Engine Crawler Tags -->
|
||||
<meta name="robots" content="index,follow" />
|
||||
<meta name="googlebot" content="index,follow" />
|
||||
|
||||
<!-- Social Media Tags -->
|
||||
<meta name="twitter:site" content="{{ .Site.Params.twitter_url }}" />
|
||||
<meta name="twitter:creator" content="{{ .Site.Params.twitter_url }}" />
|
||||
<meta property="fb:admins" content="{{ .Site.Params.fb.admins }}" />
|
||||
|
||||
<!-- Other Tags -->
|
||||
<meta name="apple-mobile-web-app-title" content="{{ .Site.Title }}" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
|
||||
<!-- Article Specific Tags -->
|
||||
<!-- To make sure this renders only in the article page, we check the section -->
|
||||
{{ if and (eq .Section "posts") (.Page.IsNode) }}
|
||||
<!-- Pagination meta tags for list pages only -->
|
||||
{{ $paginator := .Paginate (where .Pages "Type" "posts") }}
|
||||
{{ if $paginator }}
|
||||
<link rel="first" href="{{ $paginator.First.URL }}" />
|
||||
<link rel="last" href="{{ $paginator.Last.URL }}" />
|
||||
{{ if $paginator.HasPrev }}
|
||||
<link rel="prev" href="{{ $paginator.Prev.URL }}" />
|
||||
{{end }}
|
||||
{{ if $paginator.HasNext }}
|
||||
<link rel="next" href="{{ $paginator.Next.URL }}" />
|
||||
{{end }}
|
||||
{{end }}
|
||||
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="article:publisher" content="{{ .Site.Params.facebook_url }}" />
|
||||
<meta property="og:article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" />
|
||||
<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}" />
|
||||
|
||||
{{ with (or (.Params.Author) (.Site.Language.Params.Author.Name)) }}
|
||||
<meta property="og:article:author" content="{{ . }}" />
|
||||
<meta property="article:author" content="{{ . }}" />
|
||||
<meta name="author" content="{{ . }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ with.Params.category }}
|
||||
<meta name="news_keywords" content="{{ index . 0 }}" />
|
||||
<meta property="article:section" content="{{ index . 0 }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
<!-- Hugo Generator Attribution -->
|
||||
{{ hugo.Generator }}
|
||||
@@ -0,0 +1,33 @@
|
||||
{{/* Personal/custom script for light/dark mode and tabs */}}
|
||||
{{ $js := slice
|
||||
(resources.Get "js/light_dark.js")
|
||||
(resources.Get "js/tabs.js") }}
|
||||
|
||||
{{/* Locally hosted code for KaTeX */}}
|
||||
{{ $js = $js | append
|
||||
(resources.Get "js/lib/katex.js")
|
||||
(resources.Get "js/lib/auto-render.js") }}
|
||||
|
||||
{{/* Personal/custom scripts for KaTeX */}}
|
||||
{{ $js = $js | append (resources.Get "js/katex.js") }}
|
||||
|
||||
{{/* Personal/custom scripts for table of contents */}}
|
||||
{{ if not .Site.Params.hideToc }}
|
||||
{{ $js = $js | append (resources.Get "js/toc.js") }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Personal/custom scripts for codeblocks */}}
|
||||
{{ $js = $js | append (resources.Get "js/codeblock.js") }}
|
||||
|
||||
{{ $js_bundle := $js | resources.Concat "js/bundle.js" | minify | fingerprint }}
|
||||
|
||||
<script defer language="javascript" type="text/javascript" src="{{ $js_bundle.RelPermalink }}"></script>
|
||||
|
||||
|
||||
{{ if .Site.Params.plausible }}
|
||||
<script defer data-domain="{{ .Site.Params.plausible_domain }}" src="{{ .Site.Params.plausible_script }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ if hugo.IsProduction -}}
|
||||
{{ template "_internal/google_analytics.html" . -}}
|
||||
{{ end -}}
|
||||
@@ -0,0 +1,12 @@
|
||||
{{ $css_bundle := slice
|
||||
(resources.Get "css/poole.css")
|
||||
(resources.Get "css/codeblock.css")
|
||||
(resources.Get "css/hyde.css")
|
||||
(resources.Get "css/poison.css")
|
||||
(resources.Get "css/fonts.css")
|
||||
(resources.Get "css/lib/katex.css")
|
||||
(resources.Get "css/tabs.css")
|
||||
(resources.Get "css/custom.css")
|
||||
| resources.Concat "css/bundle.css" | minify | fingerprint }}
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="{{ $css_bundle.RelPermalink }}">
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="light-dark" align="right">
|
||||
<button class="btn-light-dark" title="Toggle light/dark mode">
|
||||
<svg class="moon" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16">
|
||||
<path fill="currentColor" d="M6 .278a.768.768 0 0 1 .08.858a7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277c.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316a.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71C0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
|
||||
</svg>
|
||||
<svg class="sun" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16">
|
||||
<path fill="currentColor" d="M8 12a4 4 0 1 0 0-8a4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
{{ $pag := .Paginate (where .Pages "Type" "posts") }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<hr>
|
||||
<div class="footer">
|
||||
<nav id="page-nav">
|
||||
|
||||
{{ if $pag.HasPrev }}
|
||||
<a href="{{ $pag.Prev.URL }}" rel="prev" class="extend prev">« Previous{{ T "Prev" }}</a>
|
||||
{{ end }}
|
||||
{{ range $pag.Pagers }}
|
||||
{{ if eq . $pag }}
|
||||
<span class="page-number current">{{ $pag.PageNumber }}</span>
|
||||
{{ else }}
|
||||
<a href="{{ .URL }}">{{ .PageNumber }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $pag.HasNext }}
|
||||
<a href="{{ $pag.Next.URL }}" rel="next" class="extend next">{{ T "Next" }} Next »</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,20 @@
|
||||
<div class="comments">
|
||||
{{ if .Site.Params.remark42 }}
|
||||
<div id="remark42"></div>
|
||||
<script>
|
||||
themeFromLS = localStorage.getItem("theme")
|
||||
themeFromHugo = document.body.classList.contains("dark-theme") ? "dark" : "light"
|
||||
currentTheme = themeFromLS ? themeFromLS : themeFromHugo;
|
||||
|
||||
var remark_config = {
|
||||
host: {{ site.Params.remark42_host }},
|
||||
site_id: {{ site.Params.remark42_site_id }},
|
||||
theme: currentTheme,
|
||||
max_shown_comments: 100,
|
||||
}
|
||||
</script>
|
||||
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
|
||||
{{ else if .Site.DisqusShortname }}
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="info">
|
||||
<h1 class="post-title">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</h1>
|
||||
|
||||
<div class="headline">
|
||||
<div>
|
||||
{{ if .Date }}
|
||||
<time datetime="{{ .Date.Format " 2006-01-02T15:04:05Z0700" }}" class="post-date">
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</time>
|
||||
{{ end }}
|
||||
<span> - </span>
|
||||
<span class="reading-time">
|
||||
{{ if gt .ReadingTime 1 }}
|
||||
{{ .Scratch.Set "readingTime" "mins" }}
|
||||
{{ else }}
|
||||
{{ .Scratch.Set "readingTime" "min" }}
|
||||
{{ end }}
|
||||
|
||||
<span>{{ .ReadingTime }} {{ .Scratch.Get "readingTime" }} read</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{{ if .Params.tags }}
|
||||
<ul class="tags">
|
||||
{{ range .Params.tags }}
|
||||
<li class="tag-{{ . }}">
|
||||
<a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{ . }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ $Site := .Site }}
|
||||
{{ if .Params.series }}
|
||||
<p class="seriesname">
|
||||
Series: <a href="{{ $Site.BaseURL }}series/{{ .Params.series | urlize }}">{{ .Params.series }}</a>
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.featuredImage }}
|
||||
<p>
|
||||
<img src="{{.Params.featuredImage}}"><br>
|
||||
</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,50 @@
|
||||
<hr>
|
||||
<div class="newsletters">
|
||||
<div class="help-block-for-success"></div>
|
||||
<div class="help-block-for-error"></div>
|
||||
<form id="email-subscription-form">
|
||||
<label for="email-subscription-input">{{ .Site.Params.listmonk_subscription_form_text | default "Subscribe to my newsletters" }}</label>
|
||||
<input type="email" id="email-subscription-input" name="email-subscription-input" placeholder="Email address" />
|
||||
<button type="submit">Subscribe</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
const listmonkHost = {{ .Site.Params.listmonk_host }};
|
||||
const listmonkSubscriptionSuccessMessage = {{ .Site.Params.listmonk_subscription_success_message | default "Thanks for subscribing" }};
|
||||
const listmonkSubscriptionErrorMessage = {{ .Site.Params.listmonk_subcription_error_message | default "Sorry, something went wrong. Please, try again" }};
|
||||
|
||||
const form = document.getElementById("email-subscription-form");
|
||||
form.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
const email = form.querySelector("#email-subscription-input").value;
|
||||
const data = {
|
||||
email: email,
|
||||
list_uuids: [
|
||||
{{ .Site.Params.listmonk_subscription_list_uiid }}
|
||||
]
|
||||
};
|
||||
fetch(`${listmonkHost}/api/public/subscription`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
}).then((response) => {
|
||||
if (response.status === 200) {
|
||||
const successBlock = document.getElementsByClassName('help-block-for-success')[0];
|
||||
successBlock.classList.add('help-block-show');
|
||||
successBlock.textContent = listmonkSubscriptionSuccessMessage;
|
||||
document.getElementById('email-subscription-form').classList.add('email-subscription-form-hide');
|
||||
} else {
|
||||
const errorBlock = document.getElementsByClassName('help-block-for-error')[0];
|
||||
errorBlock.classList.add('help-block-show');
|
||||
errorBlock.textContent = listmonkSubscriptionErrorMessage;
|
||||
}
|
||||
}).catch(() => {
|
||||
const errorBlock = document.getElementsByClassName('help-block-for-error')[0];
|
||||
errorBlock.classList.add('help-block-show');
|
||||
errorBlock.textContent = listmonkSubscriptionErrorMessage;
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<hr>
|
||||
<div class="footer">
|
||||
{{ if .Params.series }}
|
||||
{{ $Site := .Site }}
|
||||
{{ $postTitle := .Title }}
|
||||
<p>
|
||||
This is a post in the <b><a href="{{ $Site.BaseURL }}series/{{ .Params.series | urlize }}">{{ .Params.series }}</a></b> series.
|
||||
<br>Other posts in this series:
|
||||
<ul class="series">
|
||||
{{ $seriesUrl := print "series/" (.Params.series | urlize) }}
|
||||
{{ $series := .Site.GetPage $seriesUrl }}
|
||||
{{ range $series.Pages }}
|
||||
<li>
|
||||
{{ .Date | time.Format ":date_long" }} -
|
||||
{{ if ne .Title $postTitle }}
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
{{ else }}
|
||||
{{ .Title }}
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</p>
|
||||
{{ else }}
|
||||
{{ if .PrevInSection }}
|
||||
<a class="previous-post" href="{{ .PrevInSection.Permalink }}?ref=footer"><span style="font-weight:bold;">« Previous</span><br>{{ .PrevInSection.Title | truncate 50 "..."}}</a>
|
||||
{{ end }}
|
||||
{{ if .NextInSection }}
|
||||
<div class="next-post">
|
||||
<a href="{{ .NextInSection.Permalink }}?ref=footer"><span style="font-weight:bold;">Next »</span><br>{{ .NextInSection.Title | truncate 50 "..." }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<p class="footnote">
|
||||
powered by <a target="_blank" href="https://gohugo.io">Hugo</a> | themed with <a target="_blank" href="https://github.com/lukeorth/poison">poison</a>
|
||||
<br>
|
||||
© {{ now.Format "2006"}} {{ or .Site.Language.Params.Author.name .Site.Title }}. All rights reserved.
|
||||
</p>
|
||||
@@ -0,0 +1,61 @@
|
||||
<nav>
|
||||
<ul class="sidebar-nav">
|
||||
|
||||
{{ $sections := .Site.Sections.ByTitle }}
|
||||
{{ $taxonomies := .Site.Taxonomies }}
|
||||
{{ range .Site.Params.menu }}
|
||||
{{ $menu_item := . }}
|
||||
{{ if eq (len $menu_item.URL) 0 }}
|
||||
<li class="heading">{{ $menu_item.Name }}</li>
|
||||
{{ else if $menu_item.External }}
|
||||
<li class="bullet">
|
||||
<a href="{{ $menu_item.URL }}" target="_blank" rel="noopener noreferrer">{{ $menu_item.Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ range $sections }}
|
||||
{{ $trimmedURL := (lower (strings.TrimSuffix "/" (strings.TrimPrefix "/" $menu_item.URL))) }}
|
||||
{{ if eq (lower .Title) (replace $trimmedURL "-" " ") }}
|
||||
<li class="heading">
|
||||
<a href="{{ $menu_item.URL }}">{{ $menu_item.Name }}</a>
|
||||
</li>
|
||||
{{ if $menu_item.HasChildren }}
|
||||
<li class="sub-heading">
|
||||
{{ $menu_item.Pre }}
|
||||
</li>
|
||||
{{ range (first $menu_item.Limit .Pages) }}
|
||||
<li class="bullet">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range $name, $taxonomy := $taxonomies }}
|
||||
{{ if eq (lower $name) (lower $menu_item.Name) }}
|
||||
<li class="heading">
|
||||
<a href="{{$menu_item.URL }}">{{ $menu_item.Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ range $term, $page := $taxonomy }}
|
||||
{{ if eq (lower $term) (lower $menu_item.Name) }}
|
||||
<li class="heading">
|
||||
<a href="{{$menu_item.URL }}">{{ $menu_item.Name }}</a>
|
||||
</li>
|
||||
{{ if $menu_item.HasChildren }}
|
||||
<li class="sub-heading">
|
||||
{{ $menu_item.Pre }}
|
||||
</li>
|
||||
{{ range (first $menu_item.Limit .Pages) }}
|
||||
<li class="bullet">
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -0,0 +1,9 @@
|
||||
<aside class="sidebar">
|
||||
<div class="container sidebar-sticky">
|
||||
{{ partial "light_dark.html" . }}
|
||||
{{ partial "sidebar/title.html" . }}
|
||||
{{ partial "sidebar/menu.html" . }}
|
||||
{{ partial "sidebar/socials.html" . }}
|
||||
{{ partial "sidebar/copyright.html" . }}
|
||||
</div>
|
||||
</aside>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
|
||||
<div class="sidebar-about">
|
||||
<h1 class="brand">
|
||||
{{ if .Site.Params.remote_brand_image }}
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
<img src="{{ .Site.Params.remote_brand_image }}" alt="brand image">
|
||||
</a>
|
||||
{{ else if .Site.Params.brand_image }}
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
<img src="{{ .Site.Params.brand_image }}" alt="brand image">
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.brand }}
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
<h1>{{ .Site.Params.brand }}</h1>
|
||||
</a>
|
||||
{{ end }}
|
||||
</h1>
|
||||
<p class="lead">
|
||||
{{ with .Site.Params.description }}{{. | safeHTML}}{{end}}
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<div class="article-toc {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
|
||||
<div class="toc-wrapper">
|
||||
<h4 id="contents"></h4>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
{{ define "main" -}}
|
||||
{{ if .Site.Params.light_dark }}
|
||||
{{ partial "light_dark.html" . }}
|
||||
{{ end }}
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
<div class="posts">
|
||||
{{ range .Paginator.Pages }}
|
||||
<div class="project">
|
||||
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
|
||||
<p>
|
||||
{{ if .Params.featuredImage }}
|
||||
<img src="{{ .Params.featuredImage }}"><br>
|
||||
{{ end }}
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,18 @@
|
||||
<!-- To automatically render mermaid diagrams -->
|
||||
{{ if ne (.Page.Scratch.Get "hasMermaid") true }}
|
||||
<script type="module">
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
|
||||
|
||||
const lsTheme = localStorage.getItem("theme")
|
||||
const hugoTheme = document.body.classList.contains("dark-theme") ? "dark" : null
|
||||
const currTheme = lsTheme ? lsTheme : hugoTheme;
|
||||
const mermaidTheme = currTheme == "light" ? "default" : "dark"
|
||||
|
||||
mermaid.initialize({theme: mermaidTheme});
|
||||
</script>
|
||||
|
||||
{{ .Page.Scratch.Set "hasMermaid" true }}
|
||||
{{ end }}
|
||||
<div class="mermaid">
|
||||
{{- .Inner | safeHTML }}
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- Locally hosted code for PlantUML diagrams -->
|
||||
{{ if ne (.Page.Scratch.Get "hasPlantUML") true }}
|
||||
{{ $js_bundle :=
|
||||
slice
|
||||
(resources.Get "js/lib/plantuml-encoder.js")
|
||||
(resources.Get "js/plantuml-encoder.js")
|
||||
| resources.Concat "js/plantuml-bundle.js" | minify | fingerprint }}
|
||||
<script language="javascript" type="text/javascript" src="{{ $js_bundle.RelPermalink }}"></script>
|
||||
{{ .Page.Scratch.Set "hasPlantUML" true }}
|
||||
{{ end }}
|
||||
|
||||
<span id="plantuml-{{ .Get "id" }}" style="display:none">{{ .Inner | safeHTML | htmlUnescape }}</span>
|
||||
<img class="plantuml" id="plantuml-{{ .Get "id" }}">
|
||||
@@ -0,0 +1,6 @@
|
||||
{{ $tabName := .Get "tabName" }}
|
||||
{{ $tabContent := .Inner }}
|
||||
{{ $tabID := delimit (shuffle (slice "a" "b" "c" "d" "e" "f")) "" }}
|
||||
{{ .Parent.Scratch.Add "tabName" (slice $tabName) }}
|
||||
{{ .Parent.Scratch.Add "tabContent" (slice $tabContent) }}
|
||||
{{ .Parent.Scratch.Add "tabID" (slice $tabID) }}
|
||||
@@ -0,0 +1,37 @@
|
||||
{{ $tabTotal := .Get "tabTotal" }}
|
||||
{{ $tabName := .Scratch.Get "tabName" }}
|
||||
{{ $tabContent := .Scratch.Get "tabContent" }}
|
||||
{{ $tabID := .Scratch.Get "tabID" }}
|
||||
|
||||
<div class="tabs-container">
|
||||
<div class="tabs" role="tablist">
|
||||
|
||||
{{ range $i, $sequence := (seq $tabTotal) }}
|
||||
|
||||
{{ if eq $i 0 }}
|
||||
<button class="tab active" id="{{ (index $tabID $i) }}">
|
||||
{{ else }}
|
||||
<button class="tab" id="{{ (index $tabID $i) }}">
|
||||
{{ end }}
|
||||
|
||||
{{ index $tabName $i }}
|
||||
</button>
|
||||
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
|
||||
{{ range $i, $sequence := (seq $tabTotal) }}
|
||||
|
||||
{{ if eq $i 0 }}
|
||||
<div class="tabcontent {{ (index $tabID $i) }}" style="display:block;">
|
||||
{{ else }}
|
||||
<div class="tabcontent {{ (index $tabID $i) }}">
|
||||
{{ end }}
|
||||
|
||||
{{ (index $tabContent $i) }}
|
||||
{{ if $.Inner }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
Reference in New Issue
Block a user