Compare commits

...

4 Commits

Author SHA1 Message Date
Sean Smits 91d4a313a1
Merge cfe6356bd2 into 33e48f9892 2024-05-01 15:29:19 +07:00
Aditya Telange 33e48f9892
Add anchor link to archive layout headers 2024-05-01 13:56:39 +05:30
woadey cfe6356bd2 Added a "categories" page for further categorization 2024-04-13 22:34:43 -04:00
woadey 1802a746bf Added RSS and Breadcrumbs to "tags"
Reduced tag font-size
2024-04-13 21:26:28 -04:00
4 changed files with 115 additions and 5 deletions

View File

@ -0,0 +1,30 @@
/* Setup grid for Categories */
.categories {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: var(--gap);
}
/* Setup grid on mobile */
@media (max-width: 480px) {
.categories {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
/* CSS for Category Blocks */
.category-entry {
position: relative;
background: var(--entry);
border-radius: var(--radius);
transition: transform 0.1s;
padding: 20px 30px;
}
/* Increase size slightly on hover */
.category-entry:hover {
transform: scale(1.04);
}
.category-entry:active {
transform: scale(1);
}

View File

@ -36,12 +36,21 @@
{{- range $pages.GroupByPublishDate "2006" }}
{{- if ne .Key "0001" }}
<div class="archive-year">
<h2 class="archive-year-header">
{{- replace .Key "0001" "" }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</sup>
{{- $year := replace .Key "0001" "" }}
<h2 class="archive-year-header" id="{{ $year }}">
<a class="archive-header-link" href="#{{ $year }}">
{{- $year -}}
</a>
<sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
</h2>
{{- range .Pages.GroupByDate "January" }}
<div class="archive-month">
<h3 class="archive-month-header">{{- .Key }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</sup></h3>
<h3 class="archive-month-header" id="{{ $year }}-{{ .Key }}">
<a class="archive-header-link" href="#{{ $year }}-{{ .Key }}">
{{- .Key -}}
</a>
<sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
</h3>
<div class="archive-posts">
{{- range .Pages }}
{{- if eq .Kind "page" }}

View File

@ -0,0 +1,58 @@
{{- define "main" }}
{{- if .Title }}
<header class="page-header">
{{- partial "breadcrumbs.html" . }}
<h1>
{{ .Title }}
{{- if and (or (eq .Kind `taxonomy`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
<a href="index.xml" title="RSS" aria-label="RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9" />
<path d="M4 4a16 16 0 0 1 16 16" />
<circle cx="5" cy="19" r="1" />
</svg>
</a>
{{- end }}
</h1>
{{- if .Description }}
<div class="post-description">
{{ .Description }}
</div>
{{- end }}
</header>
{{- end }}
{{- if .Content }}
<div class="post-content">
{{- if not (.Param "disableAnchoredHeadings") }}
{{- partial "anchored_headings.html" .Content -}}
{{- else }}{{ .Content }}{{ end }}
</div>
{{- end }}
<div class="categories">
{{- $type := .Type }}
{{- range $key, $value := .Data.Terms.Alphabetical }}
{{- $name := .Name }}
{{- $count := .Count }}
{{- with site.GetPage (printf "/%s/%s" $type $name) }}
<div class="category-entry">
<header class="entry-header">
<h2>{{- .Name }} <sup style="font-size:10pt">{{ $count }}</sup></h2>
</header>
{{- if (ne (.Param "hideSummary") true) }}
<div class="entry-content">
<p>{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}</p>
</div>
{{- end }}
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</div>
{{- end }}
{{- end }}
</div>
{{- end }}{{/* end main */ -}}

View File

@ -2,7 +2,20 @@
{{- if .Title }}
<header class="page-header">
<h1>{{ .Title }}</h1>
{{- partial "breadcrumbs.html" . }}
<h1>
{{ .Title }}
{{- if and (or (eq .Kind `taxonomy`) (eq .Kind `section`)) (.Param "ShowRssButtonInSectionTermList") }}
<a href="index.xml" title="RSS" aria-label="RSS">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" height="23">
<path d="M4 11a9 9 0 0 1 9 9" />
<path d="M4 4a16 16 0 0 1 16 16" />
<circle cx="5" cy="19" r="1" />
</svg>
</a>
{{- end }}
</h1>
{{- if .Description }}
<div class="post-description">
{{ .Description }}
@ -18,7 +31,7 @@
{{- $count := .Count }}
{{- with site.GetPage (printf "/%s/%s" $type $name) }}
<li>
<a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
<a href="{{ .Permalink }}">{{ .Name }} <sup style="font-size:8pt"><strong>{{ $count }}</strong></sup> </a>
</li>
{{- end }}
{{- end }}