From ddf263db42012fa1a9cdddaf658716503ea93929 Mon Sep 17 00:00:00 2001 From: WANG Chucheng Date: Sun, 6 Feb 2022 12:59:04 -0500 Subject: style: improve typography --- layouts/_default/list.html | 17 ++--- layouts/_default/single.html | 94 +++++++++++------------- layouts/_default/terms.html | 23 +++--- layouts/authors/terms.html | 23 +++--- layouts/partials/components/doc-layout.html | 15 +--- layouts/partials/components/doc-list.html | 11 +-- layouts/partials/components/list-article.html | 6 ++ layouts/partials/components/post-article.html | 12 +++ layouts/partials/components/post-metadata.html | 58 ++++++++------- layouts/partials/components/post-series.html | 22 +++--- layouts/partials/components/post-toc.html | 26 +++++-- layouts/partials/components/summary-masonry.html | 12 +-- layouts/partials/head.html | 9 +-- layouts/partials/utils/get-summary.html | 34 ++++----- layouts/partials/widgets/about.html | 25 +++---- layouts/partials/widgets/experience.html | 47 ++++++------ 16 files changed, 216 insertions(+), 218 deletions(-) create mode 100644 layouts/partials/components/list-article.html create mode 100644 layouts/partials/components/post-article.html (limited to 'layouts') 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" }} -
-

{{ .Title }}

