change to hugo-blog-awesome theme

This commit is contained in:
Colmaris 2025-03-21 15:51:55 +01:00
parent 113e3650f1
commit 15b6142a8e
131 changed files with 5895 additions and 124 deletions

View file

@ -0,0 +1,12 @@
{{ define "title"}}
404 | NOT FOUND
{{ end }}
{{ define "main"}}
<div class="wrapper">
<main class="main-404" aria-label="Content">
<h1>{{ T "errors.404" }}</h1>
<p>{{ T "errors.404_description" }}</p>
</main>
</div>
{{ end }}

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{- partial "head.html" . -}}
<body data-theme = "{{ .Site.Params.defaultColor }}" class="notransition">
{{- partial "scriptsBodyStart.html" . -}}
{{- partial "header.html" . -}}
{{- block "main" . }}{{- end }}
{{- partial "footer.html" . -}}
{{- partial "scriptsBodyEnd.html" . -}}
</body>
</html>

View file

@ -0,0 +1,23 @@
{{- define "main" -}}
<div class="wrapper list-page">
<header class="header">
<h1 class="header-title center">{{ .Title }}</h1>
</header>
<main class="page-content" aria-label="Content">
{{ range .Pages.GroupByDate "2006" }}
{{ $year := .Key }}
<h2 class="post-year">{{ $year }}</h2>
{{/* create a list of posts for each month, with month as heading */}}
{{ range .Pages }}
{{ partial "postCard" . }}
{{ end }} {{/* end range .Pages */}}
{{ end }} {{/* end range .Pages.GroupByDate "2006" */}}
</main>
</div>
{{- end -}}

View file

@ -0,0 +1,46 @@
<!-- Taken from Hugo default RSS template: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml -->
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- $rssFeedDescription := .Site.Params.rssFeedDescription | default "summary" -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<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>
<language>{{ site.Language.LanguageCode }}</language>{{ 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 $pages }}
<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>
{{ if eq $rssFeedDescription "summary"}}
<description>{{ .Summary | html }}</description>
{{ else if (eq $rssFeedDescription "full")}}
<description>{{ .Content | html }}</description>
{{ else }} {{ errorf "Error in RSS feed generation %q" .Path }}
{{ end }}
</item>
{{ end }}
</channel>
</rss>

View file

@ -0,0 +1,23 @@
{{ define "main" }}
<div class="wrapper post">
<main class="page-content" aria-label="Content">
<article>
<header class="header">
<h1 class="header-title">{{ .Title }}</h1>
{{ $configDateFormat := .Site.Params.dateFormat | default ":date_medium" }}
{{ with .Date }}
{{ $ISO_time := dateFormat "2006-01-02T15:04:05-07:00" . }}
<div class="post-meta">
<time datetime="{{ $ISO_time }}" itemprop="datePublished"> {{ . | time.Format $configDateFormat }} </time>
</div>
{{ end }}
</header>
{{ partial "toc.html" .}}
<div class="page-content">
{{ .Content }}
</div>
</article>
{{- partial "comments.html" . -}}
</main>
</div>
{{ end }}

View file

@ -0,0 +1,41 @@
<!DOCTYPE html>
{{- $defaultColor := .Site.Params.defaultColor | default "auto" -}}
{{/* allow website developer to enforce default dark mode */}}
{{- if eq $defaultColor "dark" -}}
<html lang="{{ .Site.LanguageCode }}" class="dark">
{{- else if eq $defaultColor "light" -}}
<html lang="{{ .Site.LanguageCode }}" class="light">
{{- else -}}
<html lang="{{ .Site.LanguageCode }}">
{{- end -}}
{{- partial "head.html" . -}}
<body data-theme="{{ $defaultColor }}" class="notransition">
{{- partial "scriptsBodyStart.html" . -}}
{{- partial "header.html" . -}}
<div class="wrapper">
{{ partial "bio" . }}
<main aria-label="Content">
<h3 class="posts-item-note" aria-label="Recent Posts">{{ T "home.recent_posts" }}</h3>
{{/* Show last 5 posts in reverse date order */}}
{{ $pagesToShow := where .Site.RegularPages "Type" "in" site.Params.mainSections }}
{{ $posts := $pagesToShow.ByDate.Reverse }}
{{ range first 5 $posts }}
{{ partial "postCard" . }}
{{ end }}
{{ if gt (len $posts) 5 }}
<p>
{{ range $firstSection := (where .Site.Sections "Section" "in" (first 1 (.Site.Params.mainSections))) }}
<a href="{{ $firstSection.Permalink }}">{{ T "home.see_all_posts" }}</a>
{{ end }}
</p>
{{ end }}
</main>
</div>
{{- partial "footer.html" . -}}
{{- partial "scriptsBodyEnd.html" . -}}
</body>
</html>

