chore: enable auto-formatting for template files (#133)

This commit is contained in:
Robert Kaussow 2021-12-30 15:55:55 +01:00 committed by GitHub
parent 392708d390
commit b4721c0ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 586 additions and 388 deletions

View File

@ -1,10 +1,9 @@
*.html
.drone.yml .drone.yml
search*.js search*.js
_normalize.css _normalize.css
list.json.json list.json.json
.lighthouseci/ /.lighthouseci/
themes/ /themes/
static/js/ /static/js/
src/favicon/ /src/favicon/
LICENSE LICENSE

View File

@ -14,11 +14,15 @@ Include shortcode can include files of different types. By specifying a language
{{< toc >}} {{< toc >}}
## Usage
<!-- prettier-ignore-start -->
```tpl ```tpl
{{</* include file="relative/path/from/hugo/root" language="go" markdown=[false|true] */>}} {{</* include file="relative/path/from/hugo/root" language="go" markdown=[false|true] */>}}
``` ```
<!-- prettier-ignore-end -->
Attributes: ### Attributes
| Name | Usage | default | | Name | Usage | default |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------- | | -------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------- |
@ -38,9 +42,11 @@ If no other options are specified, files will be rendered as Markdown using the
If you include markdown files that should not get a menu entry, place them outside the content folder or exclude them otherwise. If you include markdown files that should not get a menu entry, place them outside the content folder or exclude them otherwise.
{{< /hint >}} {{< /hint >}}
<!-- prettier-ignore-start -->
```tpl ```tpl
{{</* include file="/static/_includes/example.md.part" */>}} {{</* include file="/static/_includes/example.md.part" */>}}
``` ```
<!-- prettier-ignore-end -->
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- spellchecker-disable --> <!-- spellchecker-disable -->
@ -52,9 +58,11 @@ If you include markdown files that should not get a menu entry, place them outsi
This method can be used to include source code files and keep them automatically up to date. This method can be used to include source code files and keep them automatically up to date.
<!-- prettier-ignore-start -->
```tpl ```tpl
{{</* include file="config.yaml" language="yaml" options="linenos=table,hl_lines=5-6,linenostart=100" */>}} {{</* include file="config.yaml" language="yaml" options="linenos=table,hl_lines=5-6,linenostart=100" */>}}
``` ```
<!-- prettier-ignore-end -->
**Code Include:** **Code Include:**
@ -70,9 +78,11 @@ This method can be used to include source code files and keep them automatically
HTML content will be filtered by the `safeHTML` filter and added to the rendered page output. HTML content will be filtered by the `safeHTML` filter and added to the rendered page output.
<!-- prettier-ignore-start -->
```tpl ```tpl
{{</* include file="/static/_includes/example.html.part" */>}} {{</* include file="/static/_includes/example.html.part" */>}}
``` ```
<!-- prettier-ignore-end -->
{{< include file="/static/_includes/example.html.part" type="html" >}} {{< include file="/static/_includes/example.html.part" type="html" >}}

View File

@ -1,6 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}" class="color-toggle-hidden"> <html lang="{{ .Site.Language.Lang }}" class="color-toggle-hidden">
<head> <head>
{{ partial "head/meta" . }} {{ partial "head/meta" . }}
<title>Lost? Don't worry</title> <title>Lost? Don't worry</title>
@ -12,9 +11,11 @@
<body> <body>
{{ partial "svg-sprites" . }} {{ partial "svg-sprites" . }}
<div class="wrapper"> <div class="wrapper">
{{ partial "site-header" . }} {{ partial "site-header" . }}
<main class="gblog-error flex-even"> <main class="gblog-error flex-even">
<div class="flex align-center justify-center"> <div class="flex align-center justify-center">
<div class="gblog-error__icon"> <div class="gblog-error__icon">
@ -24,8 +25,8 @@
<div class="gblog-error__line gblog-error__title">Lost?</div> <div class="gblog-error__line gblog-error__title">Lost?</div>
<div class="gblog-error__line gblog-error__code">Error 404</div> <div class="gblog-error__line gblog-error__code">Error 404</div>
<div class="gblog-error__line gblog-error__help"> <div class="gblog-error__line gblog-error__help">
Seems like what you are looking for can't be found. Don't worry we can Seems like what you are looking for can't be found. Don't worry we can bring you back
bring you back to the <a class="gblog-error__link" href="{{ .Site.BaseURL }}">homepage</a>. to the <a class="gblog-error__link" href="{{ .Site.BaseURL }}">homepage</a>.
</div> </div>
</div> </div>
</div> </div>
@ -35,5 +36,4 @@
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,5 +1,7 @@
{{- $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Page.Site.Params.GeekblogAnchor)) -}} {{- $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Page.Site.Params.GeekblogAnchor)) -}}
<!-- prettier-ignore-start -->
{{- if $showAnchor -}} {{- if $showAnchor -}}
<div class="gblog-post__anchorwrap"> <div class="gblog-post__anchorwrap">
<h{{ .Level }} id="{{ .Anchor | safeURL }}"> <h{{ .Level }} id="{{ .Anchor | safeURL }}">
@ -16,3 +18,4 @@
</h{{ .Level }}> </h{{ .Level }}>
</div> </div>
{{- end -}} {{- end -}}
<!-- prettier-ignore-end -->

