mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-21 12:40:39 +00:00
chore: enable auto-formatting for template files (#133)
This commit is contained in:
parent
392708d390
commit
b4721c0ce7
@ -1,10 +1,9 @@
|
||||
*.html
|
||||
.drone.yml
|
||||
search*.js
|
||||
_normalize.css
|
||||
list.json.json
|
||||
.lighthouseci/
|
||||
themes/
|
||||
static/js/
|
||||
src/favicon/
|
||||
/.lighthouseci/
|
||||
/themes/
|
||||
/static/js/
|
||||
/src/favicon/
|
||||
LICENSE
|
||||
|
@ -14,11 +14,15 @@ Include shortcode can include files of different types. By specifying a language
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
## Usage
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```tpl
|
||||
{{</* include file="relative/path/from/hugo/root" language="go" markdown=[false|true] */>}}
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Attributes:
|
||||
### Attributes
|
||||
|
||||
| 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.
|
||||
{{< /hint >}}
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```tpl
|
||||
{{</* include file="/static/_includes/example.md.part" */>}}
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- 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.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```tpl
|
||||
{{</* include file="config.yaml" language="yaml" options="linenos=table,hl_lines=5-6,linenostart=100" */>}}
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
**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.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```tpl
|
||||
{{</* include file="/static/_includes/example.html.part" */>}}
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
{{< include file="/static/_includes/example.html.part" type="html" >}}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}" class="color-toggle-hidden">
|
||||
|
||||
<head>
|
||||
{{ partial "head/meta" . }}
|
||||
<title>Lost? Don't worry</title>
|
||||
@ -12,9 +11,11 @@
|
||||
<body>
|
||||
{{ partial "svg-sprites" . }}
|
||||
|
||||
|
||||
<div class="wrapper">
|
||||
{{ partial "site-header" . }}
|
||||
|
||||
|
||||
<main class="gblog-error flex-even">
|
||||
<div class="flex align-center justify-center">
|
||||
<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__code">Error 404</div>
|
||||
<div class="gblog-error__line gblog-error__help">
|
||||
Seems like what you are looking for can't be found. Don't worry we can
|
||||
bring you back to the <a class="gblog-error__link" href="{{ .Site.BaseURL }}">homepage</a>.
|
||||
Seems like what you are looking for can't be found. Don't worry we can bring you back
|
||||
to the <a class="gblog-error__link" href="{{ .Site.BaseURL }}">homepage</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,5 +36,4 @@
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,5 +1,7 @@
|
||||
{{- $showAnchor := (and (default true .Page.Params.GeekblogAnchor) (default true .Page.Site.Params.GeekblogAnchor)) -}}
|
||||
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
{{- if $showAnchor -}}
|
||||
<div class="gblog-post__anchorwrap">
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||
@ -16,3 +18,4 @@
|
||||
</h{{ .Level }}>
|
||||
</div>
|
||||
{{- end -}}
|
||||
<!-- prettier-ignore-end -->
|
||||
|
@ -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 */ -}}
|
||||
|
@ -1,3 +1,8 @@
|
||||
{{- $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 */ -}}
|
||||
|
@ -1,9 +1,15 @@
|
||||
<!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>
|
||||
{{ 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/rel-me" . }}
|
||||
@ -16,9 +22,13 @@
|
||||
<body>
|
||||
{{ 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" . }}
|
||||
|
||||
|
||||
<main class="gblog-page container">
|
||||
{{ template "main" . }}
|
||||
</main>
|
||||
|
@ -16,7 +16,12 @@
|
||||
</section>
|
||||
<div class="gblog-post__readmore">
|
||||
{{ 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 }}
|
||||
</div>
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<div class="gblog-post__feature">
|
||||
<picture>
|
||||
{{ $featured := .Fill (printf "910x280 %s" (default "Smart" .Params.anchor)) }}
|
||||
<source srcset="{{ $featured.Permalink }}">
|
||||
<img src="{{ $featured.Permalink }}" alt="{{ default $.Title .Params.description }}" >
|
||||
<source srcset="{{ $featured.Permalink }}" />
|
||||
<img src="{{ $featured.Permalink }}" alt="{{ default $.Title .Params.description }}" />
|
||||
</picture>
|
||||
{{ with $source.Params.credits }}
|
||||
<span>Credits: {{ . | $.Page.RenderString | safeHTML }}</span>
|
||||
@ -15,6 +15,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
<h1>{{ partial "title" . }}</h1>
|
||||
</header>
|
||||
|
||||
@ -24,6 +25,7 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
|
||||
<section class="gblog-markdown">
|
||||
{{ partial "content" . }}
|
||||
</section>
|
||||
|
@ -1,4 +1,19 @@
|
||||
<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 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 }}">
|
||||
<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
|
||||
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 }}"
|
||||
/>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
{{ $description := default (default .Site.Title .Site.Params.description) (default .Summary .Description) }}
|
||||
{{ $keywords := default .Site.Params.Keywords .Keywords }}
|
||||
{{ $authors := default (slice .Site.Params.GeekblogAuthor) .Params.authors }}
|
||||
|
||||
{{ with $description }}
|
||||
<meta name="description" content="{{ . }}">
|
||||
<meta name="description" content="{{ . }}" />
|
||||
{{ end }}
|
||||
{{ with $keywords }}
|
||||
<meta name="keywords" content="{{ delimit . "," }}">
|
||||
<meta name="keywords" content="{{ delimit . "," }}" />
|
||||
{{ end }}
|
||||
{{ with $authors }}
|
||||
{{ $list := slice }}
|
||||
@ -21,6 +21,6 @@
|
||||
{{ end }}
|
||||
|
||||
{{ with $list }}
|
||||
<meta name="author" content="{{ delimit . "," }}">
|
||||
<meta name="author" content="{{ delimit . "," }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -1,27 +1,77 @@
|
||||
<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 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"
|
||||
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 rel="stylesheet" href="{{ index (index .Site.Data.assets "main.scss") "src" | relURL }}" media="all">
|
||||
<link
|
||||
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 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 "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 rel="stylesheet" href="{{ index (index .Site.Data.assets "print.scss") "src" | relURL }}" media="print">
|
||||
<link
|
||||
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 rel="stylesheet" href="{{ index (index .Site.Data.assets "custom.css") "src" | relURL }}" media="all">
|
||||
<link
|
||||
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" }}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (default false $.Site.Params.GeekblogOverwriteHTMLBase) }}
|
||||
<base href="{{ .Site.BaseURL }}">
|
||||
<base href="{{ .Site.BaseURL }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ printf "<!-- %s -->" "Made with Geekblog theme https://github.com/thegeeklab/hugo-geekblog" | safeHTML }}
|
||||
|
@ -1,6 +1,5 @@
|
||||
{{ if .IsHome -}}
|
||||
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index (default slice .Site.Params.images) 0) | absURL }}
|
||||
<script type="application/ld+json">
|
||||
{{ $thumbnail := default (default "brand.svg" .Site.Params.logo) (index (default slice .Site.Params.images) 0) | absURL }}<script type="application/ld+json">
|
||||
{
|
||||
"@context": "http://schema.org",
|
||||
"@type": "WebSite",
|
||||
|
@ -1,6 +1,7 @@
|
||||
{{ $current := .current }}
|
||||
{{ template "menu-file" dict "sect" .source "current" $current "site" $current.Site "target" .target }}
|
||||
|
||||
|
||||
<!-- template -->
|
||||
{{ define "menu-file" }}
|
||||
{{ $current := .current }}
|
||||
@ -15,17 +16,33 @@
|
||||
|
||||
{{ if eq $target "footer" }}
|
||||
<span class="gblog-footer__item gblog-footer__item--row">
|
||||
{{ if $icon }}<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>{{ end }}
|
||||
<a href="{{ if .external }}{{ .ref }}{{ else }}{{ relref $current .ref }}{{ end }}"
|
||||
class="gblog-footer__link">
|
||||
{{ if $icon }}
|
||||
<svg class="icon {{ .icon }}"><use xlink:href="#{{ .icon }}"></use></svg>
|
||||
{{ end }}
|
||||
<a
|
||||
href="{{ if .external }}
|
||||
{{ .ref }}
|
||||
{{ else }}
|
||||
{{ relref $current .ref }}
|
||||
{{ end }}"
|
||||
class="gblog-footer__link"
|
||||
>
|
||||
{{ .name }}
|
||||
</a>
|
||||
</span>
|
||||
{{ else if eq $target "header" }}
|
||||
<li>
|
||||
<a href="{{ if .external }}{{ .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 }}
|
||||
<a
|
||||
href="{{ if .external }}
|
||||
{{ .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 }}
|
||||
</a>
|
||||
</li>
|
||||
|
@ -60,12 +60,19 @@
|
||||
|
||||
{{ define "post-tag" }}
|
||||
<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>
|
||||
{{ end }}
|
||||
|
||||
{{ define "post-author" }}
|
||||
<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>
|
||||
{{ end }}
|
||||
|
@ -1,5 +1,16 @@
|
||||
<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:url" content="{{ .Permalink }}" />
|
||||
|
||||
@ -12,34 +23,53 @@
|
||||
{{- with $featured -}}
|
||||
<meta property="og:image" content="{{ $featured.Permalink }}" />
|
||||
{{- 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 -}}
|
||||
|
||||
{{- if .IsPage }}
|
||||
{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}}
|
||||
<meta property="article:section" content="{{ .Section }}" />
|
||||
{{ with .PublishDate }}<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 }}
|
||||
{{ with .PublishDate }}
|
||||
<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 -}}
|
||||
|
||||
{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }}
|
||||
{{- with .Params.locale }}<meta property="og:locale" 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 }}" />
|
||||
{{ end }}{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{- /* If it is part of a series, link to related articles */}}
|
||||
{{- if .Site.Taxonomies.series }}
|
||||
{{- $permalink := .Permalink }}
|
||||
{{- $siteSeries := .Site.Taxonomies.series }}
|
||||
{{ with .Params.series }}{{- range $name := . }}
|
||||
{{ with .Params.series }}
|
||||
{{- range $name := . }}
|
||||
{{- $series := index $siteSeries ($name | urlize) }}
|
||||
{{- 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 }}
|
||||
|
||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
{{- with $.Params.images -}}
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="{{ index . 0 | absURL }}" />
|
||||
@ -19,7 +18,18 @@
|
||||
{{- 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 -}}"/>
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="{{ with .Description }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
{{ if .IsPage }}
|
||||
{{ .Summary }}
|
||||
{{ else }}
|
||||
{{ with .Site.Params.description }}{{ . }}{{ end }}
|
||||
{{ end }}
|
||||
{{ end -}}"
|
||||
/>
|
||||
{{ with .Site.Social.twitter -}}
|
||||
<meta name="twitter:site" content="@{{ . }}" />
|
||||
{{ end -}}
|
||||
|
@ -1,15 +1,20 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
|
||||
|
||||
<nav class="gblog-paging flex flex-even align-center" role="navigation">
|
||||
<div class="gblog-paging__item gblog-paging__item--prev">
|
||||
{{ 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 }}
|
||||
</div>
|
||||
<div class="gblog-paging__state">Page {{ $pag.PageNumber }} of {{ $pag.TotalPages }}</div>
|
||||
<div class="gblog-paging__item gblog-paging__item--next">
|
||||
{{ 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 }}
|
||||
</div>
|
||||
</nav>
|
||||
|
@ -5,7 +5,7 @@
|
||||
{{ with (.Site.GetPage "home").OutputFormats.Get "atom" }}
|
||||
<span class="gblog-footer__item gblog-footer__item--row">
|
||||
<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>
|
||||
{{ end }}
|
||||
{{ if .Site.Data.menu.extra.footer }}
|
||||
@ -38,7 +38,8 @@
|
||||
{{ with .Site.Params.GeekblogContentLicense }}
|
||||
<section class="flex flex-wrap align-center">
|
||||
<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>
|
||||
</section>
|
||||
{{ end }}
|
||||
@ -47,7 +48,10 @@
|
||||
<div class="flex flex-25 justify-end">
|
||||
<span class="gblog-footer__item text-right">
|
||||
<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>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -4,7 +4,11 @@
|
||||
<div class="gblog-header__col-2 flex align-center justify-center ">
|
||||
<a class="gblog-header__link" rel="me" href="{{ .Site.BaseURL }}">
|
||||
<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>
|
||||
{{ with .Site.Params.subtitle }}
|
||||
@ -31,7 +35,7 @@
|
||||
</div>
|
||||
</header>
|
||||
<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">
|
||||
<label for="menu-control" class="flex align-center justify-center">
|
||||
<svg class="icon gblog_menu"><use xlink:href="#gblog_menu"></use></svg>
|
||||
@ -45,7 +49,11 @@
|
||||
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
|
||||
{{ with $.Site.GetPage (printf "/tags/%s" $name) }}
|
||||
<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>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -13,6 +13,7 @@
|
||||
{{ $ref = relref $ . }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<span class="gblog-button gblog-button--{{ $size }}{{ with .Get "class" }}{{ . }}{{ end }}">
|
||||
<a {{ with $ref }}href="{{ . }}"{{ end }} class="gblog-button__link">
|
||||
{{ $.Inner }}
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
{{ $size := dict "tiny" $tiny "small" $small "medium" $medium "large" $large }}
|
||||
|
||||
|
||||
<div class="flex justify-center">
|
||||
<figure class="gblog-post__figure">
|
||||
<a class="gblog-markdown__link--raw" href="{{ .RelPermalink }}">
|
||||
@ -21,17 +22,20 @@
|
||||
{{ with $customSize }}
|
||||
srcset="{{ index $size $customSize }}"
|
||||
{{ else }}
|
||||
srcset="{{ $size.small }} 600w,
|
||||
{{ $size.medium }} 1200w"
|
||||
sizes="100vw"
|
||||
{{ end }} />
|
||||
srcset="{{ $size.small }} 600w, {{ $size.medium }} 1200w" sizes="100vw"
|
||||
{{ end }}
|
||||
/>
|
||||
<img
|
||||
{{ if $lazyLoad }}loading="lazy"{{ end }}
|
||||
src="{{ $size.large }}" alt="{{ $caption }}" />
|
||||
src="{{ $size.large }}"
|
||||
alt="{{ $caption }}"
|
||||
/>
|
||||
</picture>
|
||||
</a>
|
||||
{{ with $caption }}
|
||||
<figcaption>{{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }}</figcaption>
|
||||
<figcaption>
|
||||
{{ . }}{{ with $source.Params.credits }}({{ . | $.Page.RenderString }}){{ end }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
||||
</div>
|
||||
|
@ -4,6 +4,7 @@
|
||||
{{ $language := .Get "language" }}
|
||||
{{ $options :=.Get "options" }}
|
||||
|
||||
|
||||
<div class="gblog-include">
|
||||
{{- if (.Get "language") -}}
|
||||
{{- highlight ($file | readFile) $language (default "linenos=table" $options) -}}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{{ if not (.Page.Scratch.Get "mermaid") }}
|
||||
<!-- Include mermaid only first time -->
|
||||
<script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script>
|
||||
<!-- Include mermaid only first time --><script defer src="{{ index (index .Site.Data.assets "mermaid.js") "src" | relURL }}"></script>
|
||||
{{ .Page.Scratch.Set "mermaid" true }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<pre class="gblog-mermaid mermaid{{ with .Get "class" }}{{ . }}{{ end }}">
|
||||
{{- .Inner -}}
|
||||
</pre>
|
||||
|
@ -2,10 +2,16 @@
|
||||
{{ $id := .Get 0 }}
|
||||
{{ $group := printf "tabs-%s" $id }}
|
||||
|
||||
|
||||
<div class="gblog-tabs">
|
||||
{{ range $index, $tab := .Scratch.Get $group }}
|
||||
<input type="radio" class="gblog-tabs__control hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}"
|
||||
{{ if not $index }}checked="checked" {{ end }} />
|
||||
<input
|
||||
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">
|
||||
{{ $tab.Name }}
|
||||
</label>
|
||||
|
@ -1,5 +1,8 @@
|
||||
{{ $tocLevels := default (default 6 .Site.Params.GeekblogToC) .Page.Params.GeekblogToC }}
|
||||
|
||||
{{ 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 }}
|
||||
|
Loading…
Reference in New Issue
Block a user