View file

@ -0,0 +1,25 @@
{{ $avatar_img := .Site.Params.author.avatar }}
{{ $avatar_img_alt := .Site.Params.author.name }}
{{ $image := resources.Get $avatar_img }}
<div class="author">
{{ with $image }}
{{ if eq .MediaType.SubType "svg" }}
<svg width="25em" height="25em" xmlns="http://www.w3.org/2000/svg">
<image width="25em" height="25em" href="{{ $image.RelPermalink }}" />
</svg>
{{ else }}
{{ $image1x := $image.Fill "70x70 center webp" }}
{{ $image2x := $image.Fill "140x140 center webp" }}
{{ $image3x := $image.Fill "210x210 center webp" }}
<img
class="author-avatar"
src="{{ $image1x.RelPermalink }}"
srcset="{{ $image2x.RelPermalink }} 2x, {{ $image3x.RelPermalink }} 3x"
alt="{{ $avatar_img_alt }}"
width="{{ $image1x.Width }}"
height="{{ $image1x.Height }}" />
{{ end }}
{{ end }}
<h2 class="author-name">{{ .Site.Params.author.intro }}</h2>
<p class="author-bio">{{ .Site.Params.author.description }}</p>
</div>

View file

@ -0,0 +1,8 @@
{{
$ctx := merge (.Site.Params.browserconfig | default dict)
(dict
"TileColor" (.Site.Params.browserconfig.TileColor | default "#2d89ef" )
)
}}
<meta name="msapplication-config" content="{{ (resources.Get "icons/browserconfig.xml" | resources.ExecuteAsTemplate "browserconfig.xml" $ctx).RelPermalink }}">
<meta name="msapplication-TileColor" content="{{ $ctx.TileColor }}">

View file

@ -0,0 +1,4 @@
{{- if .Site.Config.Services.Disqus.Shortname -}}
<hr style="margin-top: 40px; margin-bottom: 40px;" />
{{ template "_internal/disqus.html" . }}
{{- end -}}

View file

@ -0,0 +1,18 @@
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//goaccess.colmaris.fr/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<!-- Mastodon-->
<a rel="me" href="https://gts.colmaris.fr/@colmaris"></a>

View file

@ -0,0 +1,18 @@
<footer class="footer">
<span class="footer_item"> </span>
&nbsp;
<div class="footer_social-icons">
{{- partial "socialIcons.html" site.Params.socialIcons -}}
</div>
<small class="footer_copyright">
© {{ now.Format "2006" }} {{ .Site.Params.author.name }}.
{{ T "footer.disclaimer" | safeHTML }}
</small>
</footer>
{{- if .Site.Params.goToTop -}}
<a href="#" title="{{ T "footer.go_to_top" }}" id="totop">
{{ partial "svgs/arrowUp.svg" (dict "height" 48 "width" 48) . }}
</a>
{{- end -}}

View file