View File

@ -1,2 +1,6 @@
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} /> <img
src="{{ .Destination | safeURL }}"
alt="{{ .Text }}"
{{ with .Title }}title="{{ . }}"{{ end }}
/>
{{- /* Drop trailing newlines */ -}} {{- /* Drop trailing newlines */ -}}

View File

@ -1,3 +1,8 @@
{{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}} {{- $raw := or (hasPrefix .Text "<img") (hasPrefix .Text "<figure") -}}
<a class="gblog-markdown__link{{ if $raw }}--raw{{ end }}" href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a> <a
class="gblog-markdown__link{{ if $raw }}--raw{{ end }}"
href="{{ .Destination | safeURL }}"
{{ with .Title }}title="{{ . }}"{{ end }}
>{{ .Text | safeHTML }}</a
>
{{- /* Drop trailing newlines */ -}} {{- /* Drop trailing newlines */ -}}

View File

@ -1,9 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html itemscope itemtype="http://schema.org/WebPage" lang="{{ .Site.Language.Lang }}" class="color-toggle-hidden"> <html
itemscope
itemtype="http://schema.org/WebPage"
lang="{{ .Site.Language.Lang }}"
class="color-toggle-hidden"
>
<head> <head>
{{ partial "head/meta" . }} {{ partial "head/meta" . }}
<title>{{ if not (eq .Kind "home") }}{{ partial "title" . }} | {{ end }}{{ .Site.Title }}</title> <title>
{{ if not (eq .Kind "home") }}{{ partial "title" . }} |{{ end }}{{ .Site.Title }}
</title>
{{ partial "head/favicons" . }} {{ partial "head/favicons" . }}
{{ partial "head/rel-me" . }} {{ partial "head/rel-me" . }}
@ -16,9 +22,13 @@
<body> <body>
{{ partial "svg-sprites" . }} {{ partial "svg-sprites" . }}
<div class="wrapper {{ if default false .Site.Params.GeekblogDarkModeDim }}dark-mode-dim{{ end }}">
<div
class="wrapper {{ if default false .Site.Params.GeekblogDarkModeDim }}dark-mode-dim{{ end }}"
>
{{ partial "site-header" . }} {{ partial "site-header" . }}
<main class="gblog-page container"> <main class="gblog-page container">
{{ template "main" . }} {{ template "main" . }}
</main> </main>

View File

@ -16,7 +16,12 @@
</section> </section>
<div class="gblog-post__readmore"> <div class="gblog-post__readmore">
{{ if .Truncated }} {{ if .Truncated }}
<a class="flex-inline align-center fake-link" title="Read full post" href="{{ .RelPermalink }}">Read full post<i class="gblog-icon">gblog_arrow_right</i></a> <a
class="flex-inline align-center fake-link"
title="Read full post"
href="{{ .RelPermalink }}"
>Read full post<i class="gblog-icon">gblog_arrow_right</i></a
>
{{ end }} {{ end }}
</div> </div>