- {{ with .Content }} -
- {{ . }} -
- {{ end }} -
-
+ {{ partial "components/list-article" . }} +
{{ partial "components/summary-list-plain" .Paginator.Pages }} -
-{{ template "_internal/pagination.html" . }} -{{ end }} \ No newline at end of file +
+ {{ 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 "
  • " ) (.Params.toc) }} -{{ $hasSidebar := or ($hasToc) (.Params.series) }} -
    + {{ $hasToc := and (in .TableOfContents "
  • " ) (.Params.toc) }} + {{ $hasSidebar := or ($hasToc) (.Params.series) }} +
    -

    {{ .Title }}

    - {{ partial "components/post-metadata" . }} - - {{ $featured := partial "utils/get-featured" . }} - {{ with $featured }} -
    - {{ . }} -
    - {{ 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" . }} -
    - {{ .Content}} -
    - {{ 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" . }}
    - {{ if $hasSidebar}} -
    + {{ if $hasSidebar }} +
    {{ if .GetTerms "series" }} - {{ partial "components/post-series" . }} + {{ partial "components/post-series" . }} {{ end }} {{ if $hasToc }} - {{ partial "components/post-toc" . }} + {{ partial "components/post-toc" . }} {{ end }} -
    +
    {{ end }} {{ $related := .Site.RegularPages.Related . | first 6 }} {{ with $related }} -
    -

    {{ i18n "seeAlso" }}

    -
    - {{ range . }} - {{ .LinkTitle }} -
    - {{ end }} -
    -
    +
    +

    {{ i18n "seeAlso" }}

    + {{ range . }} + {{ .LinkTitle }} +
    + {{ end }} +
    {{ end }} -
    -{{/* highlight */}} -{{- if eq .Site.Params.highlight.handler "highlightjs" }} - -{{- end }} -{{ end }} \ No newline at end of file + }); + + {{- 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" }} -
    -

    {{ .Title }}

    - {{ with .Content }} -
    - {{ . }} -
    - {{ end }} -
    -
    + {{ partial "components/list-article" . }} +
    {{ range .Pages }} -

    - {{ .LinkTitle }} -

    +

    + {{ .LinkTitle }} +

    {{ end }} -
    -{{ end }} \ No newline at end of file +
    +{{ end }} diff --git a/layouts/authors/terms.html b/layouts/authors/terms.html index 678efdd..4e4a9b3 100644 --- a/layouts/authors/terms.html +++ b/layouts/authors/terms.html @@ -1,17 +1,12 @@ {{ define "main" }} -
    -

    {{ .Title }}

    - {{ with .Content }} -
    - {{ . }} -
    - {{ end }} -
    -
    + {{ partial "components/list-article" . }} +
    {{ range .Pages }} -

    - {{ .LinkTitle }} -

    +

    + {{ .LinkTitle }} +

    {{ end }} -
    -{{ end }} \ No newline at end of file +
    +{{ end }} diff --git a/layouts/partials/components/doc-layout.html b/layouts/partials/components/doc-layout.html index 3e12176..cf434b3 100644 --- a/layouts/partials/components/doc-layout.html +++ b/layouts/partials/components/doc-layout.html @@ -9,21 +9,10 @@
    -
    -

    {{ .Title }}

    - {{ partial "components/post-metadata" . }} -
    - {{ $featured := partial "utils/get-featured" . }} - {{ with $featured }} -
    - {{ . }} -
    - {{ end }} -
    - {{ .Content}} -
    + {{ partial "components/post-article" . }} + {{ with .GetTerms "tags" }} {{ partial "components/post-tags" . }} {{ end }} diff --git a/layouts/partials/components/doc-list.html b/layouts/partials/components/doc-list.html index 51e71b3..067fdea 100644 --- a/layouts/partials/components/doc-list.html +++ b/layouts/partials/components/doc-list.html @@ -1,12 +1,5 @@ -
    -

    {{ .Title }}

    - {{ with .Content }} -
    - {{ . }} -
    - {{ end }} -
    +{{ partial "components/list-article" . }}
    {{ partial "components/summary-list-plain" .Paginator.Pages }}
    -{{ template "_internal/pagination.html" . }} \ No newline at end of file +{{ template "_internal/pagination.html" . }} diff --git a/layouts/partials/components/list-article.html b/layouts/partials/components/list-article.html new file mode 100644 index 0000000..6f37b2d --- /dev/null +++ b/layouts/partials/components/list-article.html @@ -0,0 +1,6 @@ +
    +

    {{ .Title }}

    + {{ with .Content }} + {{ . }} + {{ end }} +
    diff --git a/layouts/partials/components/post-article.html b/layouts/partials/components/post-article.html new file mode 100644 index 0000000..0cbadd8 --- /dev/null +++ b/layouts/partials/components/post-article.html @@ -0,0 +1,12 @@ +
    +

    {{ .Title }}

    + + {{ partial "components/post-metadata" . }} + + {{ $featured := partial "utils/get-featured" . }} + {{ with $featured }} + {{ . }} + {{ end }} + + {{ .Content }} +
    diff --git a/layouts/partials/components/post-metadata.html b/layouts/partials/components/post-metadata.html index 2d108d5..f125cff 100644 --- a/layouts/partials/components/post-metadata.html +++ b/layouts/partials/components/post-metadata.html @@ -1,34 +1,42 @@ -
    -
    - - {{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02") }} -
    -
    - - {{ i18n "readingTime" .ReadingTime }} -
    - - {{ with .GetTerms "categories" }} +
    +
    + + {{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02") }} +
    +
    + + {{ i18n "readingTime" .ReadingTime }} +
    + + {{ with .GetTerms "categories" }}
    - - {{ range $index, $value := . }} + + {{ range $index, $value := . }} {{ if gt $index 0 }} - , + , {{ end -}} - {{ .LinkTitle }} - {{ end }} + {{ .LinkTitle }} + {{ end }}
    - {{ end }} + {{ end }} - {{ with .GetTerms "series" }} + {{ with .GetTerms "series" }}
    - - {{ range $index, $value := . }} + + {{ range $index, $value := . }} {{ if gt $index 0 }} - , + , {{ end -}} - {{ .LinkTitle }} - {{ end }} + {{ .LinkTitle }} + {{ end }}
    - {{ end }} -
    \ No newline at end of file + {{ end }} +
    diff --git a/layouts/partials/components/post-series.html b/layouts/partials/components/post-series.html index ebc3810..a407b81 100644 --- a/layouts/partials/components/post-series.html +++ b/layouts/partials/components/post-series.html @@ -1,12 +1,10 @@ -{{ $series := .Site.Taxonomies.series}} -
    -

    {{ i18n "seriesOfPosts"}}

    -
    - {{ range (.GetTerms "series") }} - {{ range .Pages }} - {{ .Page.LinkTitle }} -
    - {{end}} - {{end}} -
    -
    \ No newline at end of file +{{ $series := .Site.Taxonomies.series }} +
    +

    {{ i18n "seriesOfPosts" }}

    + {{ range (.GetTerms "series") }} + {{ range .Pages }} + {{ .LinkTitle }} +
    + {{ end }} + {{ end }} +
    diff --git a/layouts/partials/components/post-toc.html b/layouts/partials/components/post-toc.html index 337ecb6..46de312 100644 --- a/layouts/partials/components/post-toc.html +++ b/layouts/partials/components/post-toc.html @@ -1,11 +1,21 @@ -