@ -0,0 +1,54 @@
<head>
{{- partial "meta/main.html" . }}
{{- hugo.Generator }}
{{/* Open Graph tags */}}
{{ template "_internal/opengraph.html" . }}
{{/* Twitter Card tags */}}
{{ template "_internal/twitter_cards.html" . }}
{{/* Canonical link, RSS */}}
<link rel="canonical" href="{{ .Permalink }}">
{{- with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}">
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}">
{{- end }}
{{- /* Styles */ -}}
{{- $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "style.scss" . | toCSS (dict "targetPath" "style.css") | minify | fingerprint }}
<link href="{{ $style.RelPermalink }}" rel="stylesheet">
{{- $code_syntax_highlight_css := resources.Get "code-highlight.css" | minify | fingerprint }}
<link href="{{ $code_syntax_highlight_css.RelPermalink }}" rel="stylesheet">
{{/* Favicons */}}
<link rel="apple-touch-icon" sizes="180x180" href="{{ (resources.Get "icons/apple-touch-icon.png").RelPermalink }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ (resources.Get "icons/favicon-32x32.png").RelPermalink }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ (resources.Get "icons/favicon-16x16.png").RelPermalink }}">
<link rel="mask-icon" href="{{ (resources.Get "icons/safari-pinned-tab.svg").RelPermalink }}">
<link rel="shortcut icon" href="{{ (resources.Get "icons/favicon.ico" | resources.Copy "favicon.ico").RelPermalink }}">
{{- partial "webmanifest.html" . -}}
{{- partial "browserconfig.html" . -}}
<meta name="theme-color" content="{{ .Site.Params.webmanifest.theme_color | default "#434648" }}">
{{/* SVG favicon for the modern web */}}
<link rel="icon" type="image/svg+xml" href="{{ (resources.Get "icons/favicon.svg").RelPermalink }}">
{{/* Katex support (enabled on specific pages). See 'helpers/katex.html' for more info. */}}
{{- if or .Params.math .Site.Params.math }}{{ partial "helpers/katex.html" . -}}{{- end -}}
{{/* Google analytics script. See hugo.toml to enable/disable this. */}}
{{- if hugo.IsProduction | or (eq site.Params.env "production") }}
{{ template "_internal/google_analytics.html" . }}
{{- end -}}
{{/* Extend head with user supplied partial */}}
{{ if templates.Exists "partials/custom-head.html" }}
{{ partial "custom-head.html" . }}
{{ end }}
</head>

View file

@ -0,0 +1,72 @@
<div class="navbar" role="navigation">
<nav class="menu" aria-label="Main Navigation">
<a href="{{ .Site.Home.Permalink }}" class="logo">
{{ partial "svgs/home.svg" (dict "height" 25 "width" 25) . }}
</a>
<input type="checkbox" id="menu-trigger" class="menu-trigger" />
<label for="menu-trigger">
<span class="menu-icon">
{{ partial "svgs/menu.svg" (dict "height" 25 "width" 25) . }}
</span>
</label>
<div class="trigger">
<ul class="trigger-container">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<li>
<a class="menu-link {{ if or ($currentPage.IsMenuCurrent "main" .)
($currentPage.HasMenuCurrent "main" .) }}active{{ end }}" href="{{ .URL }}">
{{ .Name }}
</a>
{{ if .HasChildren }}
<ul>
{{ range .Children }}
<li>
<a class="menu-link {{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"
href="{{ .URL }}">
{{ .Name }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
<li class="menu-separator">
<span>|</span>
</li>
<!-- Language List -->
{{ if .IsTranslated }}
<li>
<select aria-label="Select Language" class="lang-list" id="select-language" onchange="location = this.value;">
{{ $siteLanguages := .Site.Languages}}
{{ $pageLang := .Page.Lang}}
{{ range .Page.AllTranslations }}
{{ $translation := .}}
{{ range $siteLanguages }}
{{ if eq $translation.Lang .Lang }}
{{ $selected := false }}
{{ if eq $pageLang .Lang}}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageCode | upper }}
</option>
{{ else }}
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageCode | upper }}</option>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</select>
</li>
<li class="menu-separator">
<span>|</span>
</li>
{{ end }}
</ul>
<a id="mode" href="#">
{{ partial "svgs/sun.svg" (dict "height" 21 "width" 21 "class" "mode-sunny" "title" "LIGHT") . }}
{{ partial "svgs/sun.svg" (dict "height" 21 "width" 21 "class" "mode-moon" "title" "DARK") . }}
</a>
</div>
</nav>
</div>

View file

