first commit
All checks were successful
Deploying Website / build (push) Successful in 16s

This commit is contained in:
Maxime Delporte
2025-04-04 18:47:44 -03:00
commit 51ea013bc3
822 changed files with 18303 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
{{- define "main" -}}
{{- partialCached "util/background.html" "bg" -}}
<section class="page404">
<div class='error-banner'>
<svg xmlns="http://www.w3.org/2000/svg" width="312">
<g id="group-1-cube-1">
<path fill="#1D2125" d="M210.6 0l-20 11.2v22.4l20 11.2 20-11.2V11.2L210.6 0z" />
<path fill="#DADEDE" d="M210.6 5.3l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-2">
<path fill="#1D2125" d="M170.6 22.4l-20 11.2V56l20 11.2 20-11.2V33.6l-20-11.2z" />
<path fill="#DADEDE" d="M170.6 27.7l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-3">
<path fill="#1D2125" d="M230.6 11.2l-20 11.2v22.4l20 11.2 20-11.2V22.4l-20-11.2z" />
<path fill="#DADEDE" d="M230.6 16.5L215.3 25l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-4">
<path fill="#1D2125" d="M250.6 22.4l-20 11.2V56l20 11.2 20-11.2V33.6l-20-11.2z" />
<path fill="#DADEDE" d="M250.6 27.7l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-5">
<path fill="#1D2125" d="M190.6 33.6l-20 11.2v22.4l20 11.2 20-11.2V44.8l-20-11.2z" />
<path fill="#DADEDE" d="M190.6 38.9l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-6">
<path fill="#1D2125" d="M230.6 33.6l-20 11.2v22.4l20 11.2 20-11.2V44.8l-20-11.2z" />
<path fill="#DADEDE" d="M230.6 38.9l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-7">
<path fill="#1D2125" d="M210.6 44.8l-20 11.2v22.4l20 11.2 20-11.2V56l-20-11.2z" />
<path fill="#DADEDE" d="M210.6 50.1l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-8">
<path fill="#1D2125" d="M270.6 33.6l-20 11.2v22.4l20 11.2 20-11.2V44.8l-20-11.2z" />
<path fill="#DADEDE" d="M270.6 38.9l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-1-cube-9">
<path fill="#1D2125" d="M290.6 44.8l-20 11.2v22.4l20 11.2 20-11.2V56l-20-11.2z" />
<path fill="#DADEDE" d="M290.6 50.1l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-1">
<path fill="#1D2125" d="M135.3 42.2l-20 11.2v22.4l20 11.2 20-11.2V53.4l-20-11.2z" />
<path fill="#DADEDE" d="M135.3 47.5L120 56l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-2">
<path fill="#1D2125" d="M115.3 53.4l-20 11.2V87l20 11.2 20-11.2V64.6l-20-11.2z" />
<path fill="#DADEDE" d="M115.3 58.7L100 67.2l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-3">
<path fill="#1D2125" d="M95.3 64.6l-20 11.2v22.4l20 11.2 20-11.2V75.8l-20-11.2z" />
<path fill="#DADEDE" d="M95.3 69.9L80 78.4 95.3 87l15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-4">
<path fill="#1D2125" d="M155.3 53.4l-20 11.2V87l20 11.2 20-11.2V64.6l-20-11.2z" />
<path fill="#DADEDE" d="M155.3 58.7L140 67.2l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-5">
<path fill="#1D2125" d="M175.3 64.6l-20 11.2v22.4l20 11.2 20-11.2V75.8l-20-11.2z" />
<path fill="#DADEDE" d="M175.3 69.9L160 78.4l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-6">
<path fill="#1D2125" d="M115.3 75.8L95.3 87v22.4l20 11.2 20-11.2V87l-20-11.2z" />
<path fill="#DADEDE" d="M115.3 81.1L100 89.6l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-7">
<path fill="#1D2125" d="M135.3 87l-20 11.2v22.4l20 11.2 20-11.2V98.2l-20-11.2z" />
<path fill="#DADEDE" d="M135.3 92.3l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-8">
<path fill="#1D2125" d="M155.3 98.2l-20 11.2v22.4l20 11.2 20-11.2v-22.4l-20-11.2z" />
<path fill="#DADEDE" d="M155.3 103.5L140 112l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-9">
<path fill="#1D2125" d="M195.3 75.8l-20 11.2v22.4l20 11.2 20-11.2V87l-20-11.2z" />
<path fill="#DADEDE" d="M195.3 81.1L180 89.6l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-10">
<path fill="#1D2125" d="M215.3 87l-20 11.2v22.4l20 11.2 20-11.2V98.2l-20-11.2z" />
<path fill="#DADEDE" d="M215.3 92.3l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-11">
<path fill="#1D2125" d="M195.3 98.2l-20 11.2v22.4l20 11.2 20-11.2v-22.4l-20-11.2z" />
<path fill="#DADEDE" d="M195.3 103.5L180 112l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-2-cube-12">
<path fill="#1D2125" d="M175.3 109.4l-20 11.2V143l20 11.2 20-11.2v-22.4l-20-11.2z" />
<path fill="#DADEDE" d="M175.3 114.7l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-1">
<path fill="#1D2125" d="M60 84.4L40 95.6V118l20 11.2L80 118V95.6L60 84.4z" />
<path fill="#DADEDE" d="M60 89.7l-15.3 8.5 15.3 8.6 15.3-8.6L60 89.7" />
</g>
<g id="group-3-cube-2">
<path fill="#1D2125" d="M20 106.8L0 118v22.4l20 11.2 20-11.2V118l-20-11.2z" />
<path fill="#DADEDE" d="M20 112.1l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-3">
<path fill="#1D2125" d="M80 95.6l-20 11.2v22.4l20 11.2 20-11.2v-22.4L80 95.6z" />
<path fill="#DADEDE" d="M80 100.9l-15.3 8.5L80 118l15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-4">
<path fill="#1D2125" d="M100 106.8L80 118v22.4l20 11.2 20-11.2V118l-20-11.2z" />
<path fill="#DADEDE" d="M100 112.1l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-5">
<path fill="#1D2125" d="M40 118l-20 11.2v22.4l20 11.2 20-11.2v-22.4L40 118z" />
<path fill="#DADEDE" d="M40 123.3l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-6">
<path fill="#1D2125" d="M80 118l-20 11.2v22.4l20 11.2 20-11.2v-22.4L80 118z" />
<path fill="#DADEDE" d="M80 123.3l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-7">
<path fill="#1D2125" d="M60 129.2l-20 11.2v22.4L60 174l20-11.2v-22.4l-20-11.2z" />
<path fill="#DADEDE" d="M60 134.5L44.7 143l15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-8">
<path fill="#1D2125" d="M120 118l-20 11.2v22.4l20 11.2 20-11.2v-22.4L120 118z" />
<path fill="#DADEDE" d="M120 123.3l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
<g id="group-3-cube-9">
<path fill="#1D2125" d="M140 129.2l-20 11.2v22.4l20 11.2 20-11.2v-22.4l-20-11.2z" />
<path fill="#DADEDE" d="M140 134.5l-15.3 8.5 15.3 8.6 15.3-8.6-15.3-8.5" />
</g>
</svg>
</div>
<h1 class='title'>Not Found</h1>
<p>This page doesn't exist. There must be some mistake with the URL. Please <a href="/contact">contact me</a> if it is coming from a link. You can navigate <a href="/">home page</a>.</p>
<small>Image from <a href="https://codepen.io/imathis/pen/ZYMmLx" target="_blank" rel="nofollow" rel="noopener">Codepen.</a></small>
</section>
{{- end -}}

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html class="no-js {{ partial "class.html" . -}}" lang="en">
<head>
{{- partial "core/head.html" . -}}
{{- block "resources" . -}}
{{- partialCached "core/resources.html" . -}}
{{- end -}}
{{- block "head" . }}{{- end }}
</head>
<body>
{{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
{{- partialCached "footer.html" . -}}
{{- if .Site.Params.DebugMenu -}}
{{- partial "debug/debug.html" (dict "context" .) -}}
{{- end -}}
</body>
</html>

View File

@@ -0,0 +1,20 @@
{{- $.Scratch.Add "index" slice -}}
{{$icon := (resources.Get "image/favicon.svg" | resources.Minify).RelPermalink}}
{{- with .Site.Home -}}
{{- $.Scratch.Add "index" (dict "title" .Title "description" .Description "date" "2000-01-01T00:00:00Z" "tags" .Params.tags "category" (humanize (delimit (default "" .Params.categories) " ")) "image" $icon "series" .Params.series "contents" .Plain "meta" .Params.content "permalink" .Permalink "readingTime" .ReadingTime) -}}
{{- end -}}
{{- range .Site.RegularPages -}}
{{- $params := "100x100" -}}
{{- $cover := "" -}}
{{- if .Params.coverAnchor -}}
{{- $params = print $params " " .Params.coverAnchor -}}
{{- else -}}
{{- $params = print $params " Center" -}}
{{- end -}}
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
{{- $cover = ($featured.Fill $params).RelPermalink -}}
{{- $.Scratch.Add "index" (dict "title" .Title "description" .Description "date" (.Date.Format "2006-01-02T15:04:05-07:00") "tags" .Params.tags "category" (humanize (delimit (default "" .Params.categories) " ")) "series" .Params.series "contents" .Plain "meta" .Params.content "permalink" .Permalink "image" (default $icon $cover) "readingTime" .ReadingTime) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

View File

@@ -0,0 +1,25 @@
{{ define "main" }}
{{- partialCached "util/background.html" "bg" -}}
<article class="list">
<h1 class='title'>{{.Title}}</h1>
<span class='subtitle'>{{.Params.Subtitle}}</span>
{{with .Content}}<div class="content">{{ .}}</div> {{- end -}}
{{if and (not .Paginator.HasPrev) (gt (len .Sections) 0) }}
<h2 class='title'>Pages</h2>
{{end}}
<ul class="blog-posts items-{{.Paginator.PageSize}}">
{{ range .Paginator.Pages}}
{{- partialCached "util/post.html" . .RelPermalink -}}
{{ end }}
</ul>
{{ template "_internal/pagination.html" . }}
{{if and (not .Paginator.HasPrev) (gt (len .Sections) 0) }}
<h2 class='title'>Subsections</h2>
<ul class="blog-posts items-{{len .Sections}}">
{{range .Sections}}
{{- partialCached "util/post.html" . .RelPermalink -}}
{{end}}
</ul>
{{end}}
</article>
{{ end }}

View File

@@ -0,0 +1,3 @@
{{- define "main" -}}
{{- partial "meta.html" . -}}
{{- end -}}

View File

@@ -0,0 +1,121 @@
{{ define "main" }}
{{- with $.Page.Resources.GetMatch "cover.*" -}}
<div class="contact-cover">
<img width="1440" height="300" intrinsicsize="2880x600" alt="Contact Cover" role="presentation" src="{{(.Fill "2880x600 Top").RelPermalink}}" />
</div>
{{- end -}}
<article class="contact">
<h1 class='title'>{{.Title}}</h1>
{{ with .Params.subtitle }}
<span class='subtitle'>{{.}}</span>
{{ end }}
{{- .Content -}}
<section>
<aside>
<section>
<h2>Location</h2>
<ul>
{{- with $.Site.Author.email -}}
<li>
<a target="_blank" href="mailto:{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-envelope.svg" | resources.Minify }} {{ replace $icon.Content "<svg" "<svg width=\"30px\"" | safeHTML }}
{{$middle := replaceRE "^.*@" "" .}}
<span>{{replaceRE "@.*$" "" .}} [at] {{ replaceRE "\\..*" "" $middle }} [dot] {{ replaceRE "^.*\\." "" . }}</span>
</a>
</li>
{{- end -}}
{{- with $.Site.Author.phone -}}
<li>
{{ $icon := resources.Get "image/line-awesome/fa-phone.svg" | resources.Minify }} {{ replace $icon.Content "<svg" "<svg width=\"30px\"" | safeHTML }}
<span>{{.}}</span>
</li>
{{- end -}}
{{- with $.Site.Author.location -}}
<li>
<a target="_blank" href="https://www.google.com/maps/place/{{.}}" rel="noopener"> <!-- Google maps search here -->
{{ $icon := resources.Get "image/line-awesome/fa-compass.svg" | resources.Minify }} {{ replace $icon.Content "<svg" "<svg width=\"30px\"" | safeHTML }}
<span>{{.}}</span>
</a>
</li>
{{- end -}}
</ul>
</section>
{{- with $.Site.Author.hours -}}
<section>
<h2>Contact Hours</h2>
<ul>
<li>
<a target="_blank" href="https://www.timeanddate.com/time/zone/?query={{$.Site.Author.location}}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-clock-o.svg" | resources.Minify }} {{ replace $icon.Content "<svg" "<svg width=\"30px\"" | safeHTML }}
{{$middle := replaceRE "^.*@" "" .}}
<span>{{. | markdownify}}</span>
</a>
</li>
</ul>
</section>
{{- end -}}
<section>
<h2>Social Links</h2>
<ul class="social">
{{ with $.Site.Author.linkedin }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-linkedin.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.github }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-github.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.twitter }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-twitter.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.facebook }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-facebook.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }}
</ul>
</section>
</aside>
{{if $.Page.Params.response }}
<div class="contact-response">
{{- default "Thank you" $.Site.Params.contact.response -}}
</div>
{{else}}
<form id="contact-us-form" name="{{- default "contact" $.Site.Params.contact.name -}}" method="POST" {{with $.Site.Params.contact.action }} action="{{.}}" {{ end }} data-netlify="true" netlify-honeypot="email">
<label class="sr-only" for="contact-name">Name</label>
<input id="contact-name" class="contact-name" required type="name" autocomplete="given-name" placeholder="Name" name="name">
<label for="contact-email" class="sr-only">Email</label>
<input id="contact-email" class="contact-email" required type="email" autocomplete="email" placeholder="Email address" name="email-address">
<label for="email" class="sr-only">Don't fill</label>
<input id="email" tabindex="-1" class="email" type="text" autocomplete="email"
placeholder="Email address" name="email">
<label for="contact-subject" class="sr-only">Subject</label>
<input id="contact-subject" class="contact-subject" name="subject" type="text" autocomplete placeholder="Subject">
<label for="contact-message" class="sr-only">Message</label>
<textarea id="contact-message" rows="10" class="contact-message" name="message" placeholder="Message" required></textarea>
<button type="submit">Submit</button>
</form>
{{end}}
</section>
{{- with .Params.Footnote -}}
<small>{{. | markdownify}}</small>
{{- end -}}
</article>
{{ end }}

