Compare commits

...

2 Commits

Author SHA1 Message Date
BBaoVanC 553d1584f4
Rename a lot of classes from post- to page- 2023-03-23 12:42:13 -05:00
BBaoVanC 0e0195afd1
Generalize series CSS classes better 2023-03-23 12:11:05 -05:00
24 changed files with 97 additions and 102 deletions

View File

@ -368,7 +368,7 @@ h1 svg.icon {
font-size: 1.5em; font-size: 1.5em;
} }
/* this is also used i.e. in post-title */ /* this is also used i.e. in page-title */
.heading-link { .heading-link {
color: inherit; color: inherit;
font-weight: bold; font-weight: bold;
@ -514,15 +514,14 @@ h1 svg.icon {
gap: 40px; gap: 40px;
} }
.page-list > .post { .page-list > .page {
padding: 24px; padding: 24px;
border-radius: 12px; border-radius: 12px;
background-color: var(--background-1); background-color: var(--background-1);
color: var(--text-1); color: var(--text-1);
} }
.post > .post-title, .page > .page-title {
.author > .author-name {
margin-top: 0; margin-top: 0;
} }
@ -534,28 +533,24 @@ h1 svg.icon {
} }
*/ */
.post-title, .page-title {
.author-name {
margin-bottom: 10px; margin-bottom: 10px;
} }
.post-title h1, .page-title h1 {
.author-name h1 {
margin: 0; margin: 0;
} }
.post-meta-item, .page-metadata {
.author-meta-item { margin-bottom: 24px;
}
.page-metadata-item {
margin-right: 10px; margin-right: 10px;
display: inline-block; display: inline-block;
} }
.post-metadata, .page-metadata-section {
.author-metadata {
margin-bottom: 24px;
}
.post-meta-section {
margin-top: 10px; margin-top: 10px;
} }
@ -563,8 +558,7 @@ h1 svg.icon {
margin-top: 15px; margin-top: 15px;
} }
.post-description, .page-description {
.author-description {
margin-top: 10px; margin-top: 10px;
} }
@ -624,10 +618,9 @@ h1 svg.icon {
/* Series list layout {{{ */ /* Series list layout {{{ */
/* .page-list.series {
.post.series {
display: flex; display: flex;
gap: 10px; gap: 80px;
flex-flow: row wrap; flex-flow: row wrap;
list-style: none; list-style: none;
color: var(--text-0); color: var(--text-0);
@ -635,15 +628,19 @@ h1 svg.icon {
border-radius: 16px; border-radius: 16px;
} }
.post.series .post { .page-list.series-inner {
gap: 10px;
flex-direction: row;
flex-flow: row wrap;
background-color: var(--background-0);
/*color: var(--text-0);*/
padding: 8px;
border-radius: 16px;
}
.page-list.series-inner > .page {
flex: 1; flex: 1;
min-width: 49%; min-width: 49%;
} }
*/
.page-list.series {
gap: 80px;
}
/* }}} */ /* }}} */
@ -945,16 +942,16 @@ aside.quote {
margin-right: 20px; margin-right: 20px;
} }
.full-width-page-list .post { .full-width-page-list .page {
min-width: 300px; min-width: 300px;
max-width: 300px; max-width: 300px;
} }
.full-width-page-list .post:first-child { .full-width-page-list .page:first-child {
margin-left: 20px; margin-left: 20px;
} }
.full-width-page-list .post:last-child { .full-width-page-list .page:last-child {
margin-right: 20px; margin-right: 20px;
} }

View File