View File

@ -6,8 +6,8 @@
<div class="gblog-post__feature"> <div class="gblog-post__feature">
<picture> <picture>
{{ $featured := .Fill (printf "910x280 %s" (default "Smart" .Params.anchor)) }} {{ $featured := .Fill (printf "910x280 %s" (default "Smart" .Params.anchor)) }}
<source srcset="{{ $featured.Permalink }}"> <source srcset="{{ $featured.Permalink }}" />
<img src="{{ $featured.Permalink }}" alt="{{ default $.Title .Params.description }}" > <img src="{{ $featured.Permalink }}" alt="{{ default $.Title .Params.description }}" />
</picture> </picture>
{{ with $source.Params.credits }} {{ with $source.Params.credits }}
<span>Credits: {{ . | $.Page.RenderString | safeHTML }}</span> <span>Credits: {{ . | $.Page.RenderString | safeHTML }}</span>
@ -15,6 +15,7 @@
</div> </div>
{{ end }} {{ end }}
<h1>{{ partial "title" . }}</h1> <h1>{{ partial "title" . }}</h1>
</header> </header>
@ -24,6 +25,7 @@
</div> </div>
{{ end }} {{ end }}
<section class="gblog-markdown"> <section class="gblog-markdown">
{{ partial "content" . }} {{ partial "content" . }}
</section> </section>

View File

@ -1,4 +1,19 @@
<link rel="icon" type="image/svg+xml" href="{{ "favicon/favicon.svg" | relURL }}"> <link rel="icon" type="image/svg+xml" href="{{ "favicon/favicon.svg" | relURL }}" />
<link rel="icon" type="image/png" sizes="48x48" href="{{ "favicon/favicon-32x32.png" | relURL }}"> <link
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon/favicon-32x32.png" | relURL }}"> rel="icon"
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon/favicon-16x16.png" | relURL }}"> type="image/png"
sizes="48x48"
href="{{ "favicon/favicon-32x32.png" | relURL }}"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="{{ "favicon/favicon-32x32.png" | relURL }}"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="{{ "favicon/favicon-16x16.png" | relURL }}"
/>

View File

