feat[taxonomy] Added tags and categories

Added template files for tags and categories.
Updated css themes to something crappy.
This commit is contained in:
Judah Sotomayor 2023-10-15 22:00:24 -04:00
parent 657f0a0474
commit 7c892580b5
8 changed files with 126 additions and 56 deletions

View File

@ -16,8 +16,8 @@
{{ end }}
{{ block "footer" . }}
<script src="/js/dark.js" defer="" ></script>
<!-- More shared code, perhaps a footer but that can be overridden if need be in -->
<script src="/js/dark.js" defer="" ></script>
{{ end }}
</body>
</html>

View File

@ -0,0 +1,13 @@
{{ define "main" }}
<ul>
{{range .Data.Pages}}
<li>
<a href="{{.RelPermalink}}">{{.Title}}</a>
</li>
{{end}}
</ul>
<div>
<h3><a href="{{ .Site.BaseURL }}categories">Back to all categories</a></h3>
</div>
{{ end }}

13
layouts/_default/tag.html Normal file
View File

@ -0,0 +1,13 @@
{{ define "main" }}
<ul>
{{range .Data.Pages}}
<li>
<a href="{{.RelPermalink}}">{{.Title}}</a>
</li>
{{end}}
</ul>
<div>
<h3><a href="{{ .Site.BaseURL }}tags">Back to all tags</a></h3>
</div>
{{ end }}

View File

@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
{{ partial "head.html" . }}
{{ partial "head.html" . }}
<body>
<body>
<h1>{{ .Site.Params.Name }}</h1>
<h4>{{ .Site.Params.About| markdownify }}</h4>
@ -30,7 +30,6 @@
<h3>Posts</h3>
<div>
<!-- orders content according to the "publishdate" field in front matter -->
{{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }}
<div>
@ -40,9 +39,12 @@
<br />
{{ end }}
<hr>
<h3><a href="posts/">View all posts</a></h3>
<h3><a href="categories/"> View all categories</a></h3>
<h3><a href="tags/"> View all tags</a></h3>
</div>
</body>
</body>
<script src="/js/dark.js" defer="" ></script>
</html>

View File

@ -0,0 +1,11 @@
{{ $taxonomy := "categories" }}
{{ with .GetTerms $taxonomy }}
<p class="taglist">
{{ (site.GetPage $taxonomy).LinkTitle }}:
{{ range $k, $_ := . -}}
{{ if $k }}, {{ end }}
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end }}
</p>
{{ end }}

View File

@ -1,8 +1,13 @@
<footer>
<div>
<h3><a href="{{ .Site.BaseURL }}posts">Back to all posts</a></h3>
</div>
<hr>
<p>Go <a href="{{ .Site.BaseURL }}/index.xml">here</a> for an RSS feed.</p>
{{partial "tags.html" .}}
{{partial "categories.html" .}}
<script src="/js/dark.js" defer="" ></script>
</footer>

View File

@ -0,0 +1,11 @@
{{ $taxonomy := "tags" }}
{{ with .GetTerms $taxonomy }}
<p class="taglist">
{{ (site.GetPage $taxonomy).LinkTitle }}:
{{ range $k, $_ := . -}}
{{ if $k }}, {{ end }}
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{- end }}
</p>
{{ end }}

View File

@ -1,42 +1,57 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.5em;
font-size: 2.1em;
color: #222;
max-width: 70%;
padding: 2rem;
margin: auto;
background: #fafafa;
overscroll-behavior-y: none;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.5em;
font-size: 2.1em;
color: #222;
max-width: 70%;
padding: 2rem;
margin: auto;
background: #fafafa;
overscroll-behavior-y: none;
}
img {
max-width: 100%; }
max-width: 100%; }
a {
color: #0074D9; }
color: #0074D9; }
h1, h2, strong {
color: #111; }
color: #111; }
h1 {
font-size: 1.6em; }
font-size: 1.6em; }
h2 {
font-size: 1.2em; }
font-size: 1.2em; }
h3 {
font-size: 1.1em; }
font-size: 1.1em; }
.muted {
color: #aaa;
text-decoration: none; }
color: #aaa;
text-decoration: none; }
.small {
font-size: .8em; }
font-size: .8em; }
hr {
border: 0px;
border: 1px solid #eee;
border: 0px;
border: 1px solid #eee;
}
highlight {
}
pre code span span{
word-break: break-all;
white-space: pre-wrap;
}
.taglist {
border: solid;
border-weight: 2pt;
padding: 4pt;
}