@ -0,0 +1,16 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css"
integrity="sha512-fHwaWebuwA7NSF5Qg/af4UeDx9XqUpYpOGgubo3yWu+b2IQR4UeQwbb42Ti7gVAjNtVoI/I9TEoYeu9omwcC6g==" crossorigin="anonymous" crossorigin="anonymous" />
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js"
integrity="sha512-LQNxIMR5rXv7o+b1l8+N1EZMfhG7iFZ9HhnbJkTp4zjNr5Wvst75AqUeFDxeRUa7l5vEDyUiAip//r+EFLLCyA=="
crossorigin="anonymous"></script>
<!-- To automatically render math in text elements, include the auto-render extension: -->
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js"
integrity="sha512-iWiuBS5nt6r60fCz26Nd0Zqe0nbk1ZTIQbl3Kv7kYsX+yKMUFHzjaH2+AnM6vp2Xs+gNmaBAVWJjSmuPw76Efg==" crossorigin="anonymous" onload="renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false}
]
});"></script>

View file

@ -0,0 +1,2 @@
{{ partial "meta/standard.html" . }}
{{ partial "meta/post.html" . }}

View file

@ -0,0 +1,62 @@
{{/* These meta tags are rendered only in the posts section (i.e. in single/list page) */}}
{{ if eq .Section "posts" }}
{{ $ISO_date := dateFormat "2006-01-02T15:04:05Z0700" .Date | safeHTML }}
<!-- Pagination meta tags for list pages only -->
{{ if ne .Page.Kind "page" }}
{{ $paginator := .Paginate (where .Pages "Section" "blog") }}
{{ 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 }}
{{end }}
<meta property="og:type" content="article" />
<meta property="og:article:published_time" content={{ $ISO_date | safeHTML }} />
<meta property="article:published_time" content={{ $ISO_date | safeHTML }} />
<meta property="og:url" content="{{ .Permalink }}" />
{{ with.Site.Params.author }}
<meta property="og:article:author" content="{{ .name }}" />
<meta property="article:author" content="{{ .name }}" />
<meta name="author" content="{{ .name }}" />
{{ with.fediverseAccount }}
<meta name="fediverse:creator" content="{{ . }}" />{{/* ref https://blog.joinmastodon.org/2024/07/highlighting-journalism-on-mastodon/ */}}
{{ end }}
{{ end }}
{{ with.Params.category }}
<meta name="news_keywords" content="{{ index . 0 }}" />
<meta property="article:section" content="{{ index . 0 }}" />
{{ end }}
<script defer type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Article",
"headline": {{ .Title }},
"author": {
"@type": "Person",
"name": "{{ .Site.Params.github }}"
},
"datePublished": "{{ dateFormat "2006-01-02" .Date }}",
"description": {{ .Description }},
"wordCount": {{ .WordCount }},
"mainEntityOfPage": "True",
"dateModified": "{{ dateFormat "2006-01-02" .Lastmod }}",
"image": {
"@type": "imageObject",
"url": "{{ with .Params.image }}{{ . | absURL }}{{ end }}"
},
"publisher": {
"@type": "Organization",
"name": "{{ .Site.Title }}"
}
}
</script>
{{ end }}

View file

@ -0,0 +1,50 @@
<meta charset="utf-8">
<meta http-equiv="content-type" content="text/html">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title itemprop="name">{{ .Title }} | {{ .Site.Title }}</title>
<meta property="og:title" content="{{ .Title }} | {{ .Site.Title }}" />
<meta name="twitter:title" content="{{ .Title }} | {{ .Site.Title }}" />
<meta itemprop="name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta name="application-name" content="{{ .Title }} | {{ .Site.Title }}" />
<meta property="og:site_name" content="{{ .Site.Params.sitename }}" />
{{/* Define empty variable description */}}
{{- $description := "" -}}
{{/* If description is defined in front matter, use it */}}
{{- if .Params.description -}}
{{- $description = trim .Params.description "\n" -}}
{{/* If description is not defined in front matter, use site description */}}
{{- else if .Site.Params.description -}}
{{- $description = trim .Site.Params.description "\n" -}}
{{- end -}}
<meta name="description" content="{{ $description }}">
<meta itemprop="description" content="{{ $description }}" />
<meta property="og:description" content="{{ $description }}" />
<meta name="twitter:description" content="{{ $description }}" />
<meta property="og:locale" content="{{ .Site.LanguageCode }}" />
<meta name="language" content="{{ .Site.LanguageCode }}" />
{{ range .AllTranslations }}
<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}" title="{{ .Language.LanguageName }}" />
{{ end }}
{{/* Define empty variable image */}}
{{- $image := "" -}}
{{/* If image is defined in front matter, use it */}}
{{- if .Params.image -}}
{{- $image = .Params.image -}}
{{/* If image is not defined in front matter, use site ogimage */}}
{{- else if .Site.Params.ogimage -}}
{{- $image = .Site.Params.ogimage -}}
{{- end -}}
{{- if $image -}}
<meta itemprop="image" content="{{ $image | absURL }}" />
<meta property="og:image" content="{{ $image | absURL }}" />
<meta name="twitter:image" content="{{ $image | absURL }}" />
<meta name="twitter:image:src" content="{{ $image | absURL }}" />
{{- end -}}