@ -1,15 +1,15 @@
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }} {{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
{{ $keywords := default .Site.Params.Keywords .Keywords }} {{ $keywords := default .Site.Params.Keywords .Keywords }}
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }} {{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
{{ with $description }} {{ with $description }}
<meta name="description" content="{{ . }}"> <meta name="description" content="{{ . }}" />
{{ end }} {{ end }}
{{ with $keywords }} {{ with $keywords }}
<meta name="keywords" content="{{ delimit . "," }}"> <meta name="keywords" content="{{ delimit . "," }}" />
{{ end }} {{ end }}
{{ with $authors }} {{ with $authors }}
{{ $list := slice }} {{ $list := slice }}
@ -21,6 +21,6 @@
{{ end }} {{ end }}
{{ with $list }} {{ with $list }}
<meta name="author" content="{{ delimit . "," }}"> <meta name="author" content="{{ delimit . "," }}" />
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@ -1,27 +1,77 @@
<script src="{{ index (index .Site.Data.assets "bundle.js") "src" | relURL }}"></script> <script src="{{ index (index .Site.Data.assets "bundle.js") "src" | relURL }}"></script>
<link rel="preload" as="font" href="{{ "fonts/Metropolis.woff2" | relURL }}" type="font/woff2" crossorigin="anonymous"> <link
<link rel="preload" as="font" href="{{ "fonts/LiberationSans.woff2" | relURL }}" type="font/woff2" crossorigin="anonymous"> rel="preload"
<link rel="preload" as="font" href="{{ "fonts/GeekblogIcons.woff2" | relURL }}" type="font/woff2" crossorigin="anonymous"> as="font"
href="{{ "fonts/Metropolis.woff2" | relURL }}"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
as="font"
href="{{ "fonts/LiberationSans.woff2" | relURL }}"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
as="font"
href="{{ "fonts/GeekblogIcons.woff2" | relURL }}"
type="font/woff2"
crossorigin="anonymous"
/>
<link rel="preload" href="{{ index (index .Site.Data.assets "main.scss") "src" | relURL }}" as="style"> <link
<link rel="stylesheet" href="{{ index (index .Site.Data.assets "main.scss") "src" | relURL }}" media="all"> rel="preload"
href="{{ index (index .Site.Data.assets "main.scss") "src" | relURL }}"
as="style"
/>
<link
rel="stylesheet"
href="{{ index (index .Site.Data.assets "main.scss") "src" | relURL }}"
media="all"
/>
<link rel="preload" href="{{ index (index .Site.Data.assets "mobile.scss") "src" | relURL }}" as="style"> <link
<link rel="stylesheet" href="{{ index (index .Site.Data.assets "mobile.scss") "src" | relURL }}" media="screen and (max-width: 45rem)"> rel="preload"
href="{{ index (index .Site.Data.assets "mobile.scss") "src" | relURL }}"
as="style"
/>
<link
rel="stylesheet"
href="{{ index (index .Site.Data.assets "mobile.scss") "src" | relURL }}"
media="screen and (max-width: 45rem)"
/>
<link rel="preload" href="{{ index (index .Site.Data.assets "print.scss") "src" | relURL }}" as="style"> <link
<link rel="stylesheet" href="{{ index (index .Site.Data.assets "print.scss") "src" | relURL }}" media="print"> rel="preload"
href="{{ index (index .Site.Data.assets "print.scss") "src" | relURL }}"
as="style"
/>
<link
rel="stylesheet"
href="{{ index (index .Site.Data.assets "print.scss") "src" | relURL }}"
media="print"
/>
<link rel="preload" href="{{ index (index .Site.Data.assets "custom.css") "src" | relURL }}" as="style"> <link
<link rel="stylesheet" href="{{ index (index .Site.Data.assets "custom.css") "src" | relURL }}" media="all"> rel="preload"
href="{{ index (index .Site.Data.assets "custom.css") "src" | relURL }}"
as="style"
/>
<link
rel="stylesheet"
href="{{ index (index .Site.Data.assets "custom.css") "src" | relURL }}"
media="all"
/>
{{ with .OutputFormats.Get "atom" }} {{ with .OutputFormats.Get "atom" }}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end }} {{ end }}
{{ if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }} {{ if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }}
<base href="{{ .Site.BaseURL }}"> <base href="{{ .Site.BaseURL }}" />
{{ end }} {{ end }}
{{ printf "<!-- %s -->" "Made with Geekblog theme https://github.com/thegeeklab/hugo-geekblog" | safeHTML }} {{ printf "<!-- %s -->" "Made with Geekblog theme https://github.com/thegeeklab/hugo-geekblog" | safeHTML }}

View File

@ -1,6 +1,5 @@
{{ if .IsHome -}} {{ if .IsHome -}}
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index (default slice .Site.Params.images) 0) | absURL }} {{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index (default slice .Site.Params.images) 0) | absURL }}<script type="application/ld+json">
<script type="application/ld+json">
{ {
"@context": "http://schema.org", "@context": "http://schema.org",
"@type": "WebSite", "@type": "WebSite",

View File

@ -1,6 +1,7 @@
{{ $current := .current }} {{ $current := .current }}
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site "target" .target }} {{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site "target" .target }}
<!-- template --> <!-- template -->
{{ define "menu-file" }} {{ define "menu-file" }}
{{ $current := .current }} {{ $current := .current }}
@ -15,17 +16,33 @@
{{ if eq $target "footer" }} {{ if eq $target "footer" }}
<span class="gblog-footer__item gblog-footer__item--row"> <span class="gblog-footer__item gblog-footer__item--row">
{{ if $icon }}<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>{{ end }} {{ if $icon }}
<a href="{{ if .external }}{{ .ref }}{{ else }}{{ relref $current .ref }}{{ end }}" <svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
class="gblog-footer__link"> {{ end }}
<a
href="{{ if .external }}
{{ .ref }}
{{ else }}
{{ relref $current .ref }}
{{ end }}"
class="gblog-footer__link"
>
{{ .name }} {{ .name }}
</a> </a>
</span> </span>
{{ else if eq $target "header" }} {{ else if eq $target "header" }}
<li> <li>
<a href="{{ if .external }}{{ .ref }}{{ else }}{{ relref $current .ref }}{{ end }}" <a
class="gblog-nav__entry {{ if $isCurrent }}is-active{{ end }}"> href="{{ if .external }}
{{ if $icon }}<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>{{ end }} {{ .ref }}
{{ else }}
{{ relref $current .ref }}
{{ end }}"
class="gblog-nav__entry {{ if $isCurrent }}is-active{{ end }}"
>
{{ if $icon }}
<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
{{ end }}
{{ .name }} {{ .name }}
</a> </a>
</li> </li>

