Update tags and categories to both use the same layouts

This commit is contained in:
BBaoVanC 2022-05-09 19:21:39 -05:00
parent 466c91a980
commit de84bc5ddf
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
11 changed files with 65 additions and 147 deletions

View File

@ -135,72 +135,50 @@
/* Category list format */
.category-list ul {
display: flex;
flex-direction: column;
list-style: none;
gap: 10px;
padding: 0;
/* Taxonomy list format */
.taxonomy-list a,
.taxonomy-list .taxonomy-metadata {
white-space: nowrap;
}
.category-list li {
.taxonomy-list p {
margin: 0;
}
.taxonomy-list ul {
list-style: none;
padding: 0;
display: flex;
flex-direction: row;
gap: 20px;
flex-direction: column;
gap: 10px;
}
.taxonomy-list li {
background-color: var(--background-1);
padding: 8px 12px;
border-radius: 8px;
display: flex;
flex-direction: row;
gap: 20px;
}
.category-list-left {
.taxonomy-list-left {
display: flex;
flex-direction: column;
}
@media (max-width: 480px) {
.category-list li {
.taxonomy-list li {
flex-direction: column;
gap: 0;
gap: 4px;
}
.category-list-left {
.taxonomy-list-left {
flex-direction: row;
justify-content: space-between;
}
}
.category-list p {
margin: 0;
}
.category-list a,
.category-list .category-metadata {
white-space: nowrap;
}
/* Tags list format */
.tag-list ul {
display: flex;
list-style: none;
gap: 10px;
flex-flow: row wrap;
padding: 0;
}
.tag-list a {
background-color: var(--background-1);
padding: 8px 12px;
border-radius: 12px;
}
.tag-list a:hover {
text-decoration: none;
background-color: var(--background-2);
}
/* Series list format */

View File

@ -94,8 +94,8 @@ aria_post_metadata:
aria_author_metadata:
other: "author metadata"
aria_category_metadata:
other: "category metadata"
aria_taxonomy_metadata:
other: "taxonomy metadata"
aria_post_meta_date:
other: "date"
@ -109,7 +109,7 @@ aria_author_post_count:
aria_author_word_count:
other: "word count"
aria_category_post_count:
aria_taxonomy_post_count:
other: "post count"
aria_series_metadata:

View File

@ -94,8 +94,8 @@ newer_post:
# aria_author_metadata:
# other: "author metadata"
# aria_category_metadata:
# other: "category metadata"
# aria_taxonomy_metadata:
# other: "taxonomy metadata"
# aria_post_meta_date:
# other: "date"
@ -109,7 +109,7 @@ newer_post:
# aria_author_word_count:
# other: "word count"
# aria_category_post_count:
# aria_taxonomy_post_count:
# other: "post count"
# aria_series_metadata:

View File

@ -1,30 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "folder" }}
{{ .Title | markdownify }}
</h1>
<div class="category-list">
{{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }}
{{ with .Page }}
<li>
<div class="category-list-left">
<a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p>
</a>
{{ partial "post-metadata/category.html" . }}
</div>
{{ partial "description-or-summary.html" . }}
</li>
{{ end }}
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ end }}

View File

@ -1,17 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "folder" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ partial "post-metadata/category.html" . }}
{{ with .Content }}
{{ . }}
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -1,6 +0,0 @@
<div class="category-metadata" aria-label="{{ i18n "aria_category_metadata" }}">
<span class="category-meta-item" aria-label="{{ i18n "aria_category_post_count" }}">
{{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }}
</span>
</div>

View File

@ -0,0 +1,6 @@
<div class="taxonomy-metadata" aria-label="{{ i18n "aria_taxonomy_metadata" }}">
<span class="taxonomy-meta-item" aria-label="{{ i18n "aria_taxonomy_post_count" }}">
{{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }}
</span>
</div>

View File

@ -1,22 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "tag" }}
{{ .Title | markdownify }}
</h1>
<div class="tag-list">
{{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }}
<a href="{{ .Page.Permalink }}">
<li>{{ .Page.Title | markdownify }}</li>
</a>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ end }}

View File

@ -1,15 +0,0 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "tag" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -1,17 +1,32 @@
{{ define "main" }}
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
{{ else if eq .Data.Singular "category" }}
{{ partial "icon.html" "folder" }}
{{ else }}
{{ partial "icon.html" "filter" }}
{{ end }}
{{ .Title | markdownify }}
</h1>
<div class="taxonomy">
<div class="taxonomy-list">
{{ with .Data.Terms.Alphabetical }}
<ul>
{{ range . }}
{{ with .Page }}
<li>
<a href="{{ .Page.Permalink }}">{{ .Page.Title | markdownify }}</a>
<div class="taxonomy-list-left">
<a href="{{ .Permalink }}">
<p>{{ .Title | markdownify }}</p>
</a>
{{ partial "post-metadata/taxonomy.html" . }}
</div>
{{ partial "description-or-summary.html" . }}
</li>
{{ end }}
{{ end }}
</ul>
{{ else }}
<div>

View File

@ -1,10 +1,19 @@
{{ define "main" }}
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
{{ else if eq .Data.Singular "category" }}
{{ partial "icon.html" "folder" }}
{{ else }}
{{ partial "icon.html" "filter" }}
{{ end }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ partial "post-metadata/taxonomy.html" . }}
{{ with .Content }}
{{ . }}
{{ end }}