diff options
author | tdro <tdro@noreply.example.com> | 2022-05-03 04:25:49 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-05-03 04:25:49 -0400 |
commit | e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6 (patch) | |
tree | 3667043819ab91065019dfe3b4ff83ad625c2b49 /themes/default/layouts/_default | |
download | canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.tar.gz canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.tar.bz2 canory-e92dc018e28ba8d44f1c6cbc9fb0b779dec271e6.zip |
config.yaml: Commission
Diffstat (limited to 'themes/default/layouts/_default')
24 files changed, 971 insertions, 0 deletions
diff --git a/themes/default/layouts/_default/_markup/render-codeblock-goat.html b/themes/default/layouts/_default/_markup/render-codeblock-goat.html new file mode 100644 index 0000000..e83d7de --- /dev/null +++ b/themes/default/layouts/_default/_markup/render-codeblock-goat.html @@ -0,0 +1,19 @@ +{{ $width := .Attributes.width }} +{{ $height := .Attributes.height }} +{{ $caption := default "GoAT Diagram" .Attributes.caption }} + +<diagram-container> + {{ with diagrams.Goat .Inner }} + <svg + xmlns="http://www.w3.org/2000/svg" + {{ if or $width $height }} + {{ with $width }}width="{{ . }}"{{ end }} + {{ with $height }}height="{{ . }}"{{ end }} + {{ else }} + viewBox="0 0 {{ .Width }} {{ .Height }}" + {{ end }}> + {{ .Inner }} + </svg> + {{ end }} + <figcaption>{{ $caption | markdownify }}</figcaption> +</diagram-container> diff --git a/themes/default/layouts/_default/_markup/render-codeblock.html b/themes/default/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..9dba950 --- /dev/null +++ b/themes/default/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,19 @@ +{{ $options := .Attributes.options | default "default=1" }} +{{ $caption := .Attributes.caption }} + +<code-block {{ if in (lower $options) "linenos" }}data-lines{{ end }}> + <header> + <language-label> + {{ .Type }} + </language-label> + <button> + {{ safeHTML (readFile "static/icons/feather/copy.svg") }} + <span>Copy</span> + </button> + </header> + {{ highlight .Inner .Type (print $options ",lineAnchors=" "code-" (truncate 7 "" (md5 .Inner))) }} +</code-block> + +{{ with $caption }} + <figcaption>{{ . | markdownify }}</figcaption> +{{ end }} diff --git a/themes/default/layouts/_default/_markup/render-heading.html b/themes/default/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..37eddb2 --- /dev/null +++ b/themes/default/layouts/_default/_markup/render-heading.html @@ -0,0 +1,6 @@ +<h{{ .Level }} id="{{ .Anchor | safeURL }}"> + <a + title="{{ .Text | safeHTML }}" + href="#{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} + </a> +</h{{ .Level }}> diff --git a/themes/default/layouts/_default/_markup/render-image.html b/themes/default/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..00f37cf --- /dev/null +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -0,0 +1,45 @@ +{{- $source := $.Destination | safeURL -}} +{{- $localPath := print "content/" $source -}} +{{- $remoteImage := resources.GetRemote $source -}} +{{- $width := "" -}} +{{- $height := "" -}} + +{{- with $remoteImage -}} + {{- with .Err -}} + {{- if fileExists $localPath -}} + {{- $localImage := imageConfig $localPath -}} + {{- with $localImage -}} + {{- $width = .Width -}} + {{- $height = .Height -}} + {{- end -}} + {{- else -}} + {{- $source = print "/images/404.png" -}} + {{- $localPath = print "static/" $source -}} + {{- $localImage := imageConfig $localPath -}} + {{- with $localImage -}} + {{- $width = .Width -}} + {{- $height = .Height -}} + {{- end -}} + {{- end -}} + {{- else -}} + {{- $width = .Width -}} + {{- $height = .Height -}} + {{ end }} +{{ end }} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} +<figure> + <a href="{{ $source }}"> + <img loading="lazy" + src="{{ $source }}" + alt="{{ $.Text | htmlUnescape }}" + title="{{ $.Text | htmlUnescape }}" + width="{{ $width }}" + height="{{ $height }}" + /> + </a> +{{ if $.Title }} + <figcaption>{{ $.Title | markdownify }}</figcaption> +{{ end -}} +</figure> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/_default/_markup/render-link.html b/themes/default/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000..9b1ffae --- /dev/null +++ b/themes/default/layouts/_default/_markup/render-link.html @@ -0,0 +1,21 @@ +{{- $link := .Destination -}} +{{ $isRemote := strings.HasPrefix $link "http" }} +{{- if not $isRemote -}} +{{ $url := urls.Parse .Destination }} +{{- if $url.Path -}} +{{ $fragment := "" }} +{{- with $url.Fragment }}{{ $fragment = printf "#%s" . }}{{ end -}} +{{- with .Page.GetPage $url.Path }}{{ $link = printf "%s%s" .RelPermalink $fragment }}{{ end }}{{ end -}} +{{- end -}} +<a + rel="noopener" + href="{{ $link | safeURL }}" + {{ with or .Title ($link | safeURL) -}} + title="{{ . }}" + {{ end }} + {{- if $isRemote -}} + target="_blank" + {{ end }}> + {{- .Text | safeHTML -}} +</a> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/_default/baseof.html b/themes/default/layouts/_default/baseof.html new file mode 100644 index 0000000..01b6ea0 --- /dev/null +++ b/themes/default/layouts/_default/baseof.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> + <head> + <title> + {{- block "title" . -}}{{- end -}} + {{- partial "site-title.html" . -}} + </title> + <meta name="description" content="{{- partial "site-description.html" . -}}"> + {{- partial "head.html" . -}} + {{- block "styles" . -}}{{- end -}} + </head> + <body> + <skip-link> + <a href="#main">Skip to main content</a> + </skip-link> + + <column-left> + {{- partial "navigator-left.html" . -}} + </column-left> + + <column-middle> + <main id="main"> + {{- block "middle" . -}}{{- end -}} + {{- partial "footer.html" . -}} + </main> + </column-middle> + + <column-right> + {{- block "right" . -}}{{- end -}} + </column-right> + </body> +</html> diff --git a/themes/default/layouts/_default/feeds.html b/themes/default/layouts/_default/feeds.html new file mode 100644 index 0000000..40442a1 --- /dev/null +++ b/themes/default/layouts/_default/feeds.html @@ -0,0 +1,151 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} + + tab-list a[href="/{{ $author }}/feeds/"] { + display: inherit; + font-weight: 700; + text-decoration: underline; + text-decoration-color: #014cc6; + text-decoration-color: var(--link); + } +</style> +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Feeds" + "Subtitle" (partial "count-media.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{- $author := index .Site.Data.authors ((or .Params.author .Site.Author.default.user) | default "default") -}} + + {{ $feeds := slice }} + + {{ range $key, $value := (seq 3) }} + {{ range first 5 $author.webring.rss -}} + + {{ with resources.GetRemote . }} + {{- with .Err -}} + {{- warnf "%s" . -}} + {{- end -}} + {{ end }} + + {{ with resources.GetRemote . | transform.Unmarshal -}} + + {{- $title := "Example Domain" -}} + {{- $link := "https://example.com/link" -}} + {{- $description := "No description found." -}} + {{- $content := "No content found." -}} + {{- $sourceTitle := "From Example Domain" -}} + {{- $sourceLink := "https://example.com/" -}} + {{- $sourceDescription := "The example domain." -}} + {{- $date := now.Format "January 2, 2006" -}} + {{- $dateTime := now.Format "2006-01-02T15:04:05Z" -}} + {{- $dateTitle := now.Format "Monday, January 2 2006 at 15:04:05 MST" -}} + + {{ with .channel -}} + + {{ if reflect.IsMap (index .link 0) -}} + {{ $sourceLink = index (index .link 0) "-href" | plainify | htmlUnescape -}} + {{ else -}} + {{ $sourceLink = index .link 0 | plainify | htmlUnescape -}} + {{ end -}} + + {{ $sourceDescription = .description | plainify | htmlUnescape -}} + + {{ $sourceTitle = .title | plainify | htmlUnescape -}} + + {{ range first $value .item -}} + {{ $description = delimit (.description | plainify | htmlUnescape | findRE "^([^.]+)") " " -}} + {{ $content = .description | plainify | htmlUnescape -}} + {{ $title = .title | plainify | htmlUnescape -}} + {{ $link = .link | plainify | htmlUnescape -}} + {{ $date = .pubDate | plainify | htmlUnescape | time.Format "January 2, 2006" -}} + {{ $dateTime = .pubDate | plainify | htmlUnescape | time.Format "2006-01-02T15:04:05Z" -}} + {{ $dateTitle = .pubDate | plainify | htmlUnescape | time.Format "Monday, January 2 2006 at 15:04:05 MST" -}} + {{ end -}} + + {{ else -}} + + {{ $sourceLink = index (index .link 0) "-href" | plainify | htmlUnescape -}} + {{ $sourceTitle = .title | plainify | htmlUnescape -}} + {{ $sourceDescription = .subtitle | plainify | htmlUnescape -}} + + {{ range first $value .entry -}} + + {{ if reflect.IsMap .title -}} + {{ $title = index .title "#text" | plainify | htmlUnescape -}} + {{ else -}} + {{ $title = .title | plainify | htmlUnescape -}} + {{ end -}} + + {{ $date = .updated | plainify | htmlUnescape | time.Format "January 2, 2006" -}} + {{ $dateTime = .updated | plainify | htmlUnescape | time.Format "2006-01-02T15:04:05Z" -}} + {{ $dateTitle = .updated | plainify | htmlUnescape | time.Format "Monday, January 2 2006 at 15:04:05 MST" -}} + + {{ $link = .id -}} + {{ with .content -}} + {{ $description = delimit ((index . "#text") | plainify | htmlUnescape | findRE "^([^.]+)") " " -}} + {{ $content = (index . "#text") | plainify | htmlUnescape -}} + {{ end -}} + {{ with .summary -}} + {{ $description = delimit ((index . "#text") | plainify | htmlUnescape | findRE "^([^.]+)") " " -}} + {{ $content = (index . "#text") | plainify | htmlUnescape -}} + {{ end -}} + {{ end -}} + + {{ end -}} + + {{ + $feeds = $feeds | append (dict + "FeedTitle" $title + "FeedLink" $link + "FeedDescription" $description + "FeedContent" $content + "FeedSourceTitle" $sourceTitle + "FeedSourceLink" $sourceLink + "FeedSourceDescription" $sourceDescription + "FeedDate" $date + "FeedDateTime" $dateTime + "FeedDateTitle" $dateTitle + ) + }} + + {{ end }} + {{ end }} + {{ end }} + + {{ range sort $feeds "FeedDateTime" "desc" }} + {{ partial "card-feed.html" (dict + "FeedName" ((delimit (first 3 (split .FeedSourceTitle " ")) " ") | replaceRE "[^a-zA-Z ]" "") + "FeedSourceDomain" (.FeedSourceLink | replaceRE "^https?://([^/]+).*" "$1") + "FeedSourceLink" .FeedSourceLink + "FeedContent" (or .FeedDescription .FeedTitle) + "FeedDate" .FeedDate + "FeedDateTime" .FeedDateTime + "FeedDateTitle" .FeedDateTime + "FeedWordCount" ((or .FeedDescription .FeedTitle) | countwords) + "FeedLink" .FeedLink + ) + }} + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/home.archive-messages.html b/themes/default/layouts/_default/home.archive-messages.html new file mode 100644 index 0000000..cd0ba49 --- /dev/null +++ b/themes/default/layouts/_default/home.archive-messages.html @@ -0,0 +1,50 @@ +{{ define "title" }}Message History — {{ end }} +{{ define "description" }}This page contains an archive of all messages — {{ end }} +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/archives/messages/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + +{{ partial "navigator-middle.html" + (dict + "Title" "History" + "Subtitle" (partial "count-total-messages.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) +}} + +<message-archive> + <item-list> + {{ $type := (partial "author-user.html" .) }} + {{ range (.Site.RegularPages.GroupByDate "2006") }} + {{ range (first 1 .Pages) }} + <h1>{{ .Date.Format "2006" }}</h1> + {{ end }} + <ul> + {{ range .Pages }} + {{ if (ne .Params.hidden true) }} + <li> + <a title="{{ partial "title.html" . }}" href="{{ .RelPermalink }}#{{ partial "card-id.html" . }}"> + <span>{{ .Date.Format "02 Jan" }}</span> + <span>{{ partial "title.html" . }}</span> + <span>@{{ partial "author-user.html" . }}</span> + </a> + </li> + {{ end }} + {{ end }} + </ul> + {{ end }} + </item-list> +</message-archive> +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right-default.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/home.archive-tags.html b/themes/default/layouts/_default/home.archive-tags.html new file mode 100644 index 0000000..cf26c40 --- /dev/null +++ b/themes/default/layouts/_default/home.archive-tags.html @@ -0,0 +1,47 @@ +{{ define "title" }}Tags Archive — {{ end }} +{{ define "description" }}This page contains an archive of all tags — {{ end }} +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/archives/tags/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + +{{ partial "navigator-middle.html" + (dict + "Title" "Records" + "Subtitle" (partial "count-tags.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) +}} + +<item-list> + {{ range $taxonomy := .Site.Taxonomies }} + {{ range $tag, $article := $taxonomy }} + <h1><a href="/tags/{{ $tag }}/">#{{ $tag }}</a></h1> + <ul> + {{ range $article.Pages }} + <li> + <a + title="{{ partial "title.html" . }}" + href="/tags/{{ $tag }}/#{{ partial "card-id.html" . }}"> + <span>{{ .Date.Format "02 Jan 2006" }}</span> + <span>{{ partial "title.html" . }}</span> + <span>@{{ partial "author-user.html" . }}</span> + </a> + </li> + {{ end }} + </ul> + {{ end }} + {{ end }} +</item-list> +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right-default.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/home.authors.html b/themes/default/layouts/_default/home.authors.html new file mode 100644 index 0000000..af2a7c6 --- /dev/null +++ b/themes/default/layouts/_default/home.authors.html @@ -0,0 +1,40 @@ +{{ define "title" }}Authors — {{ end }} +{{ define "description" }}This page contains a list of all authors — {{ end }} +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/authors/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Authors" + "Subtitle" (partial "count-authors.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ $authors := slice }} + + {{- range $index, $data := where .Site.RegularPages ".Params.hidden" "!=" "true" -}} + {{ $authors = $authors | append $data.Type }} + {{- end -}} + + {{ $authors = uniq $authors }} + + {{ range $author := $authors }} + {{ $data := index $.Site.Data.authors $author | default "default" }} + {{ partial "author-card.html" (dict "Data" $data) }} + {{ end }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right-default.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/home.browserconfig.xml b/themes/default/layouts/_default/home.browserconfig.xml new file mode 100644 index 0000000..67bc7a3 --- /dev/null +++ b/themes/default/layouts/_default/home.browserconfig.xml @@ -0,0 +1,13 @@ +{{- $icon := resources.Get .Site.Params.webmanifest.logo -}} + +{{- $mstile150 := $icon.Fit "150x150" -}} + +<?xml version="1.0" encoding="utf-8"?> +<browserconfig> + <msapplication> + <tile> + <square150x150logo src="{{ $mstile150.Permalink }}"/> + <TileColor>#da532c</TileColor> + </tile> + </msapplication> +</browserconfig> diff --git a/themes/default/layouts/_default/home.sources.html b/themes/default/layouts/_default/home.sources.html new file mode 100644 index 0000000..aa77e2a --- /dev/null +++ b/themes/default/layouts/_default/home.sources.html @@ -0,0 +1,120 @@ +{{ define "title" }}Sources — {{ end }} +{{ define "description" }}This page contains a list of all source files — {{ end }} +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/sources/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + + {{ $_default := readDir (print "/themes/default/layouts/_default") }} + {{ $_markup := readDir (print "/themes/default/layouts/_default/_markup") }} + {{ $partials := readDir (print "/themes/default/layouts/partials") }} + {{ $shortcodes := readDir (print "/themes/default/layouts/shortcodes") }} + + {{ $fileCount := add (len $shortcodes) (len $partials) }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Sources" + "Subtitle" (print $fileCount " " "Files") + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + <source-array> + <item-list> + + <h1>Defaults</h1> + <ul> + {{ range sort $_default ".ModTime" "desc" }} + {{ if not .IsDir }} + <li> + <a download title="{{ .Name }}" href="/source/files/_default/{{ .Name }}"> + <code> + <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> + <span>{{ .Name }}</span> + <span>{{ .Size -}}</span> + </code> + </a> + </li> + {{ end }} + {{ end }} + </ul> + + <h1>Markup</h1> + <ul> + {{ range sort $_markup ".ModTime" "desc" }} + {{ if not .IsDir }} + <li> + <a download title="{{ .Name }}" href="/source/files/_default/_markup/{{ .Name }}"> + <code> + <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> + <span>{{ .Name }}</span> + <span>{{ .Size -}}</span> + </code> + </a> + </li> + {{ end }} + {{ end }} + </ul> + + <h1>Partials</h1> + <ul> + {{ range sort $partials ".ModTime" "desc" }} + {{ if not .IsDir }} + <li> + <a download title="{{ .Name }}" href="/source/files/partials/{{ .Name }}"> + <code> + <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> + <span>{{ .Name }}</span> + <span>{{ .Size -}}</span> + </code> + </a> + </li> + {{ end }} + {{ end }} + </ul> + + <h1>Shortcodes</h1> + <ul> + {{ range sort $shortcodes ".ModTime" "desc" }} + {{ if not .IsDir }} + <li> + <a download title="{{ .Name }}" href="/source/files/shortcodes/{{ .Name }}"> + <code> + <span>{{- .ModTime | time.Format "2006-01-02 15:04 MST" }}</span> + <span>{{ .Name }}</span> + <span>{{ .Size -}}</span> + </code> + </a> + </li> + {{ end }} + {{ end }} + </ul> + </item-list> + + <footer> + <p> + Canory Version: 0.1.1 + · Dictionary Access by Paul Lutus: <a href="https://arachnoid.com/javascript/dictionary_access.js">GPLv2+ License</a> + · Feather Icons by Cole Bemis: <a href="https://github.com/feathericons/feather/blob/8b5d6802fa8fd1eb3924b465ff718d2fa8d61efe/LICENSE">MIT License</a> + · Tabler Icons by PaweÅ‚ Kuna: <a href="https://github.com/tabler/tabler-icons/blob/60f39297d0f785f2e8635faca6857b2260b2d164/LICENSE">MIT License</a> + · Instant Page by Alexandre Dieulot: <a href="https://github.com/instantpage/instant.page/blob/729e97d5b3245552e41d8f92ed03d08f1d62ea46/LICENSE">MIT License</a> + · Fixed Search by Heracles Papatheodorou: <a href="https://gist.github.com/Arty2/8b0c43581013753438a3d35c15091a9f#file-license-md">License</a> + · Fuzzy Sort by Stephen Kamenar: <a href="https://github.com/farzher/fuzzysort/blob/e7f484a124f09bf3cb9a4db366a95457d962dbed/LICENSE">MIT License</a> + </p> + </footer> + + </source-array> + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right-default.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/index.json b/themes/default/layouts/_default/index.json new file mode 100644 index 0000000..9096730 --- /dev/null +++ b/themes/default/layouts/_default/index.json @@ -0,0 +1,40 @@ +{ + "version": "https://jsonfeed.org/version/1.1", + "title": "{{ .Site.Title }}", + "home_page_url": "{{ .Site.BaseURL }}", + "feed_url": "{{ .Site.BaseURL }}/index.json", + "items": [ + {{- range $index, $data := where .Site.RegularPages ".Params.hidden" "!=" "true" -}} + {{- if and (ne $data.Type "json") (not .ExpiryDate) -}} + {{- if and $index (gt $index 0) -}},{{- end }} + { + "id": "{{ md5 $data.Permalink }}", + "url": "{{ $data.Permalink }}", + "title": "{{ htmlEscape $data.Summary }}", + "summary": "{{ $data.Summary }}", + "date_modified": "{{ $data.Date | time.Format "2006-01-02T15:04:05Z" }}", + "date_published": "{{ $data.PublishDate | time.Format "2006-01-02T15:04:05Z" }}", + "_metadata": { + "slug": "{{ $data.Slug }}", + "type": "{{ $data.Type }}" + }, + "author": { + "name": "{{ partial "author-user.html" . }}" + }, + "tags": [ + {{- range $tags, $tag := $data.Params.tags -}} + {{- if $tags -}} + , + {{- end -}} + " + {{- $tag | htmlEscape -}} + " + {{- end -}} + ], + "content_text": {{ $data.Plain | jsonify }}, + "content_html": {{ $data.Content | jsonify }} + } + {{- end -}} + {{ end }} + ] +} diff --git a/themes/default/layouts/_default/index.webmanifest b/themes/default/layouts/_default/index.webmanifest new file mode 100644 index 0000000..f7b3f66 --- /dev/null +++ b/themes/default/layouts/_default/index.webmanifest @@ -0,0 +1,24 @@ +{{- $icon := resources.Get .Site.Params.webmanifest.logo -}} + +{{- $androidChrome192 := $icon.Fit "192x192" -}} +{{- $androidChrome512 := $icon.Fit "512x512" -}} + +{ + "name": "{{ .Site.Params.webmanifest.name }}", + "short_name": "{{ .Site.Params.webmanifest.shortName }}", + "icons": [ + { + "src": "{{ $androidChrome192.Permalink }}", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "{{ $androidChrome512.Permalink }}", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "{{ .Site.Params.webmanifest.themeColor }}", + "background_color": "{{ .Site.Params.webmanifest.backgroundColor }}", + "display": "{{ .Site.Params.webmanifest.display }}" +} diff --git a/themes/default/layouts/_default/likes.html b/themes/default/layouts/_default/likes.html new file mode 100644 index 0000000..b3be32c --- /dev/null +++ b/themes/default/layouts/_default/likes.html @@ -0,0 +1,58 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} + + tab-list a[href="/{{ $author }}/likes/"] { + display: inherit; + font-weight: 700; + text-decoration: underline; + text-decoration-color: #014cc6; + text-decoration-color: var(--link); + } +</style> +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Likes" + "Subtitle" (partial "count-likes.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{ $author := partial "author-user.html" . }} + {{ $count := 0 }} + {{ $result := false }} + + {{ range .Site.Pages }} + {{ if and (eq .Type $author) .Params.Liked }} + {{ $result = true }} + {{ $count = add $count 1 }} + {{ if le $count 10 }} + {{ .Render "summary" }} + {{ end }} + {{ end }} + {{ end }} + + {{ if not $result }} + <footer> + <code>No likes found!</code> + </footer> + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/list.html b/themes/default/layouts/_default/list.html new file mode 100644 index 0000000..f35f275 --- /dev/null +++ b/themes/default/layouts/_default/list.html @@ -0,0 +1,29 @@ +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Home" + "Subtitle" (partial "count-total-messages.html" .) + "Context" . + ) + }} + + {{ range where .Paginator.Pages ".Params.hidden" "ne" "true" }} + {{ .Render "summary" }} + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.webring) }} + {{- partial "navigator-right.html" . -}} + {{ end }} +{{ end }} diff --git a/themes/default/layouts/_default/media.html b/themes/default/layouts/_default/media.html new file mode 100644 index 0000000..8073928 --- /dev/null +++ b/themes/default/layouts/_default/media.html @@ -0,0 +1,40 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} + + tab-list a[href="/{{ $author }}/media/"] { + display: inherit; + font-weight: 700; + text-decoration: underline; + text-decoration-color: #014cc6; + text-decoration-color: var(--link); + } +</style> +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Media" + "Subtitle" (partial "count-media.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{ partial "media-search.html" . }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml new file mode 100644 index 0000000..4570a98 --- /dev/null +++ b/themes/default/layouts/_default/rss.xml @@ -0,0 +1,32 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := $pctx.RegularPages -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- 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>{{ partial "site-title" . }}</title> + <link>{{ .Permalink }}</link> + <description>Recent from {{ partial "site-title" . }}</description> + <language>{{ .Site.LanguageCode }}</language> + {{- 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 "application/rss+xml" | safeHTML -}} + {{ end }} + {{- range $pages -}} + {{ if and (ne .Params.hidden true) (not .Params.Unlisted) (not .ExpiryDate) }} + <item> + <title>{{ htmlEscape .Summary }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + <guid>{{ .Permalink }}</guid> + <description>{{ .Content | html }}</description> + </item> + {{ end }} + {{ end }} + </channel> +</rss> diff --git a/themes/default/layouts/_default/section.html b/themes/default/layouts/_default/section.html new file mode 100644 index 0000000..e0b607c --- /dev/null +++ b/themes/default/layouts/_default/section.html @@ -0,0 +1,45 @@ +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }} + + tab-list a[href="/{{ partial "author-user.html" . }}"] { + display: inherit; + font-weight: 700; + text-decoration: underline; + text-decoration-color: #014cc6; + text-decoration-color: var(--link); + } +</style> +{{ end }} + +{{ define "middle" }} + + {{- $messages := print (lang.FormatNumberCustom 0 .Paginator.TotalNumberOfElements) " " "Messages" -}} + + {{ partial "navigator-middle.html" + (dict + "Title" (partial "author-name.html" .) + "Subtitle" $messages + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{ range where .Paginator.Pages ".Params.hidden" "ne" "true" }} + {{ .Render "summary" }} + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{ range first 1 .Paginator.Pages }} + {{- partial "navigator-right.html" . -}} + {{ end }} +{{ end }} diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html new file mode 100644 index 0000000..4858f0a --- /dev/null +++ b/themes/default/layouts/_default/single.html @@ -0,0 +1,22 @@ +{{ define "middle" }} + +{{ partial "navigator-middle.html" + (dict + "Title" "Message" + "Subtitle" "Single" + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) +}} + +<micro-thread> + {{ partial "card.html" . }} +</micro-thread> +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/sitemap.xml b/themes/default/layouts/_default/sitemap.xml new file mode 100644 index 0000000..63f5119 --- /dev/null +++ b/themes/default/layouts/_default/sitemap.xml @@ -0,0 +1,22 @@ +{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" + xmlns:xhtml="http://www.w3.org/1999/xhtml"> + {{ range .Data.Pages }} + <url> + <loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }} + <lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }} + <changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + <priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + <xhtml:link + rel="alternate" + hreflang="{{ .Language.Lang }}" + href="{{ .Permalink }}" + />{{ end }} + <xhtml:link + rel="alternate" + hreflang="{{ .Language.Lang }}" + href="{{ .Permalink }}" + />{{ end }} + </url> + {{ end }} +</urlset> diff --git a/themes/default/layouts/_default/summary.html b/themes/default/layouts/_default/summary.html new file mode 100644 index 0000000..3b6a0b3 --- /dev/null +++ b/themes/default/layouts/_default/summary.html @@ -0,0 +1 @@ +{{ partial "card.html" . }} diff --git a/themes/default/layouts/_default/taxonomy.html b/themes/default/layouts/_default/taxonomy.html new file mode 100644 index 0000000..e43bc29 --- /dev/null +++ b/themes/default/layouts/_default/taxonomy.html @@ -0,0 +1,62 @@ +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/tags/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + + {{ $title := .Title }} + + {{ if eq .Title "Tags" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Tags" + "Subtitle" (partial "count-tags.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ $page := 1 }} + {{ $count := 0 }} + + {{ range .Paginator.Pages }} + {{ $title := lower .Title }} + <item-list> + <h1><a href="/tags/{{ $title }}">#{{ .Title }}</a></h1> + <ul> + {{ range .Pages }} + {{ $count = add $count 1 }} + <li> + <a + title="{{ partial "title.html" . }}" + href="/tags/{{ $title }}/{{ if gt $page 1 }}page/{{ $page }}/{{ end }}#{{ partial "card-id.html" . }}"> + <span>{{ .Date.Format "02 Jan 2006" }}</span> + <span>{{ partial "title.html" . }}</span> + <span>@{{ partial "author-user.html" . }}</span> + </a> + </li> + {{ if eq (mod $count $.Paginator.PageSize) 0 }} + {{ $page = add $page 1 }} + {{ end }} + {{ end }} + {{ $page = 1 }} + {{ $count = 0 }} + </ul> + </item-list> + {{ end }} + + {{ partial "pagination.html" . }} + + {{ end }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right-default.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/term.html b/themes/default/layouts/_default/term.html new file mode 100644 index 0000000..30776ff --- /dev/null +++ b/themes/default/layouts/_default/term.html @@ -0,0 +1,33 @@ +{{ define "styles" }} +<style> + {{ partial "styles-navigator.html" (dict "Link" "/tags/") | safeCSS }} +</style> +{{ end }} + +{{ define "middle" }} + + {{- $terms := print (lang.FormatNumberCustom 0 (len .Data.Pages)) " " "Messages" -}} + + {{ partial "navigator-middle.html" + (dict + "Title" (print "#" .Title) + "Subtitle" $terms + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ range .Paginator.Pages }} + {{ partial "card.html" . }} + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right-default.html" . -}} +{{ end }} |