View File

@ -60,12 +60,19 @@
{{ define "post-tag" }} {{ define "post-tag" }}
<span class="gblog-post__tag gblog-button"> <span class="gblog-post__tag gblog-button">
<a class="gblog-button__link" href="{{ .page.RelPermalink }}" title="All posts tagged with '{{ .name }}'">{{ .name }}</a> <a
class="gblog-button__link"
href="{{ .page.RelPermalink }}"
title="All posts tagged with '{{ .name }}'"
>{{ .name }}</a
>
</span> </span>
{{ end }} {{ end }}
{{ define "post-author" }} {{ define "post-author" }}
<span class="gblog-post__tag gblog-button"> <span class="gblog-post__tag gblog-button">
<a class="gblog-button__link" href="{{ .page.RelPermalink }}" title="All posts of this author">{{ .name }}</a> <a class="gblog-button__link" href="{{ .page.RelPermalink }}" title="All posts of this author"
>{{ .name }}</a
>
</span> </span>
{{ end }} {{ end }}

View File

@ -1,5 +1,16 @@
<meta property="og:title" content="{{ .Title }}" /> <meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> <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:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />
<meta property="og:url" content="{{ .Permalink }}" /> <meta property="og:url" content="{{ .Permalink }}" />
@ -12,34 +23,53 @@
{{- with $featured -}} {{- with $featured -}}
<meta property="og:image" content="{{ $featured.Permalink }}" /> <meta property="og:image" content="{{ $featured.Permalink }}" />
{{- else -}} {{- else -}}
{{- with $.Site.Params.images }}<meta property="og:image" content="{{ index . 0 | absURL }}"/>{{ end -}} {{- with $.Site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />
{{ end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- if .IsPage }} {{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} {{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
<meta property="article:section" content="{{ .Section }}" /> <meta property="article:section" content="{{ .Section }}" />
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }} {{ with .PublishDate }}
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }} <meta
property="article:published_time"
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}
/>
{{ end }}
{{ with .Lastmod }}
<meta
property="article:modified_time"
{{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }}
/>
{{ end }}
{{- end -}} {{- end -}}
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }} {{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }} {{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }}
{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }} {{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }}
{{- with .Params.videos }}{{- range . }} {{- with .Params.videos }}
{{- range . }}
<meta property="og:video" content="{{ . | absURL }}" /> <meta property="og:video" content="{{ . | absURL }}" />
{{ end }}{{ end }} {{ end }}
{{ end }}
{{- /* If it is part of a series, link to related articles */}} {{- /* If it is part of a series, link to related articles */}}
{{- if .Site.Taxonomies.series }} {{- if .Site.Taxonomies.series }}
{{- $permalink := .Permalink }} {{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }} {{- $siteSeries := .Site.Taxonomies.series }}
{{ with .Params.series }}{{- range $name := . }} {{ with .Params.series }}
{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }} {{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }} {{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} {{- if ne $page.Permalink $permalink }}
<meta property="og:see_also" content="{{ $page.Permalink }}" />
{{ end }}
{{- end }} {{- end }}
{{ end }}{{ end }} {{ end }}
{{ end }}
{{- end }} {{- end }}
{{- /* Facebook Page Admin ID for Domain Insights */}} {{- /* Facebook Page Admin ID for Domain Insights */}}

View File

@ -1,4 +1,3 @@
{{- with $.Params.images -}} {{- with $.Params.images -}}
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="{{ index . 0 | absURL }}" /> <meta name="twitter:image" content="{{ index . 0 | absURL }}" />
@ -19,7 +18,18 @@
{{- end -}} {{- end -}}
{{- end }} {{- end }}
<meta name="twitter:title" content="{{ .Title }}" /> <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 -}}"/> <meta
name="twitter:description"
content="{{ with .Description }}
{{ . }}
{{ else }}
{{ if .IsPage }}
{{ .Summary }}
{{ else }}
{{ with .Site.Params.description }}{{ . }}{{ end }}
{{ end }}
{{ end -}}"
/>
{{ with .Site.Social.twitter -}} {{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}" /> <meta name="twitter:site" content="@{{ . }}" />
{{ end -}} {{ end -}}

View File

@ -1,15 +1,20 @@
{{ $pag := $.Paginator }} {{ $pag := $.Paginator }}
<nav class="gblog-paging flex flex-even align-center" role="navigation"> <nav class="gblog-paging flex flex-even align-center" role="navigation">
<div class="gblog-paging__item gblog-paging__item--prev"> <div class="gblog-paging__item gblog-paging__item--prev">
{{ if $pag.HasPrev }} {{ if $pag.HasPrev }}
<a class="flex-inline align-center fake-link no-wrap" href="{{ $pag.Prev.URL }}"><i class="gblog-icon">gblog_keyboard_arrow_left</i>PREV</a> <a class="flex-inline align-center fake-link no-wrap" href="{{ $pag.Prev.URL }}"
><i class="gblog-icon">gblog_keyboard_arrow_left</i>PREV</a
>
{{ end }} {{ end }}
</div> </div>
<div class="gblog-paging__state">Page {{ $pag.PageNumber }} of {{ $pag.TotalPages }}</div> <div class="gblog-paging__state">Page {{ $pag.PageNumber }} of {{ $pag.TotalPages }}</div>
<div class="gblog-paging__item gblog-paging__item--next"> <div class="gblog-paging__item gblog-paging__item--next">
{{ if $pag.HasNext }} {{ if $pag.HasNext }}
<a class="flex-inline align-center fake-link no-wrap" href="{{ $pag.Next.URL }}">NEXT<i class="gblog-icon">gblog_keyboard_arrow_right</i></a> <a class="flex-inline align-center fake-link no-wrap" href="{{ $pag.Next.URL }}"
>NEXT<i class="gblog-icon">gblog_keyboard_arrow_right</i></a
>
{{ end }} {{ end }}
</div> </div>
</nav> </nav>

View File

@ -5,7 +5,7 @@
{{ with (.Site.GetPage "home").OutputFormats.Get "atom" }} {{ with (.Site.GetPage "home").OutputFormats.Get "atom" }}
<span class="gblog-footer__item gblog-footer__item--row"> <span class="gblog-footer__item gblog-footer__item--row">
<svg class="icon gblog_rss_feed"><use xlink:href="#gblog_rss_feed"></use></svg> <svg class="icon gblog_rss_feed"><use xlink:href="#gblog_rss_feed"></use></svg>
<a href='{{ .Permalink | relURL }}' class="gblog-footer__link">Atom Feed</a> <a href="{{ .Permalink | relURL }}" class="gblog-footer__link">Atom Feed</a>
</span> </span>
{{ end }} {{ end }}
{{ if .Site.Data.menu.extra.footer }} {{ if .Site.Data.menu.extra.footer }}
@ -38,7 +38,8 @@
{{ with .Site.Params.GeekblogContentLicense }} {{ with .Site.Params.GeekblogContentLicense }}
<section class="flex flex-wrap align-center"> <section class="flex flex-wrap align-center">
<span class="gblog-footer__item"> <span class="gblog-footer__item">
Content licensed under <a href="{{ .link }}" class="gblog-footer__link no-wrap">{{ .name }}</a> Content licensed under
<a href="{{ .link }}" class="gblog-footer__link no-wrap">{{ .name }}</a>
</span> </span>
</section> </section>
{{ end }} {{ end }}
@ -47,7 +48,10 @@
<div class="flex flex-25 justify-end"> <div class="flex flex-25 justify-end">
<span class="gblog-footer__item text-right"> <span class="gblog-footer__item text-right">
<a class="gblog-footer__link fake-link" href="#" aria-label="Back to top"> <a class="gblog-footer__link fake-link" href="#" aria-label="Back to top">
<svg class="icon gblog_keyborad_arrow_up"><use xlink:href="#gblog_keyborad_arrow_up"></use></svg> <span class="hidden-mobile">Back to top</span> <svg class="icon gblog_keyborad_arrow_up">
<use xlink:href="#gblog_keyborad_arrow_up"></use>
</svg>
<span class="hidden-mobile">Back to top</span>
</a> </a>
</span> </span>
</div> </div>

View File

@ -4,7 +4,11 @@
<div class="gblog-header__col-2 flex align-center justify-center "> <div class="gblog-header__col-2 flex align-center justify-center ">
<a class="gblog-header__link" rel="me" href="{{ .Site.BaseURL }}"> <a class="gblog-header__link" rel="me" href="{{ .Site.BaseURL }}">
<span class="gblog-brand flex align-center justify-center"> <span class="gblog-brand flex align-center justify-center">
<img class="gblog-brand__img" src="{{ (default "brand.svg" .Site.Params.logo) | relURL }}" alt=""> <img
class="gblog-brand__img"
src="{{ (default "brand.svg" .Site.Params.logo) | relURL }}"
alt=""
/>
<span class="gblog-brand__title">{{ .Site.Title }}</span> <span class="gblog-brand__title">{{ .Site.Title }}</span>
</span> </span>
{{ with .Site.Params.subtitle }} {{ with .Site.Params.subtitle }}
@ -31,7 +35,7 @@
</div> </div>
</header> </header>
<nav class="gblog-nav"> <nav class="gblog-nav">
<input type="checkbox" id="menu-control" class="hidden"> <input type="checkbox" id="menu-control" class="hidden" />
<div class="gblog-nav__control"> <div class="gblog-nav__control">
<label for="menu-control" class="flex align-center justify-center"> <label for="menu-control" class="flex align-center justify-center">
<svg class="icon gblog_menu"><use xlink:href="#gblog_menu"></use></svg> <svg class="icon gblog_menu"><use xlink:href="#gblog_menu"></use></svg>
@ -45,7 +49,11 @@
{{ range $name, $taxonomy := .Site.Taxonomies.tags }} {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }} {{ with $.Site.GetPage (printf "/tags/%s" $name) }}
<li> <li>
<a class="gblog-nav__entry {{ if eq $currentPage .RelPermalink }} is-active {{ end }}" href="{{ .RelPermalink }}">{{ .Title }}</a> <a
class="gblog-nav__entry {{ if eq $currentPage .RelPermalink }}is-active{{ end }}"
href="{{ .RelPermalink }}"
>{{ .Title }}</a
>
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}