@ -1,12 +1,12 @@
{{ define "main" }} {{ define "main" }}
<div class="post-title"> <div class="page-title">
<h1> <h1>
{{ .Title | markdownify }} {{ .Title | markdownify }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h1> </h1>
</div> </div>
{{ partial "post-metadata/full.html" . }} {{ partial "page-metadata/post-full.html" . }}
{{ partial "series-box.html" . }} {{ partial "series-box.html" . }}
{{ if .Params.Toc }} {{ if .Params.Toc }}

View File

@ -1,10 +1,10 @@
<h2 class="post-title"> <h2 class="page-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2> </h2>
{{ partial "post-metadata/short.html" . }} {{ partial "page-metadata/post-short.html" . }}
{{ with .Resources.GetMatch "feature" }} {{ with .Resources.GetMatch "feature" }}
<div class="post-media"> <div class="post-media">
@ -12,7 +12,7 @@
</div> </div>
{{ end }} {{ end }}
<div class="post-description"> <div class="page-description">
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
</div> </div>

View File

@ -11,7 +11,7 @@
<div class="page-list"> <div class="page-list">
{{ with .Paginator.Pages }} {{ with .Paginator.Pages }}
{{ range . }} {{ range . }}
<article class="post"> <article class="page">
{{ .Render "summary" }} {{ .Render "summary" }}
</article> </article>
{{ end }} {{ end }}

View File

@ -1,16 +1,14 @@
<div class="author"> <h2 class="page-title">
<h2 class="author-name"> <a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a> {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} </h2>
</h2>
{{ partial "post-metadata/author.html" . }} {{ partial "page-metadata/author.html" . }}
<div class="author-description"> <div class="page-description">
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
</div> </div>
<div class="readmore"> <div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a> <a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
</div> </div>

View File

@ -1,5 +1,5 @@
{{ define "main" }} {{ define "main" }}
<div class="author-name"> <div class="page-title">
<h1> <h1>
{{ partial "icon.html" "user-circle" }} {{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }} {{ .Title | markdownify }}
@ -7,7 +7,7 @@
</h1> </h1>
</div> </div>
{{ partial "post-metadata/author.html" . }} {{ partial "page-metadata/author.html" . }}
{{ with .Content }} {{ with .Content }}
{{ . }} {{ . }}

View File

@ -1,7 +1,7 @@
<div class="page-list"> <div class="page-list">
{{ with . }} {{ with . }}
{{ range . }} {{ range . }}
<article class="post"> <article class="page">
{{ .Render "summary" }} {{ .Render "summary" }}
</article> </article>
{{ end }} {{ end }}

View File

@ -1,16 +1,16 @@
<div class="author-metadata" aria-label="{{ i18n "aria_author_metadata" }}"> <div class="page-metadata" aria-label="{{ i18n "aria_author_metadata" }}">
{{/* Calculate the total word count */}} {{/* Calculate the total word count */}}
{{ $total_words := 0 }} {{ $total_words := 0 }}
{{ range .Data.Pages }} {{ range .Data.Pages }}
{{ $total_words = add $total_words .WordCount }} {{ $total_words = add $total_words .WordCount }}
{{ end }} {{ end }}
<span class="author-meta-item" aria-label="{{ i18n "aria_author_post_count" }}"> <span class="page-metadata-item" aria-label="{{ i18n "aria_author_post_count" }}">
{{ partial "icon.html" "newspaper" }} {{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }} {{ i18n "post_count" (len .Data.Pages) }}
</span> </span>
<span class="author-meta-item" aria-label="{{ i18n "aria_author_word_count" }}"> <span class="page-metadata-item" aria-label="{{ i18n "aria_author_word_count" }}">
{{ partial "icon.html" "align-left" }} {{ partial "icon.html" "align-left" }}
{{ i18n "wordcount" $total_words }} {{ i18n "wordcount" $total_words }}
</span> </span>

View File

@ -1,5 +1,5 @@
{{ with .Params.authors }} {{ with .Params.authors }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_authors" }}"> <span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_authors" }}">
{{ partial "icon.html" "user-circle" }} {{ partial "icon.html" "user-circle" }}
{{ if index $.Site.Taxonomies "authors" }} {{ if index $.Site.Taxonomies "authors" }}

View File

@ -4,7 +4,7 @@
{{ $categories = $categories | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }} {{ $categories = $categories | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }} {{ end }}
<div class="post-meta-section categories" aria-label="{{ i18n "aria_post_meta_categories" }}"> <div class="page-metadata-section categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
{{ partial "icon.html" "folder" }} {{ partial "icon.html" "folder" }}
{{ delimit $categories ", " }} {{ delimit $categories ", " }}
</div> </div>

View File

@ -1,5 +1,5 @@
{{ if and .Site.Params.gitHistoryURL .File.Path }} {{ if and .Site.Params.gitHistoryURL .File.Path }}
<span class="post-meta-item post-meta-edit-history" aria-label="{{ i18n "aria_post_meta_edit_history" }}"> <span class="page-metadata-item post-meta-edit-history" aria-label="{{ i18n "aria_post_meta_edit_history" }}">
{{ partial "icon.html" "history" }} {{ partial "icon.html" "history" }}
<a href="{{ printf "%s/content/%s" .Site.Params.gitHistoryURL .File.Path }}" target="_blank" rel="noopener"> <a href="{{ printf "%s/content/%s" .Site.Params.gitHistoryURL .File.Path }}" target="_blank" rel="noopener">
{{- i18n "edit_history" -}} {{- i18n "edit_history" -}}

View File

@ -1,5 +1,5 @@
{{ if ne .Site.Params.readingtime false }} {{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_reading_time" }}"> <span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_reading_time" }}">
{{ partial "icon.html" "clock" }} {{ partial "icon.html" "clock" }}
{{ i18n "readingtime" .ReadingTime }} {{ i18n "readingtime" .ReadingTime }}
</span> </span>

View File

@ -4,7 +4,7 @@
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }} {{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }} {{ end }}
<div class="post-meta-section series" aria-label="{{ i18n "aria_post_meta_series" }}"> <div class="page-metadata-section series" aria-label="{{ i18n "aria_post_meta_series" }}">
{{ partial "icon.html" "files" }} {{ partial "icon.html" "files" }}
{{ delimit $series ", " }} {{ delimit $series ", " }}
</div> </div>

View File

@ -4,7 +4,7 @@
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }} {{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }} {{ end }}
<div class="post-meta-section tags" aria-label="{{ i18n "aria_post_meta_tags" }}"> <div class="page-metadata-section tags" aria-label="{{ i18n "aria_post_meta_tags" }}">
{{ partial "icon.html" "tag" }} {{ partial "icon.html" "tag" }}
{{ delimit $tags ", " }} {{ delimit $tags ", " }}
</div> </div>

