diff options
author | WANG Chucheng <me@wangchucheng.com> | 2022-02-06 20:59:04 +0300 |
---|---|---|
committer | WANG Chucheng <me@wangchucheng.com> | 2022-02-06 20:59:04 +0300 |
commit | ddf263db42012fa1a9cdddaf658716503ea93929 (patch) | |
tree | 9f19c86e3699fe11e33b45fe6131039ab3fc12b4 /layouts/_default | |
parent | 022f844c82995cd4b06f4454d3bec755a8fecbb8 (diff) |
style: improve typography
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/list.html | 17 | ||||
-rw-r--r-- | layouts/_default/single.html | 94 | ||||
-rw-r--r-- | layouts/_default/terms.html | 23 |
3 files changed, 58 insertions, 76 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 47725d5..4f4419f 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,14 +1,7 @@ {{ define "main" }} -<article class="mx-6 my-8"> - <h1 class="font-bold text-3xl text-primary-text">{{ .Title }}</h1> - {{ with .Content }} - <div class="content"> - {{ . }} - </div> - {{ end }} -</article> -<div class="bg-secondary-bg rounded px-6"> + {{ partial "components/list-article" . }} + <div class="bg-secondary-bg rounded px-6"> {{ partial "components/summary-list-plain" .Paginator.Pages }} -</div> -{{ template "_internal/pagination.html" . }} -{{ end }}
\ No newline at end of file + </div> + {{ template "_internal/pagination.html" . }} +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index bb5b178..04a81d9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,66 +1,60 @@ {{ define "main" }} -{{ $hasToc := and (in .TableOfContents "<li>" ) (.Params.toc) }} -{{ $hasSidebar := or ($hasToc) (.Params.series) }} -<div class="grid grid-cols-2 lg:grid-cols-8 gap-4 lg:pt-12"> + {{ $hasToc := and (in .TableOfContents "<li>" ) (.Params.toc) }} + {{ $hasSidebar := or ($hasToc) (.Params.series) }} + <div class="grid grid-cols-2 gap-4 lg:grid-cols-8 lg:pt-12"> <div - class="col-span-2 {{ if not $hasSidebar }} {{- print "lg:col-start-2" -}} {{ end }} lg:col-span-6 bg-secondary-bg rounded px-6 py-8"> - <h1 class="font-bold text-3xl text-primary-text">{{ .Title }}</h1> - {{ partial "components/post-metadata" . }} - - {{ $featured := partial "utils/get-featured" . }} - {{ with $featured }} - <div class="my-4"> - {{ . }} - </div> - {{ end }} + class="{{ if not $hasSidebar }} + {{- print "lg:col-start-2" -}} + {{ end }} bg-secondary-bg col-span-2 rounded px-6 py-8 lg:col-span-6" + > + {{ partial "components/post-article" . }} - <div class="content"> - {{ .Content}} - </div> - {{ with .GetTerms "tags" }} + {{ with .GetTerms "tags" }} {{ partial "components/post-tags" . }} - {{ end }} - - {{ partial "components/post-edit" . }} - - {{ with .GetTerms "authors" }} + {{ end }} + + {{ partial "components/post-edit" . }} + + {{ with .GetTerms "authors" }} {{ partial "components/post-author" . }} - {{ end }} - - {{ partial "components/post-footer" . }} - {{ partial "comment.html" . }} + {{ end }} + + {{ partial "components/post-footer" . }} + {{ partial "comment.html" . }} </div> - {{ if $hasSidebar}} - <div class="col-span-2"> + {{ if $hasSidebar }} + <div class="col-span-2"> {{ if .GetTerms "series" }} - {{ partial "components/post-series" . }} + {{ partial "components/post-series" . }} {{ end }} {{ if $hasToc }} - {{ partial "components/post-toc" . }} + {{ partial "components/post-toc" . }} {{ end }} - </div> + </div> {{ end }} {{ $related := .Site.RegularPages.Related . | first 6 }} {{ with $related }} - <div - class="col-span-2 {{ if not $hasSidebar }} {{- print "lg:col-start-2" -}} {{ end }} lg:col-span-6 bg-secondary-bg rounded p-6"> - <h2 class="text-lg font-semibold mb-4">{{ i18n "seeAlso" }}</h2> - <div class="content"> - {{ range . }} - <a href="{{ .Permalink }}">{{ .LinkTitle }}</a> - <br /> - {{ end }} - </div> - </div> + <div + class="{{ if not $hasSidebar }} + {{- print "lg:col-start-2" -}} + {{ end }} bg-secondary-bg prose col-span-2 max-w-none rounded p-6 lg:col-span-6" + > + <h3>{{ i18n "seeAlso" }}</h3> + {{ range . }} + <a href="{{ .Permalink }}" class="no-underline">{{ .LinkTitle }}</a> + <br /> + {{ end }} + </div> {{ end }} -</div> -{{/* highlight */}} -{{- if eq .Site.Params.highlight.handler "highlightjs" }} -<script> - document.addEventListener('DOMContentLoaded', ()=>{ + </div> + + {{/* highlight */}} + {{- if eq .Site.Params.highlight.handler "highlightjs" }} + <script> + document.addEventListener("DOMContentLoaded", () => { hljs.initHighlightingOnLoad(); - }) -</script> -{{- end }} -{{ end }}
\ No newline at end of file + }); + </script> + {{- end }} +{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 678efdd..4e4a9b3 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,17 +1,12 @@ {{ define "main" }} -<article class="mx-6 my-8"> - <h1 class="font-bold text-3xl text-primary-text">{{ .Title }}</h1> - {{ with .Content }} - <div class="content"> - {{ . }} - </div> - {{ end }} -</article> -<div class="bg-secondary-bg rounded px-6 py-8"> + {{ partial "components/list-article" . }} + <div class="bg-secondary-bg rounded px-6 py-8"> {{ range .Pages }} - <h2 class="text-lg text-primary-text my-2"> - <a href="{{ .Permalink }}" class="text-eureka hover:underline">{{ .LinkTitle }}</a> - </h2> + <h2 class="text-primary-text my-2 text-lg"> + <a href="{{ .Permalink }}" class="text-eureka hover:underline" + >{{ .LinkTitle }}</a + > + </h2> {{ end }} -</div> -{{ end }}
\ No newline at end of file + </div> +{{ end }} |