View File

@ -13,6 +13,7 @@
{{ $ref = relref $ . }} {{ $ref = relref $ . }}
{{ end }} {{ end }}
<span class="gblog-button gblog-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}"> <span class="gblog-button gblog-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}">
<a {{ with $ref }}href="{{ . }}"{{ end }} class="gblog-button__link"> <a {{ with $ref }}href="{{ . }}"{{ end }} class="gblog-button__link">
{{ $.Inner }} {{ $.Inner }}

View File

@ -13,6 +13,7 @@
{{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }} {{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }}
<div class="flex justify-center"> <div class="flex justify-center">
<figure class="gblog-post__figure"> <figure class="gblog-post__figure">
<a class="gblog-markdown__link--raw" href="{{ .RelPermalink }}"> <a class="gblog-markdown__link--raw" href="{{ .RelPermalink }}">
@ -21,17 +22,20 @@
{{ with $customSize }} {{ with $customSize }}
srcset="{{ index $size $customSize }}" srcset="{{ index $size $customSize }}"
{{ else }} {{ else }}
srcset="{{ $size.small }} 600w, srcset="{{ $size.small }} 600w, {{ $size.medium }} 1200w" sizes="100vw"
{{ $size.medium }} 1200w" {{ end }}
sizes="100vw" />
{{ end }} />
<img <img
{{ if $lazyLoad }}loading="lazy"{{ end }} {{ if $lazyLoad }}loading="lazy"{{ end }}
src="{{ $size.large }}" alt="{{ $caption }}" /> src="{{ $size.large }}"
alt="{{ $caption }}"
/>
</picture> </picture>
</a> </a>
{{ with $caption }} {{ with $caption }}
<figcaption>{{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }}</figcaption> <figcaption>
{{ . }}{{ with $source.Params.credits }}({{ . | $.Page.RenderString }}){{ end }}
</figcaption>
{{ end }} {{ end }}
</figure> </figure>
</div> </div>