View file

@ -0,0 +1,17 @@
<article class="post-item">
<h4 class="post-item-title">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h4>
{{/* format date string to create an ISO 8601 string */}}
{{ $ISO_date := "2006-01-02T15:04:05Z0700" }}
{{ $configDateFormat := .Site.Params.dateFormat | default "2 Jan 2006" }}
{{ if .Params.isStarred }}
<div class="post-item-right">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="currentColor" class="icon-star"><path d="M16 23.027L24.24 28l-2.187-9.373 7.28-6.307-9.587-.827-3.747-8.827-3.747 8.827-9.587.827 7.267 6.307L7.759 28l8.24-4.973z"></path></svg>
</div>
{{ end }}
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}">
{{ time.Format $configDateFormat .Date }}
{{/* OLD FORMAT: .Date.Format $configDateFormat */}}
</time>
</article>

View file

@ -0,0 +1,33 @@
{{ $main := slice (resources.Get "js/main.js") }}
{{ if .Site.Params.goToTop }}
{{ $main = $main | append (resources.Get "js/goToTop.js") }}
{{ end }}
{{ $custom := slice }}
{{ range $script := .Site.Params.additionalScripts }}
{{ $script_res := resources.Get $script }}
{{ if not $script_res}}
{{ erroridf "additional-script-loading-error" "Failed to load script \"%s\"" $script }}
{{ else }}
{{ $custom = $custom | append (resources.Get .) }}
{{ end }}
{{ end }}
{{ if hugo.IsProduction }}
{{ $main = $main | resources.Concat "js/main.js" | resources.Minify | resources.Fingerprint }}
<script src="{{ $main.Permalink }}" integrity="{{ $main.Data.Integrity }}"></script>
{{ if gt (len $custom) 0 }}
{{ $custom = $custom | resources.Concat "js/custom.js" | resources.Minify | resources.Fingerprint }}
<script src="{{ $custom.Permalink }}" integrity="{{ $custom.Data.Integrity }}"></script>
{{ end }}
{{ else }}
{{ $main = $main | resources.Concat "js/main.js" }}
<script async src="{{ $main.Permalink }}" ></script>
{{ if gt (len $custom) 0 }}
{{ $custom = $custom | resources.Concat "js/custom.js" }}
<script async src="{{ $custom.Permalink }}" ></script>
{{ end }}
{{ end }}

View file

@ -0,0 +1,7 @@
{{ if hugo.IsProduction }}
{{ $theme_script := resources.Get "js/theme.js" | minify | fingerprint }}
<script src="{{ $theme_script.RelPermalink }}" integrity="{{ $theme_script.Data.Integrity }}"></script>
{{ else }}
{{ $theme_script := resources.Get "js/theme.js" }}
<script src="{{ $theme_script.RelPermalink }}"></script>
{{ end}}

View file

@ -0,0 +1,6 @@
{{- range . }}
<a href="{{ trim .url " " }}" target="_blank" rel="noopener noreferrer me"
title="{{ (.title | default .name) | title }}">
{{ partial "svgs/svgs.html" . }}
</a>
{{- end }}

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="{{ .width }}" height="{{ .height }}" fill="currentColor" stroke="currentColor" viewBox="0 96 960 960">
<path d="M283 704.739 234.261 656 480 410.261 725.739 656 677 704.739l-197-197-197 197Z"/>
</svg>