View File

@@ -0,0 +1,3 @@
{{- define "main" -}}
{{- partial "meta.html" . -}}
{{- end -}}

View File

@@ -0,0 +1,41 @@
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range .Site.RegularPages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Params.description }}</description>
<category>{{range .Params.categories}}{{. | humanize}}{{ end -}}</category>
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
{{- $params := "1024x512" -}}
{{- if .Params.coverAnchor -}}
{{- $params = print $params " " .Params.coverAnchor -}}
{{- else -}}
{{- $params = print $params " Center" -}}
{{- end -}}
{{- with $featured -}}
{{ $img := .Fill $params }}
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="{{$img.Permalink}}" medium="image" width="1024" height="512"/>
{{- end -}}
</item>
{{ end }}
</channel>
</rss>

View File

@@ -0,0 +1,4 @@
{{- define "main" -}}
{{- partial "meta.html" . -}}
{{- end -}}

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,12 @@
{{- partialCached "core/sharedHead.html" . -}}
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
<title>{{ block "title" . }}{{ with .Params.Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
{{- block "social" . -}}
{{- partial "core/social.html" . -}}
{{- end -}}
{{ block "preload" . }}
<link rel="preload" href="/index.json" as="fetch" crossorigin importance="low">
{{- end -}}

View File

@@ -0,0 +1,3 @@
{{- $manifest := resources.Get "json/manifest.json" -}}
{{- $manifest = $manifest | resources.ExecuteAsTemplate "manifest.json" . }}
<link rel="manifest" href="{{$manifest.RelPermalink}}">

View File

@@ -0,0 +1,53 @@
{{- $res := slice -}}
{{- $syntax := resources.Get "css/syntax.css" -}}
{{$main := $syntax}}
{{if $.Param "scss" }}
{{- $sass := resources.Get "scss/main.scss" -}}
{{- $cssOpts := cond (hugo.IsServer) (dict "enableSourceMap" true ) (dict "outputStyle" "compressed") -}}
{{- $main = $sass | resources.ExecuteAsTemplate "main.scss" . | toCSS $cssOpts -}}
{{- else -}}
{{ $main = resources.Get "compiled/main.css" | resources.ExecuteAsTemplate "main.css" .}}
{{- end -}}
{{- $cssFiles := slice $main $syntax | resources.Concat "css/index.css" -}}
{{- $css := $cssFiles | resources.Minify | resources.Fingerprint "sha512" }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" media="none" onload="if(media!='all')media='all'">
{{- $res = $res | append $css.RelPermalink }}
<noscript>
<link rel="stylesheet" href="{{ $css.RelPermalink }}" media="screen">
</noscript>
<style>
html {
opacity: 0;
}
</style>
{{- range .Site.Params.custom_css -}}
{{- $res = $res | append . }}
<link rel="stylesheet" href="{{ . }}">
{{- end -}}
{{- $main := resources.Get "js/main.js" | resources.ExecuteAsTemplate "js/main.js" . -}}
{{- if hugo.IsServer }}
<script type="text/javascript" src="{{ $main.RelPermalink }}" defer></script>
{{- $res = $res | append $main.RelPermalink -}}
{{- else -}}
{{- $js := slice $main | resources.Concat "index.js" | resources.Minify }}
<script type="text/javascript" src="{{ $js.RelPermalink }}" defer></script>
{{- $res = $res | append $js.RelPermalink -}}
{{- end -}}
{{- $sw := resources.Get "js/sw.js" -}}
{{- $sw = $sw | resources.ExecuteAsTemplate "sw.js" (dict "page" . "res" $res) | resources.Minify -}}
<!-- {{- $sw.RelPermalink -}} -->
<script>
if (window.localStorage.color) {
document.documentElement.style.setProperty("--theme-color", window.localStorage.color);
}
if(window.localStorage.dark === "true") {
document.documentElement.classList.add("dark");
}
{{- if (.Site.Params.checksDarkMode) -}}
if (window.matchMedia('(prefers-color-scheme: dark)').matches && window.localStorage.dark !== "false") {
document.documentElement.classList.add("dark");
}
{{- end -}}
</script>

View File

@@ -0,0 +1,26 @@
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
{{- with .Site.Params.color}}
<meta name="theme-color" content="{{.}}">
{{- end -}}
{{- hugo.Generator }}
<meta name="robots" content="index, follow">
{{- block "favicon" . }}
{{- if (fileExists "assets/image/favicon.svg") }}
{{- $iconSVG := resources.Get "image/favicon.svg" | resources.Minify }}
<link rel="icon" type="image/svg" href="{{ $iconSVG.RelPermalink }}" />
{{- end -}}
{{- if (fileExists "assets/image/favicon.png") }}
{{- $icon := resources.Get "image/favicon.png" -}}
<link rel="apple-touch-icon-precomposed" href="{{ ($icon.Resize " 180x180 ").RelPermalink }}" />
<link rel="icon" type="image/png" href="{{ ($icon.Resize " 196x196 ").RelPermalink }}" />
{{- end -}}
{{- end -}}
{{- $title := .Site.Title -}}
{{- with .OutputFormats.Get "RSS" -}}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $title }}" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $title }}" />
{{- end -}}

View File

@@ -0,0 +1,193 @@
{{- block "meta" . -}}
<link rel="canonical" href="{{.Permalink}}" />
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"
/>
{{- with .Site.Author.name}}
<meta name="author" content="{{ . }}">
{{- end -}}
{{- partialCached "core/manifest.html" . -}}
{{ end }}
{{- block "opengraph" . -}}
{{- /* Open Graph */ -}}
<meta property="og:title" content="{{ .Title }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"
/>
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" />
{{- with .Params.audio }}
<meta property="og:audio" content="{{ . }}" />
{{- end -}}
{{- with .Params.locale }}
<meta property="og:locale" content="{{ . }}" />
{{- end -}}
{{- with .Params.video }}
<meta property="og:video" content="{{ . }}" />
{{- end -}}
{{- with .Params.image }}
<meta property="og:image" content="{{ . }}" />
{{- end -}}
{{- if .IsPage }}
{{- if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{ else if not .Date.IsZero }}<meta property="article:published_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{ end }}
{{- if not .Lastmod.IsZero }}<meta property="article:modified_time" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>{{ end }}
{{- else }}
{{- if not .Date.IsZero }}
<meta property="og:updated_time" content="{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"/>
{{- end }}
{{- end }}
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}{{if $siteSeries}}{{ with .Params.series }}
{{- range $name := . }}
{{- $series := index $siteSeries $name }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
{{- end -}}
{{ end }}
{{- end }}{{ end -}}
{{- with .Site.Author.facebook }}
<meta property="article:author" content="https://www.facebook.com/{{ . }}" />
<meta property="article:publisher" content="https://www.facebook.com/{{ . }}" />
{{- end -}}
{{- with .Section }}
<meta property="article:section" content="{{ . }}" />
{{- end -}}
{{- with .Params.tags -}}{{- range first 6 . }}
<meta property="article:tag" content="{{ . }}" />
{{- end }}{{ end -}}
{{- end -}}
{{- with .Site.Author.pinterest }}
<meta name="p:domain_verify" content="{{.}}" />
{{end -}}
{{- block "twitter" . -}}
{{- with .Params.image -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ . | absURL }}"/>
{{ else -}}
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- $featured := cond (ne $featured nil) $featured ($images.GetMatch "{*cover*,*thumbnail*}") -}}
{{- $params := "1024x512" -}}
{{- if .Params.coverAnchor -}}
{{- $params = print $params " " .Params.coverAnchor -}}
{{- else -}}
{{- $params = print $params " Center" -}}
{{- end -}}
{{- with $featured -}}
{{ $img := .Fill $params }}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ $img.Permalink }}"/>
{{- else -}}
{{- with $.Site.Params.image -}}
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="{{ . | absURL }}"/>
{{- else -}}
<meta name="twitter:card" content="summary"/>
{{- end -}}
{{- end -}}
{{- end }}
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
{{- with .Site.Author.twitter }}
<meta name="twitter:site" content="@{{ . }}" />
<meta name="twitter:creator" content="@{{ . }}" />
{{- end -}}
{{- end -}}
{{/* Google News */}}
{{- if .IsPage }}{{ with .Params.tags }}
<meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}" />
{{- end }}{{ end -}}
{{- block "jsonld" . }}
<script type="application/ld+json">
{
"headline": "{{ .Title }}",
"publisher": {
"@type": "Organization",
{{- if (fileExists "assets/image/logo.svg") }}
"logo": {
"@type": "ImageObject",
"url": {{ (resources.Get "image/logo.svg" | resources.Minify).RelPermalink | jsonify | safeJS}}
},
{{- else if (fileExists "assets/image/logo.png") }}
"logo": {
"@type": "ImageObject",
"url": {{ (resources.Get "image/logo.png" ).RelPermalink | jsonify | safeJS }}
},
{{- end -}}
"name": "{{ .Site.Author.name }}"
},
"author": {
"@type": "Person",
"name": "{{ .Site.Author.name }}"
},
"description": "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description}}{{ . }}{{ end }}{{ end }}{{ end }}",
"name": "{{ .Site.Title }}",
{{ if eq .Page.Kind "home" }}
"@type": "WebSite",
{{ else if eq .Page.Kind "section"}}
"@type": "Blog",
"mainEntityOfPage":{"@type":"WebPage","@id":"{{.Permalink}}"},
{{ else if (and (eq .Page.Kind "page") (ne .Section "") ) }}
"@type": "BlogPosting{{.Section}}",
"wordCount": {{.WordCount}},
"mainEntityOfPage":{"@type":"WebPage","@id":"{{.Permalink}}"},
{{ else }}
"@type": "Article",
"wordCount": {{.WordCount}},
"mainEntityOfPage":{"@type":"WebPage","@id":"{{.Permalink}}"},
{{ end }}
"@context": "http://schema.org",
{{- with .Params.image }}
"image":"{{ . }}",
{{ end }}
{{- if .IsPage }}
{{- if not .PublishDate.IsZero }}
"dateCreated": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | jsonify | safeJS }},
{{- else if not .Date.IsZero }}
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | jsonify | safeJS }},
{{- end }}
{{- if not .Lastmod.IsZero }}
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | jsonify | safeJS }},
{{ end }}
{{- else }}
{{- if not .Date.IsZero }}
"dateModified": {{ .Date.Format "2006-01-02T15:04:05-07:00" | jsonify | safeJS }},
{{- end }}
{{- end }}
"url": {{.Permalink | jsonify | safeJS}}
}
</script>
{{- if isset .Params "video" }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "VideoObject",
"name": "{{.Title}}",
"description": "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description}}{{ . }}{{ end }}{{ end }}{{ end }}",
"contentUrl": "{{.Params.Video}}",
{{/* TODO: When we get to the first video
"thumbnailUrl": "http://www.example.com/thumbnail.jpg",
"uploadDate": "2015-04-05T08:00:00+02:00", "duration": "PT1M33S",
"embedUrl": "http://www.example.com/embed?videoetc",
"interactionCount": "2347"
*/}}
}
</script>
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,90 @@
<div class="debug">
<div class="debug-badge">
<div class="debug-toggle">
</div>
</div>
<div class="debug-content">
<div class="debug-header">
<!-- Tab links -->
<div class="tabs">
<div class="tab">
<button class="tablinks active" onclick="openTab(event, 'tab-overview')">Overview</button>
<button class="tablinks" onclick="openTab(event, 'tab-params')">Params</button>
<button class="tablinks" onclick="openTab(event, 'tab-site')">Site</button>
</div>
<div id="tab-overview" class="tabcontent" style="display: block;">
<table class="debugprint">
<tr>
<th class="key">Key</th>
<th class="value">Value</th>
</tr>
<tr>
<td class="key">Content Source</td>
<td class="value">{{ with .context.File }}{{ .Path }}{{ end }}</td>
</tr>
<tr>
<td class="key">Type</td>
<td class="value">{{ .context.Page.Type }}</td>
</tr>
<tr>
<td class="key">Kind</td>
<td class="value">{{ .context.Page.Kind }}</td>
</tr>
<tr>
<td class="key">Section</td>
<td class="value">{{ .context.Page.Section }}</td>
</tr>
<tr>
<td class="key">Layout</td>
<td class="value">{{ .context.Page.Layout }}</td>
</tr>
</table>
</div>
<!-- Tab content -->
<!-- <div id="tab-params" class="tabcontent">
{{ $PageVarNames := (slice "Name" "Title" "Type" "Kind" "Section" "Draft" "Type" "Layout" "Permalink" "RelPermalink" "Data") }}
{{ $PageVarSymbols := (slice .context.Page.Name .context.Page.Title .context.Page.ResourceType .context.Page.Kind .context.Page.Section .context.Page.Draft .context.Page.Type .context.Page.Layout .context.Page.Permalink .context.Page.RelPermalink .context.Page.Data ) }}
<table class="debugprint">
<tr>
<th class="key">Page Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $PageVarNames }}
<tr>
<td class="key">{{ printf "%s" $elem | safeHTML }}</td>
<td class="value">{{ printf "%#v" (index $PageVarSymbols $idx) | htmlUnescape }}</td>
</tr>
{{ end }}
</table>
</div> -->
<div id="tab-params" class="tabcontent">
{{ partial "debug/debugprint.html" .context.Params }}
</div>
<div id="tab-site" class="tabcontent">
{{ partial "debug/debugprint.html" site }}
</div>
</div>
</div>
</div>
</div>
{{ $js := resources.Get "js/debug.js" }}
{{ if hugo.IsServer }}
<script type="text/javascript" src="{{ $js.RelPermalink }}"></script>
{{ else }}
<script type="text/javascript" src="{{ ($js | minify).RelPermalink }}"></script>
{{ end }}
{{- $debugprint := resources.Get "css/debugprint.css" -}}
{{- $debug := resources.Get "css/debug.css" -}}
{{- $css := slice $debug $debugprint | resources.Concat "css/debug.css" -}}
<link rel="stylesheet" href="{{ $css.Permalink }}" media="screen">