View File

@ -4,6 +4,7 @@
{{ $language := .Get "language" }} {{ $language := .Get "language" }}
{{ $options :=.Get "options" }} {{ $options :=.Get "options" }}
<div class="gblog-include"> <div class="gblog-include">
{{- if (.Get "language") -}} {{- if (.Get "language") -}}
{{- highlight ($file | readFile) $language (default "linenos=table" $options) -}} {{- highlight ($file | readFile) $language (default "linenos=table" $options) -}}

View File

@ -1,9 +1,9 @@
{{ if not (.Page.Scratch.Get "mermaid") }} {{ if not (.Page.Scratch.Get "mermaid") }}
<!-- Include mermaid only first time --> <!-- Include mermaid only first time --><script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script>
<script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script>
{{ .Page.Scratch.Set "mermaid" true }} {{ .Page.Scratch.Set "mermaid" true }}
{{ end }} {{ end }}
<pre class="gblog-mermaid mermaid{{ with .Get "class" }}{{ . }}{{ end }}"> <pre class="gblog-mermaid mermaid{{ with .Get "class" }}{{ . }}{{ end }}">
{{- .Inner -}} {{- .Inner -}}
</pre> </pre>

View File

@ -2,10 +2,16 @@
{{ $id := .Get 0 }} {{ $id := .Get 0 }}
{{ $group := printf "tabs-%s" $id }} {{ $group := printf "tabs-%s" $id }}
<div class="gblog-tabs"> <div class="gblog-tabs">
{{ range $index, $tab := .Scratch.Get $group }} {{ range $index, $tab := .Scratch.Get $group }}
<input type="radio" class="gblog-tabs__control hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" <input
{{ if not $index }}checked="checked" {{ end }} /> type="radio"
class="gblog-tabs__control hidden"
name="{{ $group }}"
id="{{ printf "%s-%d" $group $index }}"
{{ if not $index }}checked="checked"{{ end }}
/>
<label for="{{ printf "%s-%d" $group $index }}" class="gblog-tabs__label"> <label for="{{ printf "%s-%d" $group $index }}" class="gblog-tabs__label">
{{ $tab.Name }} {{ $tab.Name }}
</label> </label>

View File

@ -1,5 +1,8 @@
{{ $tocLevels := default (default 6 .Site.Params.GeekblogToC) .Page.Params.GeekblogToC }} {{ $tocLevels := default (default 6 .Site.Params.GeekblogToC) .Page.Params.GeekblogToC }}
{{ if and $tocLevels .Page.TableOfContents }} {{ if and $tocLevels .Page.TableOfContents }}
<div class="gblog-toc gblog-toc__level--{{$tocLevels}}">{{ .Page.TableOfContents }}<hr></div> <div class="gblog-toc gblog-toc__level--{{ $tocLevels }}">
{{ .Page.TableOfContents }}
<hr />
</div>
{{ end }} {{ end }}