diff options
author | tdro <tdro@noreply.example.com> | 2023-06-18 18:32:33 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-06-18 18:32:33 -0400 |
commit | eaa731e5eddf263e12d46481a036cce9882bf72e (patch) | |
tree | a11c076ddf22b9c92d060dd0d6f620d9b06e5fc2 | |
parent | 61e5db6e54d264ca8950cd50e84032db4f167660 (diff) | |
download | canory-eaa731e5eddf263e12d46481a036cce9882bf72e.tar.gz canory-eaa731e5eddf263e12d46481a036cce9882bf72e.tar.bz2 canory-eaa731e5eddf263e12d46481a036cce9882bf72e.zip |
themes/default/layouts/partials/pagination: Simplify and prepare
-rw-r--r-- | assets/css/default.css | 17 | ||||
-rw-r--r-- | themes/default/layouts/_default/section.following.html | 2 | ||||
-rw-r--r-- | themes/default/layouts/_default/single.html | 20 | ||||
-rw-r--r-- | themes/default/layouts/partials/author-card.html | 2 | ||||
-rw-r--r-- | themes/default/layouts/partials/pagination.html | 85 |
5 files changed, 57 insertions, 69 deletions
diff --git a/assets/css/default.css b/assets/css/default.css index 8d24bf0..44479d4 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -812,7 +812,11 @@ paginator-navigation svg, micro-author micro-summary > a svg { height: 1.25rem; width: 1.25rem; - margin: 0 0.25rem; +} + +svg ~ header, +header ~ svg { + margin-left: 0.25rem; } hr { @@ -1549,6 +1553,10 @@ paginator-navigation a { justify-content: center; } +paginator-navigation a[title="hidden"] { + visibility: hidden; +} + web-ring, author-list, following-list, @@ -2065,10 +2073,6 @@ link-card article a { display: none; } -[data-invisible] { - visibility: hidden; -} - [data-hover] { text-decoration: none; } @@ -2164,6 +2168,9 @@ li:target [role="doc-backlink"][href^="#fnref\:"] { micro-author micro-summary > :not(:last-child) { margin-bottom: 0.5rem; } + micro-author micro-header { + flex: none; + } micro-author micro-header > * { white-space: normal; } diff --git a/themes/default/layouts/_default/section.following.html b/themes/default/layouts/_default/section.following.html index 48afa7d..eef5e12 100644 --- a/themes/default/layouts/_default/section.following.html +++ b/themes/default/layouts/_default/section.following.html @@ -55,7 +55,7 @@ title="Follow {{ $distinct.FeedName }}" href="{{ $href }}"> {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/rss.svg")) }} - <span>Follow</span> + <header>Follow</header> </a> </micro-summary> </micro-card> diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html index 8a6444d..f891a5e 100644 --- a/themes/default/layouts/_default/single.html +++ b/themes/default/layouts/_default/single.html @@ -20,34 +20,30 @@ <micro-thread> {{- partial "render-embed.html" . -}} - {{- $nextHref := "" -}} - {{- $prevHref := "" -}} - {{- $nextTitle := "" -}} - {{- $prevTitle := "" -}} - {{- $nextInvisible := "data-invisible" -}} - {{- $prevInvisible := "data-invisible" -}} + {{- $prevHref := "/" -}} + {{- $nextHref := "/" -}} + {{- $prevTitle := "hidden" -}} + {{- $nextTitle := "hidden" -}} {{- with .Next -}} {{- $nextHref = $.Next.Permalink -}} {{- $nextTitle = $.Next.Summary -}} - {{- $nextInvisible = "" -}} {{- end -}} {{- with .Prev -}} {{- $prevHref = $.Prev.Permalink -}} {{- $prevTitle = $.Prev.Summary -}} - {{- $prevInvisible = "" -}} {{- end -}} {{- with or .Next .Prev -}} <paginator-navigation> - <a {{ $nextInvisible | safeHTMLAttr }} href="{{ $nextHref }}" title="{{ $nextTitle }}"> + <a href="{{ $nextHref }}" title="{{ $nextTitle }}"> {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} - Newer + <header>Newer</header> </a> - <a {{ $prevInvisible | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}"> - Older + <a href="{{ $prevHref }}" title="{{ $prevTitle }}"> + <header>Older</header> {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} </a> </paginator-navigation> diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index fab591e..df0af84 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -75,7 +75,7 @@ <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")) }} - <span>Follow</span> + <header>Follow</header> </a> </micro-summary> </micro-card> diff --git a/themes/default/layouts/partials/pagination.html b/themes/default/layouts/partials/pagination.html index fa3c85e..d633b92 100644 --- a/themes/default/layouts/partials/pagination.html +++ b/themes/default/layouts/partials/pagination.html @@ -1,67 +1,52 @@ {{- with .Paginator -}} - - {{- $first := "Newest" -}} - {{- $prev := "Newer" -}} - {{- $next := "Older" -}} - {{- $last := "Oldest" -}} - {{- $invisible := "data-invisible" -}} - - {{- $firstData := $invisible -}} - {{- $firstHref := "" -}} - {{- $firstTitle := $first -}} + {{- $firstTitle := "hidden" -}} + {{- $prevTitle := "hidden" -}} + {{- $nextTitle := "hidden" -}} + {{- $lastTitle := "hidden" -}} + {{- $prevRel := "prev" -}} + {{- $nextRel := "next" -}} + {{- $firstHref := "/" -}} + {{- $prevHref := "/" -}} + {{- $nextHref := "/" -}} + {{- $lastHref := "/" -}} {{- if and .HasPrev .First -}} - {{- $firstData = "" -}} - {{- $firstHref = .First.URL -}} + {{- $firstHref = .First.URL | absURL -}} + {{- $firstTitle = "Newest" -}} {{- end -}} - {{- $prevData := $invisible -}} - {{- $prevHref := "" -}} - {{- $prevRel := "prev" -}} - {{- $prevTitle := $prev -}} - {{- with .Prev -}} - {{- $prevData = "" -}} - {{- $prevHref = .URL -}} + {{- $prevHref = .URL | absURL -}} + {{- $prevTitle = "Newer" -}} {{- end -}} - {{- $nextData := $invisible -}} - {{- $nextHref := "" -}} - {{- $nextRel := "next" -}} - {{- $nextTitle := $next -}} - {{- if .Next -}} - {{- $nextData = "" -}} - {{- $nextHref = .Next.URL -}} + {{- $nextHref = .Next.URL | absURL -}} + {{- $nextTitle = "Older" -}} {{- end -}} - {{- $lastData := $invisible -}} - {{- $lastHref := "" -}} - {{- $lastTitle := $last -}} - {{- if and .HasNext .Last -}} - {{- $lastData = "" -}} - {{- $lastHref = .Last.URL -}} + {{- $lastHref = .Last.URL | absURL -}} + {{- $lastTitle = "Oldest" -}} {{- end -}} <paginator-navigation{{ if eq .TotalPages 1 }} hidden {{ end }}> - - <a {{ $firstData | safeHTMLAttr }} href="{{ $firstHref }}" title="{{ $firstTitle }}" > - {{ $firstTitle }} - </a> - - <a rel="{{ $prevRel }}" {{ $prevData | safeHTMLAttr }} href="{{ $prevHref }}" title="{{ $prevTitle }}"> - {{ 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")) }} - </a> - - <a {{ $lastData | safeHTMLAttr }} href="{{ $lastHref }}" title="{{ $lastTitle }}" > - {{ $lastTitle }} - </a> + <a href="{{ $firstHref }}" title="{{ $firstTitle }}" > + <header>{{ $firstTitle }}</header> + </a> + + <a rel="{{ $prevRel }}" href="{{ $prevHref }}" title="{{ $prevTitle }}"> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-left.svg")) }} + <header>{{ $prevTitle }}</header> + </a> + + <a rel="{{ $nextRel }}" href="{{ $nextHref }}" title="{{ $nextTitle }}"> + <header>{{ $nextTitle }}</header> + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/arrow-right.svg")) }} + </a> + + <a href="{{ $lastHref }}" title="{{ $lastTitle }}"> + <header>{{ $lastTitle }}</header> + </a> </paginator-navigation> {{- end -}} |