diff options
author | tdro <tdro@noreply.example.com> | 2023-03-14 15:11:23 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-03-14 15:11:23 -0400 |
commit | ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822 (patch) | |
tree | 8a87daba0eb4a355f732ec7e5f3bf3e9bfe3ad7b /themes | |
parent | bde0c042a2d050a8549707f62dec57844c56a0c5 (diff) | |
download | canory-ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822.tar.gz canory-ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822.tar.bz2 canory-ef2611e3c2c07b42f4c8d32ad8cce7d5d634e822.zip |
themes/default/layouts/partials/function-paths: Return dict here
Diffstat (limited to 'themes')
33 files changed, 80 insertions, 79 deletions
diff --git a/themes/default/layouts/_default/_markup/render-codeblock.html b/themes/default/layouts/_default/_markup/render-codeblock.html index 85e60b2..f18f0d3 100644 --- a/themes/default/layouts/_default/_markup/render-codeblock.html +++ b/themes/default/layouts/_default/_markup/render-codeblock.html @@ -10,7 +10,7 @@ <a href="#{{ $id }}">{{ $type }}</a> </language-label> <button hidden=""> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/copy.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/copy.svg")) }} <span>Copy</span> </button> </header> diff --git a/themes/default/layouts/_default/_markup/render-image.html b/themes/default/layouts/_default/_markup/render-image.html index 1a003fc..b98efdf 100644 --- a/themes/default/layouts/_default/_markup/render-image.html +++ b/themes/default/layouts/_default/_markup/render-image.html @@ -13,7 +13,7 @@ {{- $author := .Page.Section -}} {{- $relURL := strings.TrimPrefix .Page.Site.BaseURL .Page.Permalink -}} {{- $immutable := print ($relURL | humanize | urlize) "-" ($source | sha256 | truncate 8 "") -}} -{{- $fileCache := print (partial "function-paths.html" "media") "/" $author "/" $immutable -}} +{{- $fileCache := print (partial "function-paths.html").media "/" $author "/" $immutable -}} {{- $cached := and (fileExists (print "public/" $fileCache ".webp")) (fileExists (print "public/" $fileCache (path.Ext $source))) -}} {{- if not $cached -}} @@ -22,7 +22,7 @@ {{- if fileExists $public -}} {{- $local = resources.Get $public -}} {{- with $local -}} - {{- $local = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base .)) -}} + {{- $local = .Content | resources.FromString (print (partial "function-paths.html").media "/" $author "/" (path.Base .)) -}} {{- end -}} {{- $source = print ("" | absURL) $source -}} {{- else -}} @@ -34,20 +34,20 @@ {{- $source = $404image.Permalink -}} {{- end -}} {{- else -}} - {{- $cache = .Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base .)) -}} + {{- $cache = .Content | resources.FromString (print (partial "function-paths.html").media "/" $author "/" (path.Base .)) -}} {{- end -}} {{- end -}} {{- else -}} {{- $exists = resources.Get (print "public/" $fileCache (path.Ext $source)) -}} - {{- $exists = $exists.Content | resources.FromString (print (partial "function-paths.html" "media") "/" $author "/" (path.Base $exists)) -}} + {{- $exists = $exists.Content | resources.FromString (print (partial "function-paths.html").media "/" $author "/" (path.Base $exists)) -}} {{- end -}} {{- with $local }} {{- $local = .Fit (print $dimensions " webp") }} - {{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable ".webp") }} + {{- $local = $local | resources.Copy (print (partial "function-paths.html").media "/" $author "/" $immutable ".webp") }} {{- $srcset = $local.Permalink -}} {{- $local = .Fit $dimensions }} - {{- $local = $local | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable (path.Ext $local)) }} + {{- $local = $local | resources.Copy (print (partial "function-paths.html").media "/" $author "/" $immutable (path.Ext $local)) }} {{- $width = $local.Width -}} {{- $height = $local.Height -}} {{- $colors = $local.Colors -}} @@ -59,7 +59,7 @@ {{- $cache = $cache | resources.Copy (print $author "/media/" $immutable ".webp") }} {{- $srcset = $cache.Permalink -}} {{- $cache = .Fit $dimensions }} - {{- $cache = $cache | resources.Copy (print (partial "function-paths.html" "media") "/" $author "/" $immutable (path.Ext $cache)) }} + {{- $cache = $cache | resources.Copy (print (partial "function-paths.html").media "/" $author "/" $immutable (path.Ext $cache)) }} {{- $width = $cache.Width -}} {{- $height = $cache.Height -}} {{- $colors = $cache.Colors -}} diff --git a/themes/default/layouts/_default/home.xslt.rss.xsl b/themes/default/layouts/_default/home.xslt.rss.xsl index a19642d..e0c7c80 100644 --- a/themes/default/layouts/_default/home.xslt.rss.xsl +++ b/themes/default/layouts/_default/home.xslt.rss.xsl @@ -33,7 +33,7 @@ <xsl:attribute name="href">/</xsl:attribute> </xsl:otherwise> </xsl:choose> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-left.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} <small>Back</small> </a> </icon-button> @@ -47,7 +47,7 @@ <xsl:attribute name="href"> <xsl:value-of select="/rss/channel/atom:link[@rel='next']/@href"/> </xsl:attribute> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-right.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} <small>Next</small> </a> </icon-button> @@ -58,7 +58,7 @@ <icon-button> <a id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}"> {{ with .Identifier }} - {{ $icon := print (partial "function-paths.html" "static") "/icons/" . ".svg" }} + {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }} {{ safeHTML (readFile $icon) }} {{ end }} <small>{{ delimit (first 1 (split .Name " ")) " " }}</small> diff --git a/themes/default/layouts/_default/home.xslt.sitemap.xsl b/themes/default/layouts/_default/home.xslt.sitemap.xsl index a66877e..ce3fe98 100644 --- a/themes/default/layouts/_default/home.xslt.sitemap.xsl +++ b/themes/default/layouts/_default/home.xslt.sitemap.xsl @@ -21,7 +21,7 @@ <nav> <icon-button> <a onclick="window.history.go(-1); return false;" href="/"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-left.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} <small>Back</small> </a> </icon-button> @@ -37,9 +37,10 @@ id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}" > - {{ with .Identifier }} {{ $icon := print (partial - "function-paths.html" "static") "/icons/" . ".svg" }} {{ safeHTML - (readFile $icon) }} {{ end }} + {{ with .Identifier }} + {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }} + {{ safeHTML (readFile $icon) }} + {{ end }} <small>{{ delimit (first 1 (split .Name " ")) " " }}</small> </a> </icon-button> diff --git a/themes/default/layouts/_default/rss.xml b/themes/default/layouts/_default/rss.xml index fb11d98..3e8e337 100644 --- a/themes/default/layouts/_default/rss.xml +++ b/themes/default/layouts/_default/rss.xml @@ -26,7 +26,7 @@ {{- $description = print .Site.Title " Tags: #" .Title -}} {{- end -}} -{{- $image := print "/" (partial "function-paths.html" "media") +{{- $image := print "/" (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} @@ -81,7 +81,7 @@ {{- $author = partial "function-authors-data.html" . -}} - {{- $image = print "/" (partial "function-paths.html" "media") + {{- $image = print "/" (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} @@ -93,7 +93,7 @@ {{- $atomAuthorName := or .Params.Feed.name $author.name -}} {{- if .Params.Feed.favicon -}} - {{- $favicon := print "/" (partial "function-paths.html" "media") "/favicon." (.Params.Feed.source | anchorize) ".png" -}} + {{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.Params.Feed.source | anchorize) ".png" -}} {{- if not (fileExists (print "public/" $favicon)) -}} {{- $favicon = "/data/media/404.png" -}} {{- end -}} diff --git a/themes/default/layouts/_default/section.following.html b/themes/default/layouts/_default/section.following.html index ad3886d..7c9d990 100644 --- a/themes/default/layouts/_default/section.following.html +++ b/themes/default/layouts/_default/section.following.html @@ -12,7 +12,7 @@ {{- range $distinct := first 1 (where $feeds "FeedSourceLink" "eq" $source) -}} {{- $href := or $distinct.FeedHome (print "http://" $distinct.FeedSourceDomain) -}} - {{- $favicon := print "/" (partial "function-paths.html" "media") "/favicon." (.FeedSourceLink | anchorize) ".png" -}} + {{- $favicon := print "/" (partial "function-paths.html").media "/favicon." (.FeedSourceLink | anchorize) ".png" -}} <micro-author> <micro-card> @@ -53,7 +53,7 @@ <a title="Follow {{ $distinct.FeedName }}" href="{{ $href }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) }} <span>Follow</span> </a> </micro-summary> diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html index 4d5e172..9aeb728 100644 --- a/themes/default/layouts/_default/single.html +++ b/themes/default/layouts/_default/single.html @@ -43,13 +43,13 @@ {{- with or .Next .Prev -}} <paginator-navigation> <a {{ $nextInvisible | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-left.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} Newer </a> <a {{ $prevInvisible | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}"> Older - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-right.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} </a> </paginator-navigation> {{- end -}} diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index 6f771b7..7a8395a 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -13,8 +13,8 @@ {{- $source := "" -}} {{- $sourceset := "" -}} -{{- $source = print "/" (partial "function-paths.html" "media") "/" .Data.user "/" .Data.user "-profile" (path.Ext .Data.picture.profile) -}} -{{- $sourceset = print "/" (partial "function-paths.html" "media") "/" .Data.user "/" .Data.user "-profile.webp" -}} +{{- $source = print "/" (partial "function-paths.html").media "/" .Data.user "/" .Data.user "-profile" (path.Ext .Data.picture.profile) -}} +{{- $sourceset = print "/" (partial "function-paths.html").media "/" .Data.user "/" .Data.user "-profile.webp" -}} {{- with $metadata := resources.Get $metadata -}} {{- $metadata = $metadata.Content | transform.Unmarshal -}} @@ -24,7 +24,7 @@ {{- if or (not (path.Ext .Data.picture.profile)) - (not (fileExists (print "public/" (partial "function-paths.html" "media") "/" .Data.user))) + (not (fileExists (print "public/" (partial "function-paths.html").media "/" .Data.user))) -}} {{- $source = "/data/media/404.png" -}} {{- $sourceset = "" -}} @@ -72,7 +72,7 @@ </micro-header> <p>{{ .Data.description | markdownify | plainify | htmlUnescape | truncate 60 "..." }}</p> <a title="Follow with RSS Reader" href="{{ "" | absURL }}/{{ .Data.user }}/rss.xml"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) }} <span>Follow</span> </a> </micro-summary> diff --git a/themes/default/layouts/partials/author-header.html b/themes/default/layouts/partials/author-header.html index a1e43d2..5bcc0e6 100644 --- a/themes/default/layouts/partials/author-header.html +++ b/themes/default/layouts/partials/author-header.html @@ -11,9 +11,9 @@ "Context" . "Source" $header "Resize" "x600" - "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") - "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.Base $header)) - "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" (path.BaseName $header) ".webp") + "Target" (print (partial "function-paths.html").media "/" $author.user "/") + "Copy" (print (partial "function-paths.html").media "/" $author.user "/" (path.Base $header)) + "AlternateCopy" (print (partial "function-paths.html").media "/" $author.user "/" (path.BaseName $header) ".webp") ) -}} diff --git a/themes/default/layouts/partials/author-picture.html b/themes/default/layouts/partials/author-picture.html index becb40a..dbbfd69 100644 --- a/themes/default/layouts/partials/author-picture.html +++ b/themes/default/layouts/partials/author-picture.html @@ -11,14 +11,14 @@ {{- $alternate = $.Params.feed.name -}} {{- $width = "64" -}} {{- $height = "64" -}} - {{- $source = print "/" (partial "function-paths.html" "media") "/favicon." ($.Params.feed.source | anchorize) ".png" -}} + {{- $source = print "/" (partial "function-paths.html").media "/favicon." ($.Params.feed.source | anchorize) ".png" -}} {{- if not (fileExists (print "public/" $source)) -}} {{- $source = $.Params.feed.favicon -}} {{- end -}} {{- $sourceset = "" -}} {{- else -}} - {{- $source = print "/" (partial "function-paths.html" "media") "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} - {{- $sourceset = print "/" (partial "function-paths.html" "media") "/" $author.user "/" $author.user "-profile.webp" -}} + {{- $source = print "/" (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile" (path.Ext $author.picture.profile) -}} + {{- $sourceset = print "/" (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile.webp" -}} {{- with $metadata := resources.Get $metadata -}} {{- $metadata = $metadata.Content | transform.Unmarshal -}} {{- $width = $metadata.picture.profileWidth -}} diff --git a/themes/default/layouts/partials/author-section-picture.html b/themes/default/layouts/partials/author-section-picture.html index a3ff1f7..de0806b 100644 --- a/themes/default/layouts/partials/author-section-picture.html +++ b/themes/default/layouts/partials/author-section-picture.html @@ -11,9 +11,9 @@ "Context" . "Source" $profile "Fit" "160x160" - "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") - "Copy" (print (partial "function-paths.html" "media") "/" $author.user "/" $author.user "-profile" (path.Ext $profile)) - "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author.user "/" $author.user "-profile.webp") + "Target" (print (partial "function-paths.html").media "/" $author.user "/") + "Copy" (print (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile" (path.Ext $profile)) + "AlternateCopy" (print (partial "function-paths.html").media "/" $author.user "/" $author.user "-profile.webp") ) -}} diff --git a/themes/default/layouts/partials/function-fetch-favicons.html b/themes/default/layouts/partials/function-fetch-favicons.html index 7f92a94..facde2f 100644 --- a/themes/default/layouts/partials/function-fetch-favicons.html +++ b/themes/default/layouts/partials/function-fetch-favicons.html @@ -7,8 +7,8 @@ "Context" $pageContext "Source" $source "Fit" "160x160" - "Target" (print (partial "function-paths.html" "media") "/") - "Copy" (print (partial "function-paths.html" "media") "/favicon." $infix ".png") + "Target" (print (partial "function-paths.html").media "/") + "Copy" (print (partial "function-paths.html").media "/favicon." $infix ".png") ) -}} diff --git a/themes/default/layouts/partials/function-paths.html b/themes/default/layouts/partials/function-paths.html index bc36171..5f5a516 100644 --- a/themes/default/layouts/partials/function-paths.html +++ b/themes/default/layouts/partials/function-paths.html @@ -1,7 +1,7 @@ -{{- $path := . -}} - -{{- if eq $path "markdown" -}} {{- $path = "data/generates/content" -}} {{- end -}} -{{- if eq $path "media" -}} {{- $path = "data/media" -}} {{- end -}} -{{- if eq $path "static" -}} {{- $path = "static" -}} {{- end -}} - -{{- return $path -}} +{{- + return (dict + "markdown" "data/generates/content" + "media" "data/media" + "static" "static" + ) +-}} diff --git a/themes/default/layouts/partials/meta-anchored.html b/themes/default/layouts/partials/meta-anchored.html index 61175b0..31b910f 100644 --- a/themes/default/layouts/partials/meta-anchored.html +++ b/themes/default/layouts/partials/meta-anchored.html @@ -4,14 +4,14 @@ {{ if .Weight }} <anchored-pinned> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/tabler/pinned.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/tabler/pinned.svg")) }} <span>Pinned</span> </anchored-pinned> {{ end }} {{ if .Params.Liked }} <anchored-liked> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/heart.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/heart.svg")) }} <span>Liked</span> </anchored-liked> {{ end }} diff --git a/themes/default/layouts/partials/meta-context-menu.html b/themes/default/layouts/partials/meta-context-menu.html index 5c9f76c..b24ab5d 100644 --- a/themes/default/layouts/partials/meta-context-menu.html +++ b/themes/default/layouts/partials/meta-context-menu.html @@ -5,7 +5,7 @@ <micro-metadata-menu> <context-control> <label for="context-metadata-{{ $id }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-down-circle.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-down-circle.svg")) -}} <span>menu</span> </label> <input hidden type="checkbox" id="context-metadata-{{ $id }}" /> @@ -13,14 +13,14 @@ {{- partial "meta-markdown.html" . -}} <micro-metadata-plain> <a href="{{ $plain }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/file-text.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/file-text.svg")) -}} <span>plaintext</span> </a> </micro-metadata-plain> {{- partial "meta-permalink.html" . -}} <micro-metadata-datetime> <a title="{{ .Date.Local | time.Format "3:04 PM Jan 2 2006" -}}" href="{{ $href }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/calendar.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/calendar.svg")) -}} <span>{{ .Date.Local | time.Format "Jan 2 2006" | lower -}}</span> </a> </micro-metadata-datetime> diff --git a/themes/default/layouts/partials/meta-date-time.html b/themes/default/layouts/partials/meta-date-time.html index 0c01edd..bd42fcc 100644 --- a/themes/default/layouts/partials/meta-date-time.html +++ b/themes/default/layouts/partials/meta-date-time.html @@ -1,7 +1,7 @@ <micro-metadata-datetime title="{{ .Date | time.Format "Posted: Monday, January 2, 2006 at 15:04:05 MST" }} {{ if .Lastmod.After .Date }}{{ .Lastmod | time.Format "Edited: Monday, January 2, 2006 at 15:04:05 MST" }}{{ end }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/calendar.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/calendar.svg")) -}} <time datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}"> {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}} </time> diff --git a/themes/default/layouts/partials/meta-draft.html b/themes/default/layouts/partials/meta-draft.html index 3ba6aee..8662b32 100644 --- a/themes/default/layouts/partials/meta-draft.html +++ b/themes/default/layouts/partials/meta-draft.html @@ -4,7 +4,7 @@ <em> {{- /* This comment removes trailing newlines and white spaces. */ -}} <a href="{{ .Site.BaseURL }}/{{ .Type }}/drafts/"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/edit.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/edit.svg")) -}} <span>Draft</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} </a> diff --git a/themes/default/layouts/partials/meta-expiry-date.html b/themes/default/layouts/partials/meta-expiry-date.html index 62f01da..6eef09e 100644 --- a/themes/default/layouts/partials/meta-expiry-date.html +++ b/themes/default/layouts/partials/meta-expiry-date.html @@ -10,7 +10,7 @@ <micro-metadata-expiry title="{{ $title }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/trash-2.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/trash-2.svg")) -}} <time datetime= "{{- .ExpiryDate | time.Format "2006-01-02T15:04:05Z" -}}"> {{- .ExpiryDate | time.Format "Jan 2 2006" -}} {{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/partials/meta-handle.html b/themes/default/layouts/partials/meta-handle.html index 69cd200..d332ab0 100644 --- a/themes/default/layouts/partials/meta-handle.html +++ b/themes/default/layouts/partials/meta-handle.html @@ -20,7 +20,7 @@ <a title="{{ $title }}" href="{{ $href }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/at-sign.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/at-sign.svg")) -}} <span>{{- $host -}}</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} </a> diff --git a/themes/default/layouts/partials/meta-markdown.html b/themes/default/layouts/partials/meta-markdown.html index c6e7bdf..5300af5 100644 --- a/themes/default/layouts/partials/meta-markdown.html +++ b/themes/default/layouts/partials/meta-markdown.html @@ -1,12 +1,12 @@ {{- if not .ExpiryDate -}} {{- $relURL := strings.TrimPrefix .Page.Site.BaseURL .Page.Permalink -}} {{- $source := print (path.Dir $relURL) ".md" -}} - {{- $href := print .Site.BaseURL "/" (partial "function-paths.html" "markdown") $source -}} + {{- $href := print .Site.BaseURL "/" (partial "function-paths.html").markdown $source -}} {{- $title := .File.LogicalName -}} <micro-metadata-source> <a href="{{ $href }}" title="{{ $title }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/code.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/code.svg")) -}} <span>markdown</span> </a> </micro-metadata-source> diff --git a/themes/default/layouts/partials/meta-permalink.html b/themes/default/layouts/partials/meta-permalink.html index 6c3c05f..3ab09a2 100644 --- a/themes/default/layouts/partials/meta-permalink.html +++ b/themes/default/layouts/partials/meta-permalink.html @@ -2,7 +2,7 @@ <micro-metadata-permalink> <a title="#{{ partial "card-id.html" . }}" href="{{ $href }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/link.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/link.svg")) -}} <span>permalink</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} </a> diff --git a/themes/default/layouts/partials/meta-read-time.html b/themes/default/layouts/partials/meta-read-time.html index dbc91f2..69c0ffa 100644 --- a/themes/default/layouts/partials/meta-read-time.html +++ b/themes/default/layouts/partials/meta-read-time.html @@ -5,7 +5,7 @@ {{- end -}} <micro-metadata-readtime title="Takes {{ $seconds }} second{{- if not (eq $seconds "1") -}}s{{- end }} to read"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/clock.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/clock.svg")) -}} <span>{{ $seconds }} sec</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} </micro-metadata-readtime> diff --git a/themes/default/layouts/partials/meta-unlisted.html b/themes/default/layouts/partials/meta-unlisted.html index aedab0e..827de3c 100644 --- a/themes/default/layouts/partials/meta-unlisted.html +++ b/themes/default/layouts/partials/meta-unlisted.html @@ -1,6 +1,6 @@ {{- if .Params.Unlisted -}} <micro-metadata-unlisted title="This message is off the record"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/eye-off.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/eye-off.svg")) -}} <span>unlisted</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} </micro-metadata-unlisted> diff --git a/themes/default/layouts/partials/meta-via.html b/themes/default/layouts/partials/meta-via.html index 483481d..84e7c2f 100644 --- a/themes/default/layouts/partials/meta-via.html +++ b/themes/default/layouts/partials/meta-via.html @@ -2,7 +2,7 @@ {{- if .Params.feed -}} <anchored-via> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/rss.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) -}} <a data-hover title="{{ $author }}@{{ (urls.Parse .Site.BaseURL).Host }}" href="{{ .Site.BaseURL }}/{{ $author }}/feeds/#"> diff --git a/themes/default/layouts/partials/meta-view.html b/themes/default/layouts/partials/meta-view.html index 6936da7..ccdac1c 100644 --- a/themes/default/layouts/partials/meta-view.html +++ b/themes/default/layouts/partials/meta-view.html @@ -3,7 +3,7 @@ <micro-metadata-view> {{- /* This comment removes trailing newlines and white spaces. */ -}} <a href="{{ $href }}"> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/external-link.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/external-link.svg")) -}} <span>view</span> {{- /* This comment removes trailing newlines and white spaces. */ -}} </a> diff --git a/themes/default/layouts/partials/meta-word-count.html b/themes/default/layouts/partials/meta-word-count.html index e2bcea6..8aaa30d 100644 --- a/themes/default/layouts/partials/meta-word-count.html +++ b/themes/default/layouts/partials/meta-word-count.html @@ -16,7 +16,7 @@ title=" "> {{- /* This comment removes trailing newlines and white spaces. */ -}} <word-limit> - {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/file-text.svg")) -}} + {{- safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/file-text.svg")) -}} <word-count> {{- if $wordLimit -}} <em>{{ .WordCount }}</em> diff --git a/themes/default/layouts/partials/navigator-left.html b/themes/default/layouts/partials/navigator-left.html index 32654e8..1a3bd1d 100644 --- a/themes/default/layouts/partials/navigator-left.html +++ b/themes/default/layouts/partials/navigator-left.html @@ -6,7 +6,7 @@ <a id="nav-left-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}"> <span>{{ .Name }}</span> {{ with .Identifier }} - {{ $icon := print (partial "function-paths.html" "static") "/icons/" . ".svg" }} + {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }} {{ safeHTML (readFile $icon) }} {{ end }} </a> diff --git a/themes/default/layouts/partials/navigator-middle.html b/themes/default/layouts/partials/navigator-middle.html index a371506..46c4060 100644 --- a/themes/default/layouts/partials/navigator-middle.html +++ b/themes/default/layouts/partials/navigator-middle.html @@ -8,9 +8,9 @@ href="{{ or $href "#" }}" > {{ with .Icon }} - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/" . ".svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/" . ".svg")) }} {{ else }} - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-up.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-up.svg")) }} {{ end }} {{ with .IconLabel }} <small>{{ . }}</small> @@ -35,7 +35,7 @@ <icon-button> <a id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}"> {{ with .Identifier }} - {{ $icon := print (partial "function-paths.html" "static") "/icons/" . ".svg" }} + {{ $icon := print (partial "function-paths.html").static "/icons/" . ".svg" }} {{ safeHTML (readFile $icon) }} {{ end }} <small>{{ delimit (first 1 (split .Name " ")) " " }}</small> @@ -60,7 +60,7 @@ aria-label="search input" /> <button id="search-submit"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/search.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/search.svg")) }} <small>Search</small> </button> <ul hidden id="search-results"></ul> diff --git a/themes/default/layouts/partials/pagination.html b/themes/default/layouts/partials/pagination.html index 31bebeb..fa3c85e 100644 --- a/themes/default/layouts/partials/pagination.html +++ b/themes/default/layouts/partials/pagination.html @@ -51,13 +51,13 @@ </a> <a rel="{{ $prevRel }}" {{ $prevData | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-left.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} {{ $prevTitle }} </a> <a rel="{{ $nextRel }}" {{ $nextData | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}"> {{ $nextTitle }} - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-right.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} </a> <a {{ $lastData | safeHTMLAttr }} href="{{ $lastHref }}" title="{{ $lastTitle }}" > diff --git a/themes/default/layouts/partials/profile.html b/themes/default/layouts/partials/profile.html index 2025147..fc68c0b 100644 --- a/themes/default/layouts/partials/profile.html +++ b/themes/default/layouts/partials/profile.html @@ -28,21 +28,21 @@ <footer> <p> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/map-pin.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/map-pin.svg")) }} <span>{{- $author.place | markdownify -}}</span> </p> <p> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/globe.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/globe.svg")) }} <a href="{{ $author.domain.url }}"> {{- $author.domain.host | markdownify -}} </a> </p> <p> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/clock.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/clock.svg")) }} <span>{{- $author.epoch | markdownify -}}</span> </p> <p> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/user.svg")) }} + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/user.svg")) }} <span><b>{{ with $author.feeds.rss }}{{ len . }}{{ else }} 0 {{ end }}</b> Following</span> </p> </footer> diff --git a/themes/default/layouts/shortcodes/markdown.html b/themes/default/layouts/shortcodes/markdown.html index 9efc859..f73aa90 100644 --- a/themes/default/layouts/shortcodes/markdown.html +++ b/themes/default/layouts/shortcodes/markdown.html @@ -1,4 +1,4 @@ -{{- $link := default (print "/" (partial "function-paths.html" "markdown") "/" .Page.File ) (.Get "link" | default (.Get 0)) -}} +{{- $link := default (print "/" (partial "function-paths.html").markdown "/" .Page.File ) (.Get "link" | default (.Get 0)) -}} {{- $text := default (path.Base .Page.File) (.Get "text" | default (.Get 1)) -}} {{- $title := default "" (.Get "title" | default (.Get 2)) -}} {{- $embed := default false (.Get "embed" | default (.Get 3)) -}} diff --git a/themes/default/layouts/shortcodes/react.html b/themes/default/layouts/shortcodes/react.html index a36d113..344bd2d 100644 --- a/themes/default/layouts/shortcodes/react.html +++ b/themes/default/layouts/shortcodes/react.html @@ -10,9 +10,9 @@ "Context" .Page "Source" $source "Fit" "100x100" - "Target" (print (partial "function-paths.html" "media") "/" $author "/") - "Copy" (print (partial "function-paths.html" "media") "/" $author "/react-" (path.Base $source)) - "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author "/react-" (path.BaseName $source) ".webp") + "Target" (print (partial "function-paths.html").media "/" $author "/") + "Copy" (print (partial "function-paths.html").media "/" $author "/react-" (path.Base $source)) + "AlternateCopy" (print (partial "function-paths.html").media "/" $author "/react-" (path.BaseName $source) ".webp") ) -}} diff --git a/themes/default/layouts/shortcodes/react.rss.xml b/themes/default/layouts/shortcodes/react.rss.xml index 429505d..0e03675 100644 --- a/themes/default/layouts/shortcodes/react.rss.xml +++ b/themes/default/layouts/shortcodes/react.rss.xml @@ -10,9 +10,9 @@ "Context" .Page "Source" $source "Fit" "100x100" - "Target" (print (partial "function-paths.html" "media") "/" $author "/") - "Copy" (print (partial "function-paths.html" "media") "/" $author "/react-" (path.Base $source)) - "AlternateCopy" (print (partial "function-paths.html" "media") "/" $author "/react-" (path.BaseName $source) ".webp") + "Target" (print (partial "function-paths.html").media "/" $author "/") + "Copy" (print (partial "function-paths.html").media "/" $author "/react-" (path.Base $source)) + "AlternateCopy" (print (partial "function-paths.html").media "/" $author "/react-" (path.BaseName $source) ".webp") ) -}} |