View File

@@ -0,0 +1,263 @@
<!-- Pretty Print for Debug -->
<!-- https://github.com/kaushalmodi/hugo-debugprint/blob/master/layouts/partials/debugprint.html -->
<!-- Usage examples (remove /* and */ when using):
{{/* partial "debug/debugprint.html" .Params */}}
{{/* partial "debug/debugprint.html" site */}}
{{/* partial "debug/debugprint.html" site.Menus */}}
{{/* partial "debug/debugprint.html" .GitInfo */}}
{{/* partial "debug/debugprint.html" .Resources */}}
{{/* partial "debug/debugprint.html" .File */}}
-->
<!-- Associated CSS file:
https://github.com/kaushalmodi/hugo-debugprint/blob/master/layouts/partials/debugprint.css
Inline that CSS file in your site <head> using below (remove /* and */ when using):
<style>{{/* partial "debugprint.css" | safeCSS */}}</style>
See https://github.com/kaushalmodi/hugo-debugprint/blob/master/layouts/_default/baseof.html for example.
-->
{{ $value := . }}
{{ $type := (printf "%T" $value) }}
{{ $typeIsBool := (eq "bool" $type) }}
{{ $typeIsNumber := (or (eq "int" $type) (eq "int64" $type) (eq "float64" $type)) }}
{{ $typeIsString := (findRE "^(string|template\\.(CSS|HTML|HTMLAttr|JS|JSStr|URL))$" $type) }}
{{ $typeIsTime := (eq "time.Time" $type) }}
{{ $typeIsSlice := (findRE "^([[][]]|.*TaxonomyList|output\\.Formats|resource\\.Resources|\\*?hugolib\\.Menu$|\\*?hugolib\\.Pages$|hugolib\\.OrderedTaxonomy$|hugolib\\.WeightedPages)" $type) }}
<!-- match ^[] -->
{{ $typeIsMap := (findRE "^(map[[].+[]]|.*SiteSocial|\\*hugolib\\.Menus|hugolib\\.AuthorList|hugolib\\.Taxonomy)" $type) }}
<!-- match ^map[*] -->
{{ $typeIsSiteInfo := (eq "*hugolib.SiteInfo" $type) }}
{{ $typeIsGitInfo := (findRE "^.*gitmap\\.GitInfo" $type) }}
{{ $typeIsOutputFormat := (eq "output.Format" $type) }}
{{ $typeIsResource := (findRE "^\\*resource" $type) }}
{{ $typeIsPage := (findRE "^\\*hugolib\\.Page" $type) }}
{{ $typeIsFileInfo := (findRE "^\\*(hugolib|source)\\.[fF]ileInfo$" $type) }}
<!-- terms pages for e.g. uses source.FileInfo, regular pages using hugolib.fileInfo -->
{{ $typeIsMenuEntry := (eq "*hugolib.MenuEntry" $type) }}
{{ $typeIsOrderedTaxonomyEntry := (eq "hugolib.OrderedTaxonomyEntry" $type) }}
{{ $typeIsWeightedPage := (eq "hugolib.WeightedPage" $type) }}
{{ $typeIsStruct := (or $typeIsSiteInfo $typeIsGitInfo $typeIsOutputFormat $typeIsFileInfo $typeIsPage $typeIsMenuEntry $typeIsOrderedTaxonomyEntry) }}
{{ $typeIsInterface := (or $typeIsResource) }}
{{ $typeIsSpecial := (or $typeIsWeightedPage) }}
{{ if $typeIsBool }}
{{ printf `<span class="debugprint"><span class="%#v">%#v</span></span>` $value $value | safeHTML }}
{{ else if (or $typeIsNumber $typeIsString) }}
<!-- Use %#v for strings so that their values always get double-quoted.
That is helpful to tell if a space char is within a string. -->
{{ printf "%#v" $value | htmlUnescape }}
{{ else if $typeIsTime }}
{{ printf "%s" $value | safeHTML }}
{{ else if $typeIsSlice }}
{{ range $value }}
{{ partial "debug/debugprint.html" . }}
<!-- Recursive call FTW! -->
{{ end }}
{{ else if $typeIsMap }}
{{ if (gt (len $value) 0) }}
<div class="debugprint_wrap">
<table class="debugprint">
<tr>
<th class="key">Key</th>
<th class="type">Type</th>
<th class="value">Value</th>
</tr>
{{ range $key1, $value1 := $value }}
{{ $type1 := (printf "%T" $value1) }}
{{ $type1IsTime := (eq "time.Time" $type1) }}
{{ if $type1IsTime }}
<!-- Print the date only if it is not at its initial value of Jan 1, 0001 -->
{{ if (ne "0001-01-01" ($value1.Format "2006-01-02")) }}
{{ printf `<tr><td class="key">%s</td><td class="type">%s</td><td class="value">` $key1 $type1 | safeHTML }}
{{ partial "debug/debugprint.html" $value1 }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
{{ else }}
{{ printf `<tr><td class="key">%s</td><td class="type">%s</td><td class="value">` $key1 $type1 | safeHTML }}
{{ partial "debug/debugprint.html" $value1 }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
{{ end }}
</table>
</div>
{{ end }}
{{ else if $typeIsStruct }}
<div class="debugprint_wrap">
{{ if $typeIsSiteInfo }}
<!-- https://github.com/gohugoio/hugo/blob/master/hugolib/site.go -->
{{ $siteVarNames := (slice "Title" "Author" "Social" "LastChange" "DisqusShortname" "GoogleAnalytics" "Copyright" "LanguageCode" "BuildDrafts" "Params") }}
{{ $siteVarSymbols := (slice .Title .Author .Social .LastChange .DisqusShortname .GoogleAnalytics .Copyright .LanguageCode .BuildDrafts .Params ) }}
<table class="debugprint">
<tr>
<th class="key">SiteInfo Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $siteVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $siteVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ else if $typeIsGitInfo }}
<!-- https://github.com/bep/gitmap/blob/master/gitmap.go -->
{{ $gitInfoVarNames := (slice "Hash" "AbbreviatedHash" "Subject" "AuthorName" "AuthorEmail" "AuthorDate") }}
{{ $gitInfoVarSymbols := (slice .Hash .AbbreviatedHash .Subject .AuthorName .AuthorEmail .AuthorDate ) }}
<table class="debugprint">
<tr>
<th class="key">GitInfo Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $gitInfoVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $gitInfoVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ else if $typeIsOutputFormat }}
<!-- https://github.com/gohugoio/hugo/blob/master/output/outputFormat.go -->
{{ $OutputFormatVarNames := (slice "Name" "MediaType" "Path" "BaseName" "Rel" "Protocol" "IsPlainText" "IsHTML" "NoUgly" "NotAlternative") }}
{{ $OutputFormatVarSymbols := (slice .Name .MediaType .Path .BaseName .Rel .Protocol .IsPlainText .IsHTML .NoUgly .NotAlternative ) }}
<table class="debugprint">
<tr>
<th class="key">OutputFormat Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $OutputFormatVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $OutputFormatVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ else if $typeIsFileInfo }}
<!-- https://github.com/gohugoio/hugo/blob/master/hugolib/fileInfo.go (*hugolib.fileInfo - used by regular pages) -->
<!-- https://github.com/gohugoio/hugo/blob/master/source/fileInfo.go (*source.FileInfo - used by term pages) -->
{{ $FileInfoVarNames := (slice "UniqueID" "BaseFileName" "TranslationBaseName" "Lang" "Section" "LogicalName" "Dir" "Ext" "Path") }}
{{ $FileInfoVarSymbols := (slice .UniqueID .BaseFileName .TranslationBaseName .Lang .Section .LogicalName .Dir .Ext .Path ) }}
<table class="debugprint">
<tr>
<th class="key">FileInfo Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $FileInfoVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $FileInfoVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ else if $typeIsPage }}
<!-- https://github.com/gohugoio/hugo/blob/master/hugolib/page.go -->
{{ $PageVarNames := (slice "Name" "Title" "ResourceType" "Kind" "Section" "Draft" "Type" "Layout" "Permalink" "RelPermalink" "Data") }}
{{ $PageVarSymbols := (slice .Name .Title .ResourceType .Kind .Section .Draft .Type .Layout .Permalink .RelPermalink .Data ) }}
<table class="debugprint">
<tr>
<th class="key">Page Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $PageVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $PageVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
{{ with .NextPage }}
{{ printf `<tr><td class="key">NextPage</td><td class="value"><a href="%s">%s</a></td></tr>` .Permalink .Title | safeHTML }}
{{ else }}
{{ printf `<tr><td class="key">NextPage</td><td class="value">None</td></tr>` | safeHTML }}
{{ end }}
{{ with .PrevPage }}
{{ printf `<tr><td class="key">PrevPage</td><td class="value"><a href="%s">%s</a></td></tr>` .Permalink .Title | safeHTML }}
{{ else }}
{{ printf `<tr><td class="key">PrevPage</td><td class="value">None</td></tr>` | safeHTML }}
{{ end }}
{{ with .NextInSection }}
{{ printf `<tr><td class="key">NextInSection</td><td class="value"><a href="%s">%s</a></td></tr>` .Permalink .Title | safeHTML }}
{{ else }}
{{ printf `<tr><td class="key">NextInSection</td><td class="value">None</td></tr>` | safeHTML }}
{{ end }}
{{ with .PrevInSection }}
{{ printf `<tr><td class="key">PrevInSection</td><td class="value"><a href="%s">%s</a></td></tr>` .Permalink .Title | safeHTML }}
{{ else }}
{{ printf `<tr><td class="key">PrevInSection</td><td class="value">None</td></tr>` | safeHTML }}
{{ end }}
</table>
{{ else if $typeIsMenuEntry }}
<!-- https://github.com/gohugoio/hugo/blob/master/hugolib/menu.go -->
{{ $MenuEntryVarNames := (slice "Menu" "Title" "Name" "URL" "Identifier" "Weight" "Pre" "Post" "Parent" "Children") }}
{{ $MenuEntryVarSymbols := (slice .Menu .Title .Name .URL .Identifier .Weight .Pre .Post .Parent .Children ) }}
<table class="debugprint">
<tr>
<th class="key">MenuEntry Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $MenuEntryVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $MenuEntryVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ else if $typeIsOrderedTaxonomyEntry }}
<!-- https://github.com/gohugoio/hugo/blob/master/hugolib/taxonomy.go -->
{{ $OrderedTaxonomyEntryVarNames := (slice "Name" "Count" "Term" "WeightedPages") }}
{{ $OrderedTaxonomyEntryVarSymbols := (slice .Name .Count .Term .WeightedPages ) }}
<table class="debugprint">
<tr>
<th class="key">OrderedTaxonomyEntry Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $OrderedTaxonomyEntryVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $OrderedTaxonomyEntryVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ end }}
</div>
{{ else if $typeIsInterface }}
<div class="debugprint_wrap">
{{ if $typeIsResource }}
<!-- https://github.com/gohugoio/hugo/blob/master/resource/resource.go -->
{{ $ResourceVarNames := (slice "Name" "Title" "ResourceType" "Permalink" "RelPermalink" "Params") }}
{{ $ResourceVarSymbols := (slice .Name .Title .ResourceType .Permalink .RelPermalink .Params ) }}
<!-- There's .AbsSourceFilename too, but it's not very useful. -->
<table class="debugprint">
<tr>
<th class="key">Resource Variable</th>
<th class="value">Value</th>
</tr>
{{ range $idx, $elem := $ResourceVarNames }}
{{ printf `<tr><td class="key">%s</td><td class="value">` $elem | safeHTML }}
{{ partial "debug/debugprint.html" (index $ResourceVarSymbols $idx) }}
<!-- Recursive call FTW! -->
{{ printf "</td></tr>" | safeHTML }}
{{ end }}
</table>
{{ end }}
</div>
{{ else if $typeIsSpecial }}
{{ if $typeIsWeightedPage }}
<!-- https://github.com/gohugoio/hugo/blob/master/hugolib/taxonomy.go -->
<table>
{{ printf "<tr><td>%s</td><td>W:%d</td></tr>" .Page.Title .Weight | safeHTML }}
</table>
{{ end }}
<!-- Anything Else -->
{{ else }}
{{ printf "%#v (<i>type:%s</i>)" $value $type | safeHTML }}
{{ end }}
<!-- Older, simpler version -->
<!-- <table class="debugprint"> -->
{{/* range $key1, $value1 := . */}}
{{/* printf "<tr><td>%#v</td><td>%#v</td></tr>" $key1 $value1 | safeHTML */}}
{{/* end */}}
<!-- </table> -->

