diff options
author | Christoph Cullmann <christoph@cullmann.io> | 2024-06-26 21:44:28 +0200 |
---|---|---|
committer | Christoph Cullmann <christoph@cullmann.io> | 2024-06-26 21:44:28 +0200 |
commit | 58e2c9ae87f09dac79ecf962331ae2c51f4ba7f1 (patch) | |
tree | d819d1747427f81d1883a715ec60d13d575053e4 /themes/blowfish/layouts/_default | |
parent | b1a7697b03cfb0143af78993387f758836e842bf (diff) |
update the theme
Diffstat (limited to 'themes/blowfish/layouts/_default')
-rw-r--r-- | themes/blowfish/layouts/_default/_markup/render-image.html | 38 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/_markup/render-link.html | 9 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/baseof.html | 2 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/index.json | 6 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/list.html | 89 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/simple.html | 2 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/single.html | 4 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/taxonomy.html | 2 | ||||
-rw-r--r-- | themes/blowfish/layouts/_default/term.html | 4 |
9 files changed, 77 insertions, 79 deletions
diff --git a/themes/blowfish/layouts/_default/_markup/render-image.html b/themes/blowfish/layouts/_default/_markup/render-image.html index db9ebd2..3e5fdce 100644 --- a/themes/blowfish/layouts/_default/_markup/render-image.html +++ b/themes/blowfish/layouts/_default/_markup/render-image.html @@ -1,29 +1,29 @@ -{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} -{{ $url := urls.Parse .Destination }} -{{ $altText := .Text }} -{{ $caption := .Title }} -{{ if findRE "^https?" $url.Scheme }} +{{- $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} +{{- $url := urls.Parse .Destination }} +{{- $altText := .Text }} +{{- $caption := .Title }} +{{- if findRE "^https?" $url.Scheme }} <figure> <img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" /> {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} </figure> -{{ else }} - {{ $resource := "" }} - {{ if $.Page.Resources.GetMatch ($url.String) }} - {{ $resource = $.Page.Resources.GetMatch ($url.String) }} - {{ else if resources.GetMatch ($url.String) }} - {{ $resource = resources.Get ($url.String) }} - {{ end }} - {{ with $resource }} +{{- else }} + {{- $resource := "" }} + {{- if $.Page.Resources.GetMatch ($url.String) }} + {{- $resource = $.Page.Resources.GetMatch ($url.String) }} + {{- else if resources.GetMatch ($url.String) }} + {{- $resource = resources.Get ($url.String) }} + {{- end }} + {{- with $resource }} <figure> - {{ if $disableImageOptimization }} + {{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}} <img class="my-0 rounded-md" loading="lazy" src="{{ .RelPermalink }}" alt="{{ $altText }}" /> - {{ else }} + {{- else }} <img class="my-0 rounded-md" loading="lazy" @@ -35,13 +35,13 @@ src="{{ (.Resize "660x").RelPermalink }}" alt="{{ $altText }}" /> - {{ end }} + {{- end }} {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} </figure> - {{ else }} + {{- else }} <figure> <img class="my-0 rounded-md" loading="lazy" src="{{ $url.String }}" alt="{{ $altText }}" /> {{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }} </figure> - {{ end }} -{{ end }} + {{- end }} +{{- end }} diff --git a/themes/blowfish/layouts/_default/_markup/render-link.html b/themes/blowfish/layouts/_default/_markup/render-link.html index 8336169..b6028bf 100644 --- a/themes/blowfish/layouts/_default/_markup/render-link.html +++ b/themes/blowfish/layouts/_default/_markup/render-link.html @@ -1,2 +1,7 @@ -<a href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"{{ end }} {{ if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}> - {{ .Text | safeHTML }}</a>
\ No newline at end of file +<a href="{{ .Destination | safeURL }}" + {{- with .Title -}} + title="{{ . }}" + {{- end }} + {{- if or (strings.HasPrefix .Destination "http:") (strings.HasPrefix .Destination "https:") }} target="_blank"{{ end }}> + {{- .Text | safeHTML -}} +</a>
\ No newline at end of file diff --git a/themes/blowfish/layouts/_default/baseof.html b/themes/blowfish/layouts/_default/baseof.html index 3aaa9f4..7a1ff83 100644 --- a/themes/blowfish/layouts/_default/baseof.html +++ b/themes/blowfish/layouts/_default/baseof.html @@ -8,7 +8,7 @@ {{- partial "head.html" . -}} <body - class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32"> + class="flex flex-col h-screen px-6 m-auto text-lg leading-7 max-w-7xl bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral sm:px-14 md:px-24 lg:px-32 scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600"> <div id="the-top" class="absolute flex self-center"> <a class="px-3 py-1 text-sm -translate-y-8 rounded-b-lg bg-primary-200 focus:translate-y-0 dark:bg-neutral-600" href="#main-content"><span diff --git a/themes/blowfish/layouts/_default/index.json b/themes/blowfish/layouts/_default/index.json index 0f44c53..7fbcfe2 100644 --- a/themes/blowfish/layouts/_default/index.json +++ b/themes/blowfish/layouts/_default/index.json @@ -9,11 +9,11 @@ "date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long")) "title" (.Title | emojify | safeJS) "section" ($section.Title | emojify | safeJS) - "summary" (.Summary | emojify | safeJS) - "content" (.Plain | emojify | safeJS) + "summary" (.Summary | safeJS) + "content" (.Plain | safeJS) "permalink" .RelPermalink "externalUrl" .Params.externalUrl "type" .Type ) -}} {{- end -}} -{{- $index | jsonify -}} +{{- $index | jsonify -}}
\ No newline at end of file diff --git a/themes/blowfish/layouts/_default/list.html b/themes/blowfish/layouts/_default/list.html index ef35de8..9720468 100644 --- a/themes/blowfish/layouts/_default/list.html +++ b/themes/blowfish/layouts/_default/list.html @@ -49,9 +49,9 @@ </div> {{ end }} <div class="min-w-0 min-h-0 max-w-prose"> - {{ .Content | emojify }} + {{ .Content }} </div> - + @@ -61,80 +61,73 @@ {{ $cardView := .Params.cardView | default (.Site.Params.list.cardView | default false) }} {{ $cardViewScreenWidth := .Params.cardViewScreenWidth | default (.Site.Params.list.cardViewScreenWidth | default false) }} {{ $groupByYear := .Params.groupByYear | default ($.Site.Params.list.groupByYear | default false) }} + {{ $orderByWeight := .Params.orderByWeight | default ($.Site.Params.list.orderByWeight | default false) }} + {{ $groupByYear := and (not $orderByWeight) $groupByYear }} {{ if not $cardView }} <section class="space-y-10 w-full"> - {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - {{ if $groupByYear }} - <h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300"> - {{ .Key }} - </h2> - {{ end }} - {{ range .Pages }} - {{ partial "article-link/simple.html" . }} - {{ end }} + {{ if not $orderByWeight }} + {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} + {{ if $groupByYear }} + <h2 class="mt-12 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300"> + {{ .Key }} + </h2> + {{ end }} + {{ range .Pages }} + {{ partial "article-link/simple.html" . }} + {{ end }} + {{ end }} + {{ else }} + {{ range (.Paginate (.Pages.ByWeight)).Pages }} + {{ partial "article-link/simple.html" . }} + {{ end }} {{ end }} </section> - {{ else if and $cardView (not $cardViewScreenWidth) }} + {{ else }} {{ if $groupByYear }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - <h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300"> - {{ .Key }} - </h2> - <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3"> + {{ if $cardViewScreenWidth }} + <div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);"> + {{ end }} + <h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300"> + {{ .Key }} + </h2> + <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 {{ if $cardViewScreenWidth }} xl:grid-cols-4 2xl:grid-cols-5 {{ end }}"> {{ range .Pages }} {{ partial "article-link/card.html" . }} {{ end }} </section> + {{ if $cardViewScreenWidth }} </div> {{ end }} {{ end }} - {{ else }} + {{ else }} + {{ if $cardViewScreenWidth }} + <div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);"> + <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"> + {{ else }} <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3"> + {{ end }} + {{ if not $orderByWeight }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ range .Pages }} {{ partial "article-link/card.html" . }} {{ end }} {{ end }} + {{ else }} + {{ range (.Paginate (.Pages.ByWeight)).Pages }} + {{ partial "article-link/card.html" . }} + {{ end }} + {{ end }} </section> + {{ if $cardViewScreenWidth }} </div> {{ end }} {{ end }} - {{ else if and $cardView $cardViewScreenWidth }} - - {{ if $groupByYear }} - - {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - <div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);"> - <h2 class="mt-12 mb-3 text-2xl font-bold text-neutral-700 first:mt-8 dark:text-neutral-300"> - {{ .Key }} - </h2> - <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"> - {{ range .Pages }} - {{ partial "article-link/card.html" . }} - {{ end }} - </section> - </div> - {{ end }} - - {{ else }} - - <div class="relative w-screen max-w-[1600px] px-[30px]" style="left: calc(max(-50vw,-800px) + 50%);"> - <section class="w-full grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"> - {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} - {{ range .Pages }} - {{ partial "article-link/card.html" . }} - {{ end }} - {{ end }} - </section> - </div> - - {{ end }} - {{end}} {{ else }} diff --git a/themes/blowfish/layouts/_default/simple.html b/themes/blowfish/layouts/_default/simple.html index cc88479..7b5b9a8 100644 --- a/themes/blowfish/layouts/_default/simple.html +++ b/themes/blowfish/layouts/_default/simple.html @@ -9,7 +9,7 @@ </h1> </header> <section class="max-w-full mt-6 prose dark:prose-invert"> - {{ .Content | emojify }} + {{ .Content }} </section> <footer class="pt-8"> {{ partial "sharing-links.html" . }} diff --git a/themes/blowfish/layouts/_default/single.html b/themes/blowfish/layouts/_default/single.html index 9e6c526..ad07f7d 100644 --- a/themes/blowfish/layouts/_default/single.html +++ b/themes/blowfish/layouts/_default/single.html @@ -80,7 +80,7 @@ {{ partial "series/series.html" . }} <div class="article-content max-w-prose mb-20"> - {{ .Content | emojify }} + {{ .Content }} </div> {{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} @@ -147,4 +147,4 @@ {{ end }} </footer> </article> -{{ end }}
\ No newline at end of file +{{ end }} diff --git a/themes/blowfish/layouts/_default/taxonomy.html b/themes/blowfish/layouts/_default/taxonomy.html index aa8e4b1..b7a38c8 100644 --- a/themes/blowfish/layouts/_default/taxonomy.html +++ b/themes/blowfish/layouts/_default/taxonomy.html @@ -25,7 +25,7 @@ {{ if .Content }} <section class="flex flex-col max-w-full mt-0 prose dark:prose-invert lg:flex-row"> <div class="min-w-0 min-h-0 max-w-prose"> - {{ .Content | emojify }} + {{ .Content }} </div> </section> {{ end }} diff --git a/themes/blowfish/layouts/_default/term.html b/themes/blowfish/layouts/_default/term.html index dcaed10..db33bd7 100644 --- a/themes/blowfish/layouts/_default/term.html +++ b/themes/blowfish/layouts/_default/term.html @@ -24,7 +24,7 @@ <section class="flex flex-col max-w-full mt-0 mb-5 prose dark:prose-invert lg:flex-row"> {{ if .Content }} <div class="min-w-0 min-h-0 max-w-prose"> - {{ .Content | emojify }} + {{ .Content }} </div> {{ end }} <script> @@ -128,4 +128,4 @@ {{ partial "pagination.html" . }} - {{ end }}
\ No newline at end of file + {{ end }} |