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 }} {{ end }}
{{ block "footer" . }} {{ block "footer" . }}
<script src="/js/dark.js" defer="" ></script>
<!-- More shared code, perhaps a footer but that can be overridden if need be in --> <!-- More shared code, perhaps a footer but that can be overridden if need be in -->
<script src="/js/dark.js" defer="" ></script>
{{ end }} {{ end }}
</body> </body>
</html> </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,48 +1,50 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
{{ partial "head.html" . }} {{ partial "head.html" . }}
<body> <body>
<h1>{{ .Site.Params.Name }}</h1> <h1>{{ .Site.Params.Name }}</h1>
<h4>{{ .Site.Params.About| markdownify }}</h4> <h4>{{ .Site.Params.About| markdownify }}</h4>
<div>{{ .Content }}</div> <div>{{ .Content }}</div>
<table> <table>
{{ range .Site.Params.profiles }} {{ range .Site.Params.profiles }}
{{ partial "profile_link.html" . }} {{ partial "profile_link.html" . }}
{{ end }}
<tr>
{{ if ne .Site.Params.Resume "" }}
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td>
<td>&nbsp;<a href="/resume/{{ .Site.Params.Resume }}" target="_blank">Resume</a></td>
{{ end }} {{ end }}
</tr> <tr>
<tr> {{ if ne .Site.Params.Resume "" }}
{{ if ne .Site.Params.Email "" }} <td><i class="fas fa-file-alt" aria-hidden="true"></i></td>
<td><i class="fas fa-envelope" aria-hidden="true"></i></td> <td>&nbsp;<a href="/resume/{{ .Site.Params.Resume }}" target="_blank">Resume</a></td>
<td>&nbsp;<code>{{ .Site.Params.Email }}</code></td> {{ end }}
{{ end }} </tr>
</tr> <tr>
</table> {{ if ne .Site.Params.Email "" }}
<td><i class="fas fa-envelope" aria-hidden="true"></i></td>
<td>&nbsp;<code>{{ .Site.Params.Email }}</code></td>
{{ end }}
</tr>
</table>
<h3>Posts</h3> <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> <div>
<a href="{{ .Permalink }}">{{ .Title }}</a><br /> <!-- orders content according to the "publishdate" field in front matter -->
<time>{{ .Date.Format "January 2, 2006" }}</time> {{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }}
<div>
<a href="{{ .Permalink }}">{{ .Title }}</a><br />
<time>{{ .Date.Format "January 2, 2006" }}</time>
</div>
<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> </div>
<br /> </body>
{{ end }}
<h3><a href="posts/">View all posts</a></h3>
</div>
</body>
<script src="/js/dark.js" defer="" ></script>
</html> </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> <footer>
<div> <div>
<h3><a href="{{ .Site.BaseURL }}posts">Back to all posts</a></h3> <h3><a href="{{ .Site.BaseURL }}posts">Back to all posts</a></h3>
</div> </div>
<hr> <hr>
<p>Go <a href="{{ .Site.BaseURL }}/index.xml">here</a> for an RSS feed.</p> <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> <script src="/js/dark.js" defer="" ></script>
</footer> </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 { body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
line-height: 1.5em; line-height: 1.5em;
font-size: 2.1em; font-size: 2.1em;
color: #222; color: #222;
max-width: 70%; max-width: 70%;
padding: 2rem; padding: 2rem;
margin: auto; margin: auto;
background: #fafafa; background: #fafafa;
overscroll-behavior-y: none; overscroll-behavior-y: none;
} }
img { img {
max-width: 100%; } max-width: 100%; }
a { a {
color: #0074D9; } color: #0074D9; }
h1, h2, strong { h1, h2, strong {
color: #111; } color: #111; }
h1 { h1 {
font-size: 1.6em; } font-size: 1.6em; }
h2 { h2 {
font-size: 1.2em; } font-size: 1.2em; }
h3 { h3 {
font-size: 1.1em; } font-size: 1.1em; }
.muted { .muted {
color: #aaa; color: #aaa;
text-decoration: none; } text-decoration: none; }
.small { .small {
font-size: .8em; } font-size: .8em; }
hr { hr {
border: 0px; border: 0px;
border: 1px solid #eee; 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;
}