View File

@ -1,7 +1,7 @@
{{ if or .Date .Params.authors .Site.Params.readingtime .Site.Params.gitFileURL }} {{ if or .Date .Params.authors .Site.Params.readingtime .Site.Params.gitFileURL }}
<div class="post-metadata" aria-label="{{ i18n "aria_post_metadata" }}"> <div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }} {{ if .Date }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_date" }}"> <span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_date" }}">
{{ partial "icon.html" "calendar" }} {{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate> <time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }} {{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
@ -11,7 +11,7 @@
{{/* TODO: make this be a tooltip */}} {{/* TODO: make this be a tooltip */}}
{{/* DISABLED {{/* DISABLED
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }} {{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
<span class="post-meta-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}"> <span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_modified_date" }}">
{{ partial "icon.html" "pencil" }} {{ partial "icon.html" "pencil" }}
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate> <time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }} {{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
@ -21,10 +21,10 @@
*/}} */}}
{{ end }} {{ end }}
{{ partial "post-meta-item/authors.html" . }} {{ partial "page-metadata/item/authors.html" . }}
{{ partial "post-meta-item/readingtime.html" . }} {{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "post-meta-item/edithistory.html" . }} {{ partial "page-metadata/item/edithistory.html" . }}
{{ partial "post-meta-item/categories.html" . }} {{ partial "page-metadata/item/categories.html" . }}
{{ partial "post-meta-item/tags.html" . }} {{ partial "page-metadata/item/tags.html" . }}
</div> </div>
{{ end }} {{ end }}

View File

@ -0,0 +1,18 @@
{{ if or .Date .Params.authors .Site.Params.readingtime }}
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="page-metadata-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
</span>
{{ end }}
{{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/series.html" . }}
{{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }}
</div>
{{ end }}

View File

@ -1,11 +1,11 @@
<div class="post-metadata" aria-label="{{ i18n "aria_series_metadata" }}"> <div class="page-metadata" aria-label="{{ i18n "aria_series_metadata" }}">
<span class="post-meta-item"> <span class="page-metadata-item">
{{ partial "icon.html" "newspaper" }} {{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }} {{ i18n "post_count" (len .Data.Pages) }}
</span> </span>
{{ if ne .Site.Params.readingtime false }} {{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item"> <span class="page-metadata-item">
{{ partial "icon.html" "clock" }} {{ partial "icon.html" "clock" }}
{{ $readingtime := 0 }} {{ $readingtime := 0 }}
{{ range .Data.Pages }} {{ range .Data.Pages }}

View File

@ -1,18 +0,0 @@
{{ if or .Date .Params.authors .Site.Params.readingtime }}
<div class="post-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="post-meta-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time>
</span>
{{ end }}
{{ partial "post-meta-item/authors.html" . }}
{{ partial "post-meta-item/readingtime.html" . }}
{{ partial "post-meta-item/series.html" . }}
{{ partial "post-meta-item/categories.html" . }}
{{ partial "post-meta-item/tags.html" . }}
</div>
{{ end }}

View File

@ -9,9 +9,9 @@
{{ end }} {{ end }}
<div class="page-list series"> <div class="page-list series">
{{ with .Pages }} {{ with .Paginator.Pages }}
{{ range . }} {{ range . }}
<div class="series"> <div class="page series">
{{ .Render "summary" }} {{ .Render "summary" }}
</div> </div>
{{ end }} {{ end }}

View File

@ -1,18 +1,18 @@
<h2 class="post-title"> <h2 class="page-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a class="heading-link" href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2> </h2>
{{ partial "post-metadata/series.html" . }} {{ partial "page-metadata/series.html" . }}
<div class="post-description"> <div class="page-description">
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
</div> </div>
<div class="series-page-list"> <div class="page-list series-inner">
{{ range .Data.Pages.Reverse }} {{ range .Data.Pages.Reverse }}
<article class="post"> <article class="page">
{{ .Render "summary" }} {{ .Render "summary" }}
</article> </article>
{{ end }} {{ end }}

View File

@ -5,7 +5,7 @@
{{ partial "rss-link.html" . }} {{ partial "rss-link.html" . }}
</h1> </h1>
{{ partial "post-metadata/series.html" . }} {{ partial "page-metadata/series.html" . }}
{{ with .Content }} {{ with .Content }}
{{ . }} {{ . }}

View File

@ -1,5 +1,5 @@
{{ define "main" }} {{ define "main" }}
<div class="post-title"> <div class="page-title">
<h1> <h1>
{{ if eq .Data.Singular "tag" }} {{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }} {{ partial "icon.html" "tag" }}
@ -26,7 +26,7 @@
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p> <p>{{ .Title | markdownify }}</p>
</a> </a>
{{ partial "post-metadata/taxonomy.html" . }} {{ partial "page-metadata/taxonomy.html" . }}
</div> </div>
{{ partial "description-or-summary.html" . }} {{ partial "description-or-summary.html" . }}
</article> </article>

View File

@ -1,5 +1,5 @@
{{ define "main" }} {{ define "main" }}
<div class="post-title"> <div class="page-title">
<h1> <h1>
{{ if eq .Data.Singular "tag" }} {{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }} {{ partial "icon.html" "tag" }}
@ -14,7 +14,7 @@
</h1> </h1>
</div> </div>
{{ partial "post-metadata/taxonomy.html" . }} {{ partial "page-metadata/taxonomy.html" . }}
{{ with .Content }} {{ with .Content }}
{{ . }} {{ . }}