View File

@@ -0,0 +1,112 @@
<footer>
{{- if .Site.Params.Footer -}}
<div class="items-{{len .Site.Params.Footer}} items">
{{- $RSS := (.OutputFormats.Get "RSS") -}}
{{- range .Site.Params.Footer -}}
<section>
<h2>
{{ .title }}
</h2>
{{- with .content -}}
<p>
{{ . | markdownify }}
</p>
{{- end -}}
{{- if isset . "newsletter" -}}
<h2>{{.newsletter}}</h2>
{{- partialCached "util/newsletter" . -}}
{{- end -}}
{{$page := .}}
{{$count := 100}}
{{ if gt .recentCount -1 }}
{{ $count = .recentCount }}
{{ end }}
{{- if .menu -}}
<ul class="sidebar-nav">
{{ range $.Site.Menus.footer }}
<li><a class="footer-menu" href="{{ .URL }}" title="{{ .Title }}">{{ default .Page.Title .Name }}</a></li>
{{ end }}
</ul>
{{- end -}}
{{ with .recents }}
<ul>
{{ range first ($count) (where (where $.Site.Pages "Section" .) ".Kind" "==" "page" )}}
<li>
<a href={{.Permalink}}>{{ default (.File.ContentBaseName | humanize) .Title }}</a> -
{{$date := .Date}}
{{ if and (not $date) .GitInfo }}
{{$date = .GitInfo.AuthorDate}}
{{- end -}}
<time datetime="{{ $date.Format "2006-01-02T15:04:05Z07:00" }}">{{ $date.Format "Monday, Jan 2, 2006."}}</time>
</li>
{{ end }}
</ul>
{{ end }} {{ with .contact }}
<ul class="contact-us">
{{ with $.Site.Author.email }}
<li>
<a target="_blank" href="mailto:{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-envelope.svg" | resources.Minify }} {{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
{{$middle := replaceRE "^.*@" "" .}}
<span>{{replaceRE "@.*$" "" .}} [at] {{ replaceRE "\\..*" "" $middle }} [dot] {{ replaceRE "^.*\\." "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.linkedin }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-linkedin.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.github }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-github.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.twitter }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-twitter.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }} {{ with $.Site.Author.facebook }}
<li>
<a target="_blank" href="{{ . }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-facebook.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>{{ replaceRE "https://" "" . }}</span>
</a>
</li>
{{ end }}
{{ with $RSS }}
<li>
<h2>Updates</h2>
<a target="_blank" href="{{ .RelPermalink }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-rss.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<span>RSS Feed</span>
</a>
</li>
{{ end }}
</ul>
{{ end }}
</section>
{{ end }}
</div>
{{- end -}}
<div id="copyright">
{{- replace .Site.Params.copyright "{now}" (print "<time class='now' datetime='" (now.Format "2006-01-02T15:04:05Z07:00") "'>" (dateFormat "2006" now) "</time>")| markdownify | safeHTML }} Last Updated -
<time datetime="{{ now.Format "2006-01-02T15:04:05Z07:00" }}">{{ dateFormat "Monday, Jan 2, 2006." now}}</time> <br>
<!-- DO NOT REMOVE. LICENSE REQUIRES THIS ATTRIBUTION SHOULD STAY INTACT-->
Themed using <a href="">Eclectic</a> by <a href="https://atishay.me">Atishay</a>
<!-- END DO NOT REMOVE SECTION -->
</div>
</footer>

View File

@@ -0,0 +1,102 @@
<a href="#top" class="scroll-up" role="button">
<span class="sr-only">Scroll to top</span>
{{ $icon := resources.Get "image/line-awesome/fa-angle-up.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " " <svg width=\"30px\" " | safeHTML }}
</a>
<header id="header">
{{/*
Checkbox Hack for pure CSS Hamburger menu
https://codepen.io/erikterwan/pen/EVzeRP
*/}}
<input class="hamburger" role="button" type="checkbox" aria-label="Menu Button" />
<a class="icon" aria-hidden="true">
{{ $hamburger := resources.Get "image/hamburger.svg" | resources.Minify }}
{{ $hamburger.Content | safeHTML }}
</a>
{{/* End Checkbox hack code. Uses the parallel <ul as well> */}}
<a role="button" class="logo" href="{{"index.html" | absURL}}">
{{- if (fileExists "assets/image/logo.svg") }}
{{ (resources.Get "image/logo.svg").Content | safeHTML }}
{{- else if (fileExists "assets/image/logo.png") -}}
<img height="47px" src="{{((resources.Get "image/logo.png").Resize "x47").RelPermalink}}">
{{- else -}}
{{ .Site.Title }}
{{- end -}}
<span class="sr-only">Logo</span>
</a>
<ul role="menubar" class="top-menu">
{{ $currentPage := . }}
{{/* Finding the best category to pin the current page to. */}}
{{ $fallback := "home" }}
{{ range .Site.Menus.main }}
{{ if or ($currentPage.HasMenuCurrent "top" .) ($currentPage.IsMenuCurrent "top" .) }}
{{$fallback = .Name}}
{{else if eq $currentPage.Section .Name}}
{{$fallback = .Name}}
{{end}}
{{ end}}
{{/* Current Category is now found. We just need to fit inside it */}}
{{ range .Site.Menus.main }}
<li role="menuitem" class="top-menu-item {{ if eq $fallback .Name }}active{{ end }}">
<a href="{{.URL}}">{{ .Name | upper }}</a>
{{ if .HasChildren }}
<ul class="sub-menu" role="menu">
{{ range .Children }}
<li class="{{ if $currentPage.IsMenuCurrent "top" . }}active{{ end }}">
<a href="{{ .URL }}">{{ .Name | upper }}</a>
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
<div id="searchbox">
<label class="sr-only" for="search">Search</label>
<input id="search" type="text" placeholder="Search" spellcheck="true">
{{- partialCached "util/icon" (dict "key" "search" "size" 20) "search-20" -}}
<section class="results">
</section>
</div>
{{with .Site.Params.github }}
<a href="{{.}}" class="github-corner" aria-label="View source on Github">
{{ $iconSVG := resources.Get "image/octocat.svg" | resources.Minify }}
{{ $iconSVG.Content | safeHTML }}
</a>
{{ end }}
{{if .Site.Params.colorPickerEnabled}}
<div id="color-picker">
<div class="theme">
<h3>Select Theme Color </h3>
<div class="colors">
{{- range .Site.Params.colorVariations -}}
<div class="theme-choice" data-color="{{.color}}" style="--color: #{{.color}}" title="{{.name}}"></div>
{{- end -}}
</div>
<a class="custom-color" href="#">Custom Color</a>
<div class="bg">
<span>Dark:</span>
<input type="checkbox" id="color-switch" name="" value="">
<div class="toggle">
<label for="color-switch"><i></i></label>
</div>
</div>
</div>
{{- partialCached "util/icon" (dict "key" "gear" "size" 20 "class" "picker" ) "gear-20" -}}
</div>
{{ end }}
<div id="scroll-indicator"></div>
</header>
{{/* https://css-tricks.com/markup-for-breadcrumbs/
https://jsonld.com/breadcrumb/
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }} {{ $.Scratch.Add "path" / }}
<nav class="breadcrumbs">
<a href="/">home</a>
{{ range $index, $element := split $url "/" }} {{ $.Scratch.Add "path" $element }} {{ if ne $element "" }}
<a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a>
{{ $.Scratch.Add "path" "/" }} {{ end }} {{ end }}
</nav>
{{ $.Scratch.delete "path" }}
*/}}

View File

@@ -0,0 +1,5 @@
{{- if in $.Site.Params.sharedHeader .Section -}}
{{- partialCached "header-raw.html" . .Section -}}
{{- else -}}
{{- partial "header-raw.html" . -}}
{{- end -}}

View File

@@ -0,0 +1,149 @@
{{ $site := .Site}}
{{$top := . }}
{{$needsContentRender := true }}
{{ range .Params.content }}
{{ $currentContent := . }}
{{ if .file }}
{{ if $top.Resources.GetMatch .file }}
{{ $currentContent = $top.Resources.GetMatch .file | transform.Unmarshal }}
{{ else }}
{{ $currentContent = resources.Get .file | transform.Unmarshal }}
{{ end }}
{{ end }}
{{ $types := split $currentContent.type " " }}
<section {{with $currentContent.title}}id="{{. | urlize}}" {{ end }} class="meta {{$currentContent.type | default "default"}}"
{{ with $currentContent.background }}
{{ $bg := (partial "util/image.html" (dict "Page" $top "image" .)).Fill "1400x940" }}
style="background-image:url({{$bg.RelPermalink}})"
{{ end }}
>
{{$title := $currentContent.title}}
{{ with $currentContent.icon }}
{{$title = default $title (findRE "\\w+(?:\\.\\w+)*$" .)}}
{{ partialCached "util/icon" (dict "key" . "size" 50 "class" "main-icon" "alt" $title) (print . "main-icon") }}
{{ end }}
{{ with $currentContent.image }}
{{$anchor := .anchor | default "" }}
{{ $cover := (partial "util/image.html" (dict "Page" $top "image" .href)).Fill (print (mul .width 2) "x" (mul .height 2) " " $anchor) }}
<img intrinsicsize="{{print (mul .width 2) "x" (mul .height 2)}}" width="{{.width}}" height="{{.height}}" alt="{{.alt}}" src="{{$cover.RelPermalink}}" />
{{ end }}
{{with $currentContent.title}}<h1>{{. | markdownify}}</h1>{{ end }}
{{with $currentContent.subtitle}}<p class="subtitle">{{. | markdownify}}</p>{{ end }}
{{with $currentContent.content}}<p>{{. | markdownify}}</p>{{ end }}
{{ if in $types "content" }}
{{ $needsContentRender = false }}
{{ $top.Content }}
{{ end }}
{{ if in $types "blog" }}
<ul class="items items-{{.count | default 6}}">
{{ range first (default 6 .count) (where (where $site.Pages ".Section" $currentContent.section) ".Kind" "page" ) }}
{{partialCached "util/post.html" . .RelPermalink}}
{{ end }}
</ul>
{{ end }}
{{ $defaultFilter := $currentContent.filter }}
{{ $filter := false }}
{{ $list := "" }}
{{ $filters := newScratch }}
{{ if in $types "filter" }}
{{ range $currentContent.items }}
{{ $list = print $list " " (trim .filter " ") }}
{{ end }}
{{ $list = uniq (split (trim $list " ") " ") }}
{{ $title := .title | urlize}}
{{ range $index, $element := $list }}
{{ $filters.Set $element $index }}
<label class="sr-only" for="filter-{{$element}}">{{$element}}</label>
<input id="filter-{{$element}}" type="radio" role="button" name="{{$title}}" {{if eq $defaultFilter $element}} checked="true"
{{end}} class="filter button filter-{{$index}}" value="{{$element}}">
{{ end }}
{{ end }}
{{ with $currentContent.items}}
<div class="items items-{{len .}}">
{{ range . }}
<div class="item {{ if ne $list "" -}}
{{- with .filter -}}
{{- range (split (trim . " ") " ") -}}
filter-{{$filters.Get .}} {{ end -}}
{{- end -}}
{{- end -}}">
{{ $title := .title }}
{{ with .image }}
{{$anchor := .anchor | default "" }}
{{ $cover := (partial "util/image.html" (dict "Page" $top "image" .href)).Fill (print (mul .width 2) "x" (mul .height 2) " " $anchor) }}
<img class="item-cover" intrinsicsize="{{print (mul .width 2) "x" (mul .height 2)}}" width="{{.width}}" alt="{{.alt | default $title}}" src="{{$cover.RelPermalink}}" />
{{ end }}
{{ with .video }}
<video class="item-cover" loop autoplay muted width="{{.width}}" height="{{.height}}">
<source src="{{.href}}" type="{{.format}}">
The browser does not support the video format {{.format}}.
</video>
{{ end }}
{{$title := .title }}
{{ with .icon }}
{{$title = default $title (findRE "\\w+(?:\\.\\w+)*$" .href)}}
{{ partialCached "util/icon" (dict "key" .href "size" (default 40 .width) "alt" $title "class" "item-icon") (print . "item-icon") }}
{{ end }}
{{ with .title }}
<h2>{{. | markdownify }}</h2>
{{ end }}
{{ with .subtitle }}
<h3>{{. | markdownify}}</h3>
{{ end }}
{{ with .heading }}
<h4>{{. | markdownify}}</h4>
{{ end }}
{{ with .content}}
<div class="content">{{. | markdownify}}</div>
{{ end }}
{{ with .attribution}}
<small class="attribution">{{. |markdownify}}</small>
{{ end }}
{{ $title := default .title "" }}
{{ with .links}}
<div class="links">
{{ range . }}
<a href="{{.href}}" class="button-small" target="_blank" rel="noopener">
{{ with .icon }}
{{ partialCached "util/icon" (dict "key" . "size" 18 "class" "link-icon" "alt" $title) (print . "link-icon") }}
{{ end }}
<span class="link-text">{{.title | markdownify}}</span>
</a>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
</div>
{{ end }}
{{ with .attribution }}
<small class="attribution">{{. |markdownify}}</small>
{{ end }}
</section>
{{ end }}
{{ if (and (or (not .Params.Content) .Content) $needsContentRender) }}
<section class="meta content with-background">
<article>
<div class="cover">
{{- partial "util/cover.html" (dict "class" "banner-holder" "page" . "width" 1024 "height" 330) -}}
</div>
{{with .Title}}<h1 class='title'>{{.}}</h1>{{end}}
{{ with .Params.subtitle }}
<span class='subtitle'>{{.}}</span>
{{ end }}
{{ .Content }}
{{- with .Params.tags }}
<div class="tags">
{{- range . -}}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">
{{- partialCached "util/icon" (dict "key" "tag" "size" 20) "tag-20" -}} {{ . | humanize }} </a>
{{- end -}}
</div>
{{ end }}
</article>
</section>
{{ end }}

View File

@@ -0,0 +1,51 @@
{{ $ID := .File.UniqueID }}
{{ with $.Site.Params.comment }}
<section class="comments">
<h2>Comments</h2>
{{ $comments := getCSV "," ( printf "https://docs.google.com/feeds/download/spreadsheets/Export?key=%s&exportFormat=csv" .sheet ) }}
<ul>
{{ $hasComment := false }}
{{ range $r := $comments }}
{{ if eq (index $r 3) $ID}}
{{ $hasComment := true }}
<li class="comment">
{{ $time := index $r 0}}
<img intrinsicsize="100x100" width="100px" height="100px" src="https://www.gravatar.com/avatar/{{ md5 (index $r 1) }}?s=100&d=identicon" alt="{{ index $r 2 }}">
<span class="commenter-name">{{ index $r 2 }}</span>
{{ $icon := resources.Get "image/line-awesome/fa-calendar.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
<time datetime="{{$time}}">{{(time $time).Format "Monday, Jan 2, 2006."}}</time>
<div class="commenter-comment">{{ index $r 4 | emojify }}</div>
</li>
{{ end }}
{{ end }}
{{ if ne $hasComment true }}
<li>
No comments yet. Be the first to post.
</li>
{{ end }}
</ul>
<h3>Post a new comment</h3>
<p>We get avatars from
<a target="_blank" rel="noopener" href="https://www.gravatar.com">Gravatar</a>. You can use emojis as per the <a target="_blank" href="https://www.webfx.com/tools/emoji-cheat-sheet/" rel="noopener">Emoji cheat sheet.</a></p>
<form action="https://docs.google.com/forms/d/e/{{.form}}/formResponse">
{{- with .name -}}
<label for="comment-name" class="sr-only">Name</label>
<input id="comment-name" class="comment-name" required type="name" autocomplete="given-name" placeholder="Name" name="{{.}}">
{{- end -}}
{{- with .email -}}
<label for="comment-email" class="sr-only">Email</label>
<input id="comment-email" class="comment-email" required type="email" autocomplete="email" placeholder="Email address"
name={{.}}>
{{- end -}}
{{- with .post -}}
<input class="comment-id" name="{{.}}" type="hidden" value="{{$ID}}">
{{- end -}}
{{- with .comment -}}
<label for="comment" class="sr-only">Comment</label>
<textarea id="comment" rows="10" class="comment-text" name="{{.}}" placeholder="Your comment" required></textarea>
{{- end -}}
<button type="submit">Post Comment</button>
</form>
</section>
{{- end -}}

View File

@@ -0,0 +1,63 @@
<section class="info">
<h2>Info</h2>
<table>
<tbody>
<tr>
<td colspan="2">
<p>{{.Description}}</p>
</td>
</tr>
<tr>
<th class="published" title="Published">
{{- partialCached "util/icon" (dict "key" "calendar" "size" 20) "calendar-20" -}}
<span>Published</span>
</th>
<td>
{{- $date := .PublishDate -}}
{{- if not $date -}}
{{- $date = .Lastmod -}}
{{- end -}}
<time datetime="{{ $date.Format " 2006-01-02T15:04:05Z07:00 " }}">{{ $date.Format "Monday, Jan 2, 2006."}}</time>
</td>
</tr>
<tr>
<th class="wordCount" title="Word Count">
{{- partialCached "util/icon" (dict "key" "bullseye" "size" 20) "bullseye-20" -}}
<span>Word Count</span>
</th>
<td>
{{ .WordCount }} words
</td>
</tr>
<tr>
<th class="readingTime" title="Reading Time">
{{- partialCached "util/icon" (dict "key" "hourglass-1" "size" 20) "hourglass-1-20" -}}
<span>Reading Time</span>
</th>
<td>
{{ .ReadingTime }} minutes
</td>
</tr>
{{with .Params.categories}}
<tr>
<th title="Category">
{{- partialCached "util/icon" (dict "key" "caret-square-o-right" "size" 20) "caret-square-o-right-20" -}}
<span>Category</span></th>
<td>{{ range . }}
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . | humanize }}</a>
{{end}}
</td>
</tr>
{{end}}
<tr>
<td class="tags" title="Tags" colspan="2">
{{- partialCached "util/icon" (dict "key" "tags" "size" 20) "tags-20" -}}
<span>Tags<br></span>
{{- range .Params.tags -}}
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . | humanize }} </a>
{{- end -}}
</td>
</tr>
</tbody>
</table>
</section>

View File

@@ -0,0 +1,6 @@
{{- with .Site.Params.newsletter -}}
<section class="sidebar">
<h2>Join the Newsletter</h2>
{{- partialCached "util/newsletter" . -}}
</section>
{{- end -}}

View File

@@ -0,0 +1,13 @@
<aside>
{{- partial "post/info" . -}}
{{range .Params.sidebar}}
<section class="sidebar">
{{with .title}}<h2>{{ . | humanize }}</h2>{{end}}
{{with .content}}<p>{{ . | markdownify }}</p>{{end}}
</section>
{{ end }}
{{- partialCached "post/tag-cloud" . -}}
{{- partialCached "post/site-sidebar" . -}}
{{- partialCached "post/newsletter" . -}}
{{- partial "post/social" . -}}
</aside>

View File

@@ -0,0 +1,68 @@
{{- $currentPage := . -}}
{{- if .Params.series -}}
{{- $seriesName := index .Params.series 0 -}}
{{- $current := 1 -}}
{{- $total := 0 -}}
{{- $scratch := newScratch -}}
{{- range .Site.RegularPages.ByDate -}}
{{- if in .Params.series $seriesName -}}
{{- $total = add $total 1 -}}
{{- if gt $.Date.Unix .Date.Unix -}}
{{ $scratch.Add "before" (slice .) }}
{{- $current = add $current 1 -}}
{{- else if ne . $currentPage -}}
{{ $scratch.Add "after" (slice .) }}
{{- end -}}
{{- end -}}
{{- end -}}
{{$before := $scratch.Get "before" | default slice}}
{{$after := $scratch.Get "after" | default slice}}
{{/*
* If we have none from before show three after
* If we do not have something after show three from before.
* If we have one after show two from before and one from after.
* Otherwise show one from before and two from after
*/}}
{{- if eq (len $before) 0 -}}
{{ .Scratch.Set "Related" ($after | first 3) }}
{{- else if eq (len $after) 0 -}}
{{ .Scratch.Set "Related" ($before | last 3) }}
{{- else if eq (len $after) 1 -}}
{{ .Scratch.Set "Related" ($before | last 2) }}
{{ .Scratch.Add "Related" $after }}
{{- else -}}
{{ .Scratch.Set "Related" ($before | last 1) }}
{{ .Scratch.Add "Related" ($after | first 2) }}
{{- end -}}
{{- else -}}
{{ .Scratch.Set "Related" (.Site.RegularPages.Related . | first 3) }}
{{- end -}}
{{- $related := .Scratch.Get "Related" -}}
{{- .Scratch.Delete "Related" -}}
{{- with $related -}}
<section class="more">
{{- if $currentPage.Params.series -}}
{{- $seriesName := index $currentPage.Params.series 0 -}}
<h2>More in {{$seriesName}}</h2>
{{- else -}}
<h2>You may also enjoy</h2>
{{- end -}}
<ul class="items-{{len $related}}">
{{- range . -}}
<li>
<a href="{{.RelPermalink}}">
{{- partial "util/cover.html" (dict "class" "img-container" "page" . "width" 400 "height" 300) -}}
</a>
<a class="description" href="{{ .RelPermalink }}">{{ .Title }}<br>
<small>
{{- partialCached "util/icon" (dict "key" "hourglass-1" "size" 16) "hourglass-1-16" -}}
{{.ReadingTime}} minutes
</small>
</a>
</li>
{{- end -}}
</ul>
</section>
{{- end -}}

View File

@@ -0,0 +1,6 @@
{{range $.Site.Params.sidebar}}
<section class="sidebar">
{{with .title}}<h2>{{ . | humanize }}</h2>{{end}}
{{with .content}}<p>{{ . | markdownify }}</p>{{end}}
</section>
{{ end }}

View File

@@ -0,0 +1,22 @@
{{/* Social Links https://www.mrcooper.com/blog/2018/05/14/5-outdoor-space-ideas-youll-love/ */}}
<section class="sidebar">
<h2>Share this Post</h2>
<a target="_blank" href="https://www.facebook.com/sharer.php?u={{ .Permalink }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-facebook.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
</a>
<a target="_blank" href="https://twitter.com/intent/tweet?url={{ .Permalink }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-twitter.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
</a>
<a target="_blank" href="https://www.linkedin.com/shareArticle?url={{ .Permalink }}" rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-linkedin.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
</a>
<a target="_blank"
href="https://pinterest.com/pin/create/bookmarklet/?url={{ .Permalink }}"
rel="noopener">
{{ $icon := resources.Get "image/line-awesome/fa-pinterest.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " "<svg width=\"30px\" " | safeHTML }}
</a>
</section>

View File

@@ -0,0 +1,21 @@
<section class="sidebar tag-cloud">
{{/* https://www.sidorenko.io/post/2017/07/nice-tagcloud-with-hugo/ */}}
<h2>Tag Cloud
<small class="info">
<a href="{{ "/tags/" | relLangURL }}">See full list</a>
</small>
</h2>
{{ if not (eq (len $.Site.Taxonomies.tags) 0) }}
{{ $fontUnit := "rem" }}
{{ $largestFontSize := 2.0 }}
{{ $smallestFontSize := 1.0 }}
{{ $max := len (index $.Site.Taxonomies.tags.ByCount 0).Pages }}
{{ $min := len (index $.Site.Taxonomies.tags.ByCount.Reverse 0).Pages }}
{{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
{{ $count := len $taxonomy.Pages }}
{{ $weight := div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min)) }} {{ $currentFontSize := (add $smallestFontSize (mul (sub $largestFontSize $smallestFontSize) $weight) ) }}
<a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" style="font-size:{{$currentFontSize}}{{$fontUnit}}">{{ $name }}</a>
{{ end }}
{{ end }}
</section>

View File

@@ -0,0 +1,4 @@
<div class="yt">
<iframe title="{{.title}} | {{$.Site.Author.name}} | Youtube" src="https://www.youtube-nocookie.com/embed/{{ .id }}?showinfo=0&modestbranding=1&iv_load_policy=3&rel=0"
allowfullscreen></iframe>
</div>

View File

@@ -0,0 +1,15 @@
{{$scratch := newScratch}}
{{$products := resources.GetMatch "products.csv"}}
{{$parsedProducts := $products | transform.Unmarshal (dict "delimiter" ",")}}
{{$index := index $parsedProducts 0}}
{{ range $i, $r := $parsedProducts }}
{{ if ne $i 0}}
{{range $j := seq (sub (len $index) 1)}}
{{ $scratch.SetInMap (index $r 0) (index $index $j) (index $r $j) }}
{{ end }}
{{ end }}
{{ end }}
{{return $scratch.Values}}

View File

@@ -0,0 +1,5 @@
{{- $cover := partial "util/backgroundImage.html" . -}}
{{/* https://unsplash.com/photos/-WW8jBak7bo https://pxhere.com/en/photo/912411 */}}
{{/* Original: https://www.pexels.com/photo/computer-cup-desk-drink-434337/ */}}
<img class="background" intrinsicsize="1400x787" width="0" height="0" alt="Page Background" role="presentation" src="{{$cover.RelPermalink}}" />
<div class="background" role="presentation"></div>

View File

@@ -0,0 +1,7 @@
{{ $cover := (resources.Get "image/background.jpg").Fill "1400x787" }}
{{- if (fileExists "assets/image/background.svg") -}}
{{ $cover = (resources.Get "image/background.svg") }}
{{- else if (fileExists "assets/image/background.png") -}}
{{ $cover = (resources.Get "image/background.png").Fill "1400x787" }}
{{- end -}}
{{- return $cover -}}

View File

@@ -0,0 +1,7 @@
{{ $cover := (resources.Get "image/background-dark.jpg").Fill "1400x787" }}
{{- if (fileExists "assets/image/background-dark.svg") -}}
{{ $cover = (resources.Get "image/background-dark.svg") }}
{{- else if (fileExists "assets/image/background-dark.png") -}}
{{ $cover = (resources.Get "image/background-dark.png").Fill "1400x787" }}
{{- end -}}
{{- return $cover -}}

View File

@@ -0,0 +1,13 @@
{{- with $.page.Resources.GetMatch "cover.*" -}}
<div class="{{$.class}}">
{{ $cover := . }}
{{ $params := print $.width "x" $.height }}
{{ if $.page.Params.coverAnchor }}
{{ $params = print $params " " $.page.Params.coverAnchor }}
{{ else }}
{{ $params = print $params " Center" }}
{{end}}
{{ $cover = .Fill $params }}
<img intrinsicsize="{{print $.width "x" $.height}}" width="{{$.width}}" height="{{$.height}}" alt="{{$.page.Title}}" role="banner" class="banner" src="{{$cover.RelPermalink}}" />
</div>
{{- end -}}

View File

@@ -0,0 +1,4 @@
{{ $icon := resources.Get $.path | resources.Minify }}
{{ $result := print "<svg class=\"" $.class "\" width=\"" $.size "px\" " }}
{{ $icon = replace $icon.Content "<svg " $result }}
{{ $icon | safeHTML }}

View File

@@ -0,0 +1,2 @@
{{/* Adds links to the heading via an anchor tag */}}
{{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" "${1} <a class=\"heading-anchor\" href=\"#${2}-anchor\" id=\"${2}-anchor\">#</a> ${3}" | safeHTML }}

View File

@@ -0,0 +1,11 @@
{{- if eq (len (findRE "\\.svg$" $.key 1)) 1 -}}
{{- partial "util/custom-icon" (dict "path" $.key "size" $.size "class" $.class) -}}
{{- else -}}
{{- if eq (len (findRE "\\.(png|jpg)$" $.key 1)) 1 -}}
{{- $icon := resources.Get $.key }}
{{ $image := $icon.Resize (print $.size "x") }}
<img src="{{$image.RelPermalink}}" class="{{$.class}}" width="{{$.size}}" alt="{{$.alt}}">
{{- else -}}
{{partial "util/native-icon" (dict "type" $.key "size" $.size "class" $.class)}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,5 @@
{{- $op := .Page.Resources.GetMatch .image -}}
{{- if not (.Page.Resources.GetMatch .image) -}}
{{- $op = resources.Get .image -}}
{{- end -}}
{{- return $op -}}

View File

@@ -0,0 +1,7 @@
{{- $icon := resources.Get (print "image/line-awesome/fa-" $.type ".svg") | resources.Minify -}}
{{- $class := "icon" -}}
{{- with $.class}}{{$class = .}}{{end -}}
{{- $result := print "<svg width=\"" $.size "px\" class=\"" $class "\" " -}}
{{- $icon = replace $icon.Content "<svg " $result -}}
{{- $icon = replace $icon "<path " "<path fill=\"currentColor\" " }}
{{ $icon | safeHTML }}

View File

@@ -0,0 +1,10 @@
<div class="newsletter">
<form action="{{.action}}" method="post" target="_blank">
<label for="newsletter-pot" class="honeypot">Details </label>
<input id="newsletter-pot" class="honeypot" type="text" name="{{.honeypot}}" tabindex="-1">
<label for="mce-EMAIL" class="sr-only">Email Address </label>
<input required class="email" type="email" name="{{.email}}" placeholder="Email Address" id="mce-EMAIL"><button
title="Subscribe" type="submit"
name="subscribe">{{- partialCached "util/icon" (dict "key" "user-plus" "size" 20) "user-plus-20" -}}</button>
</form>
</div>

View File

@@ -0,0 +1,32 @@
<li class="blog-post item">
<a href="{{.RelPermalink}}">
{{- partial "util/cover.html" (dict "class" "banner-holder" "page" . "width" 440 "height" 330) -}}
{{- with .Title -}}
<h3>{{.}}</h3>
{{- else -}}
{{if eq .Kind "section" }}
<h3>{{path.Dir .File.Path | path.Base | humanize}}</h3>
{{ else}}
<h3>{{.File.ContentBaseName | humanize}}</h3>
{{- end -}}
{{- end -}}
</a>
{{- with .Description -}}
<p>{{. | markdownify}}</p>
{{- else -}}
<p>{{.Summary | markdownify}}</p>
{{- end -}}
<hr/>
<div class="blog-post-footer">
<a href="{{.RelPermalink}}">Read More</a>
<span class="categories">
{{with .Params.categories}}
{{ $icon := resources.Get "image/line-awesome/fa-caret-square-o-right.svg" | resources.Minify }}
{{ replace $icon.Content "<svg " " <svg width=\"20px\"" | safeHTML }}
{{ range . }}
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}">{{ . | humanize }}</a>
{{end}}
{{end}}
</span>
</div>
</li>

View File

@@ -0,0 +1,32 @@
{{ define "head" }}
<link rel="preload" href="/fonts/NouveauDropCaps.woff2" as="font" crossorigin>
{{ end }}
{{ define "main" }}
{{- partialCached "util/background.html" "bg" -}}
<div class="post">
<main>
{{- if $.Page.Resources.GetMatch "cover.*" -}}
<div class="post-anchor">
{{- partial "util/cover.html" (dict "class" "banner-holder" "page" . "width" 800 "height" 400) -}}
</div>
{{- end -}}
<h1>{{.Title}}</h1>
{{- partial "util/heading-anchors.html" .Content -}}
{{- $title := default .Title "" -}}
{{- with .Params.youtube -}}
<h2>Video</h2>
<p>Here is the video:
{{- partial "post/youtube.html" (dict "id" . "title" $title) -}}
</p>
{{- end -}}
</main>
{{- partial "post/sidebar.html" . -}}
<section class="buttons">
<a class="button previous {{if not .PrevInSection}} disabled{{end}}" href="{{if .PrevInSection}}{{.PrevInSection.RelPermalink}}{{end}}">Older</a>
<a class="button next {{if not .NextInSection}} disabled{{end}}" href="{{if .NextInSection}}{{.NextInSection.RelPermalink}}{{end}}">Newer</a>
</section>
{{- partial "post/similar.html" . -}}
{{- partial "post/comments.html" . -}}
</div>
{{- end -}}

View File

@@ -0,0 +1,4 @@
<div style="background-image: linear-gradient(to right, transparent, #4f46e5, transparent);margin:15px 0;height:2px;position:relative">
<!-- Additional trick: We can add Unicode characters as-is in HTML to render them.-->
<span style="position:absolute; left:calc(50% - 10px); line-height:2px; font-size:30px; padding: 0 5px;background: white; color:#4f46e5"></span>
</div>

View File

@@ -0,0 +1,30 @@
<!-- image -->
<figure {{ with .Get "class" }} class="{{.}}" {{ end }}>
{{ if .Get "link"}}<a href="{{ .Get "link" }}" {{ with .Get "target" }} target="{{ . }}" {{ end }}
{{ with .Get "rel" }} rel="{{ . }}" {{ end }}>{{ end }}
{{ $url := .Get "src" }}
{{ if ne (.Get "nomin") "true" }}
{{ if gt (.Get "width" ) 0}}
{{ if gt (.Get "height") 0 }}
{{ $k := $.Page.Resources.GetMatch $url }}
{{ $k = $k.Fill (print (.Get "width" ) "x" (.Get "height") " " (default (.Get "anchor") "Center")) }}
{{ $url = $k.RelPermalink }}
{{ end }}
{{end}}
{{end}}
<img src="{{$url}}" {{ if or (.Get "alt") (.Get "caption") }} alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"
{{ end }} {{ with .Get "width" }} width="{{.}}" {{ end }} {{ with .Get "height" }} height="{{.}}" {{ end }} />
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
<h4>{{ .Get "title" }}</h4>{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink"}}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>
<!-- image -->

View File

@@ -0,0 +1,5 @@
<!-- guitar -->
{{- $json := getJSON $.Site.Params.Guitar "?" (querify "q" .Inner) -}}
{{- with $json.svg -}}
{{. | safeHTML}}
{{- end -}}

View File

@@ -0,0 +1,2 @@
{{$product := default (.Get 0) (.Get "product")}}
{{index (index (partialCached "products.html" "nothing") $product) "Price" }}

View File

@@ -0,0 +1,9 @@
We make over ***200 shapes***. The most popular of these include:
Shape | Design | Description | Links
--- | --- | --- | ---
Line | -- | Two pointy ends and a straight stretch of ink | [Line on Wikipedia](https://en.wikipedia.org/wiki/Line_(geometry))
Circle | &#8413; | A full round with no corners | [Circle on Wikipedia]
Triangle | &#9651; | Three lines with three corners | [Triangle on Wikipedia](https://en.wikipedia.org/wiki/Triangle)
[Circle on Wikipedia]: https://en.wikipedia.org/wiki/Circle

View File

@@ -0,0 +1,10 @@
{{$count := default 5 (default (.Get 0) (.Get "count"))}}
{{/* Preprocess to speed up */}}
{{$inner := .Inner | markdownify}}
{{if gt $count 0}}
<ul>
{{ range seq $count}}
<li>{{$inner}}</li>
{{end}}
</ul>
{{end}}

View File

@@ -0,0 +1,10 @@
<!-- tex -->
{{ $inline := "" }}
{{- if eq (.Get 0) "inline" -}}
{{ $inline = "&inline=true" }}
{{- end -}}
{{- $json := getJSON $.Site.Params.Tex "?" (querify "q" .Inner) $inline -}}
{{- with $json.svg -}}
{{. | safeHTML}}
{{- end -}}

View File

@@ -0,0 +1,5 @@
{{- $id := .Get "id" | default (.Get 0) -}}
<div class="yt">
<iframe src="https://www.youtube-nocookie.com/embed/{{ $id }}?showinfo=0&modestbranding=1&iv_load_policy=3&rel=0{{ with .Get "autoplay" }}{{ if eq . "true" }}&autoplay=1{{ end }}{{ end }}"
allowfullscreen title="{{$.Page.Title}}"></iframe>
</div>

View File

@@ -0,0 +1,14 @@
{{ define "main" }}
{{- partialCached "util/background.html" "bg" -}}
<article class="list">
<h1 class='title'>{{.Title | humanize}}</h1>
<span class='subtitle'>{{.Params.Subtitle}}</span>
{{with .Content}}<div class="content">{{ .}}</div> {{- end -}}
<ul class="blog-posts items-{{.Paginator.PageSize}}">
{{ range .Pages}}
{{- partialCached "util/post.html" . .RelPermalink -}}
{{ end }}
</ul>
{{ template "_internal/pagination.html" . }}
</article>
{{ end }}

View File

@@ -0,0 +1,32 @@
{{ define "main" }}
{{- partialCached "util/background.html" "bg" -}}
<article class="terms">
<h1 class='title'>{{.Title}}</h1>
<span class='subtitle'>The website has the following {{.Title | lower}}.</span>
{{.Content}}
<ol>
{{ $type := .Type }}
{{ range $key, $value := .Data.Terms.Alphabetical }}
{{ $name := .Name }}
{{ $count := .Count }}
{{ $pages := .Pages }}
{{ with $.Site.GetPage (printf "/%s/%s" $type $name) }}
<li>
<input type="radio" name="categories" id="{{$name}}">
<label for="{{$name}}">
<h4><a href="{{ .RelPermalink }}">{{ $name | humanize }} </a></h4>
<small> ({{ $count }} post{{if gt $count 1}}s{{end}})</small>
</label>
<ul>
{{ range $pages }}
<li hugo-nav="{{ .RelPermalink}}"><a
href="{{ .RelPermalink}}">{{ default (.File.ContentBaseName | humanize) .LinkTitle }}</a></li>
{{ end }}
</ul>
</li>
{{ end }}
{{ end }}
</ol>
<input type="radio" name="categories" id="cross" checked>
</article>
{{ end }}