After

Width:  |  Height:  |  Size: 252 B

View file

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="{{ .width }}" height="{{ .height }}"
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" class="feather feather-home">
<title>{{ T "home.home" }}</title>
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline>
</svg>

After

Width:  |  Height:  |  Size: 393 B

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="{{ .width }}" height="{{ .height }}" stroke="currentColor" fill="none" viewBox="0 0 14 14"><title>Menu</title><path stroke-linecap="round" stroke-linejoin="round" d="M10.595 7L3.40726 7"></path><path stroke-linecap="round" stroke-linejoin="round" d="M10.5096 3.51488L3.49301 3.51488"></path><path stroke-linecap="round" stroke-linejoin="round" d="M10.5096 10.4851H3.49301"></path><path stroke-linecap="round" stroke-linejoin="round" d="M0.5 12.5V1.5C0.5 0.947715 0.947715 0.5 1.5 0.5H12.5C13.0523 0.5 13.5 0.947715 13.5 1.5V12.5C13.5 13.0523 13.0523 13.5 12.5 13.5H1.5C0.947715 13.5 0.5 13.0523 0.5 12.5Z"></path></svg>

After

Width:  |  Height:  |  Size: 666 B

View file

@ -0,0 +1,2 @@
<svg xmlns="http://www.w3.org/2000/svg" class="{{ .class }}" width="{{ .width }}" height="{{ .height }}" viewBox="0 0 14 14" stroke-width="1">
<title>{{ .title }}</title><g><circle cx="7" cy="7" r="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"></circle><line x1="7" y1="0.5" x2="7" y2="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="2.4" y1="2.4" x2="3.82" y2="3.82" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="0.5" y1="7" x2="2.5" y2="7" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="2.4" y1="11.6" x2="3.82" y2="10.18" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="7" y1="13.5" x2="7" y2="11.5" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="11.6" y1="11.6" x2="10.18" y2="10.18" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="13.5" y1="7" x2="11.5" y2="7" fill="none" stroke-linecap="round" stroke-linejoin="round"></line><line x1="11.6" y1="2.4" x2="10.18" y2="3.82" fill="none" stroke-linecap="round" stroke-linejoin="round"></line></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,18 @@
{{- $toc := .Site.Params.toc -}}
{{- if isset .Params "toc" -}}
{{ $toc = .Params.toc }}
{{- end -}}
{{- if $toc -}}
{{ $tocOpen := "" }}
{{ if or .Site.Params.tocOpen .Params.tocOpen }}
{{ if not (eq .Params.tocOpen false) }}
{{ $tocOpen = "open" }}
{{ end }}
{{ end }}
<details class="toc" {{ $tocOpen }}>
<summary><b>{{ T "single.table_of_contents" }}</b></summary>
{{ .TableOfContents }}
</details>
{{- end -}}

View file

@ -0,0 +1,26 @@
{{ define "partials/hugo-blog-awesome/manifest-background-color" }}
{{ $bg := ""}}
{{ if .Site.Params.webmanifest.background_color }}
{{ $bg = .Site.Params.webmanifest.background_color }}
{{ else if eq .Site.Params.defaultColor "dark" }}
{{ $bg = "#131418" }}
{{ else }}
{{ $bg = "#ffffff"}}
{{ end}}
{{ return $bg }}
{{ end }}
{{ $background_color := partial "hugo-blog-awesome/manifest-background-color" . }}
{{
$ctx := merge (.Site.Params.webmanifest | default dict)
(dict
"name" (.Site.Params.webmanifest.name | default .Site.Params.sitename | default .Site.Title)
"short_name" (.Site.Params.webmanifest.short_name | default .Site.Params.sitename | default .Site.Title)
"start_url" (.Site.Params.webmanifest.start_url | default .Site.Home.Permalink)
"theme_color" (.Site.Params.webmanifest.theme_color | default "#434648")
"background_color" $background_color
"display" (.Site.Params.webmanifest.display | default "standalone")
)
}}
<link rel="manifest" href="{{ (resources.Get "icons/site.webmanifest" | resources.ExecuteAsTemplate "site.webmanifest" $ctx).Permalink }}">