1
0
mirror of https://github.com/BBaoVanC/bobatheme.git synced 2025-04-05 09:41:29 -05:00

Support categories again, but hopefully a bit better

This commit is contained in:
BBaoVanC 2022-05-06 20:16:41 -05:00
parent 0888356292
commit 311d846cb8
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
9 changed files with 122 additions and 0 deletions
archetypes
blog
categories
assets/css
config.yaml
layouts
categories
partials
post-meta-item
post-metadata

@ -10,6 +10,9 @@ draft: true
authors:
- {{ with .Site.Author.name }}{{ . }}{{ else }}John Doe{{ end }}
categories:
- archetype-stuff
tags:
- awesome

@ -0,0 +1,15 @@
---
title: {{ replace .Name "-" " " | title }}
---
A short summary of what the category is about.
<!--more-->
Optionally provide more information about the category here. This part will only
show on the category page, not on the category list page.
If you delete this section, DO NOT delete the summary separator (`<!--more-->`)
or else the summary won't be shown.

@ -113,6 +113,7 @@
margin-bottom: 15px;
}
.categories,
.tags,
.series {
margin-top: 10px;
@ -133,6 +134,41 @@
/* Category list format */
.category-list ul {
display: flex;
flex-direction: column;
list-style: none;
gap: 10px;
padding: 0;
}
.category-list li {
display: flex;
flex-direction: row;
gap: 20px;
background-color: var(--background-2);
padding: 8px 12px;
border-radius: 8px;
}
@media (max-width: 360px) {
.category-list li {
flex-direction: column;
gap: 0;
}
}
.category-list li > a,
.category-list li > p {
}
.category-list p {
margin: 0;
}
/* Tags list format */
.tag-list ul {
display: flex;

@ -7,6 +7,7 @@ params:
readingtime: true
taxonomies:
category: categories
tag: tags
author: authors
series: series

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

@ -0,0 +1,27 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "folder" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
<ul>
{{ range . }}
<li>{{ .Render "summary/post" }}</li>
{{ end }}
</ul>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "pagination.html" . }}
{{ end }}

@ -0,0 +1,11 @@
{{ with (.GetTerms "categories") }}
{{ $categories := slice }}
{{ range . }}
{{ $categories = $categories | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="categories" aria-label="{{ i18n "aria_post_meta_categories" }}">
{{ partial "icon.html" "folder" }}
{{ delimit $categories ", " }}
</div>
{{ end }}

@ -25,6 +25,7 @@
{{ partial "post-meta-item/translations.html" . }}
{{ partial "post-meta-item/readingtime.html" . }}
{{ partial "post-meta-item/viewsource.html" . }}
{{ partial "post-meta-item/categories.html" . }}
{{ partial "post-meta-item/tags.html" . }}
</div>
{{ end }}

@ -13,6 +13,7 @@
{{ partial "post-meta-item/translations.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 }}