feat[taxonomy] Added tags and categories
Added template files for tags and categories. Updated css themes to something crappy.
This commit is contained in:
parent
657f0a0474
commit
7c892580b5
@ -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>
|
||||
|
13
layouts/_default/category.html
Normal file
13
layouts/_default/category.html
Normal 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
13
layouts/_default/tag.html
Normal 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 }}
|
@ -1,48 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
{{ partial "head.html" . }}
|
||||
{{ partial "head.html" . }}
|
||||
|
||||
<body>
|
||||
<body>
|
||||
|
||||
<h1>{{ .Site.Params.Name }}</h1>
|
||||
<h4>{{ .Site.Params.About| markdownify }}</h4>
|
||||
<h1>{{ .Site.Params.Name }}</h1>
|
||||
<h4>{{ .Site.Params.About| markdownify }}</h4>
|
||||
|
||||
<div>{{ .Content }}</div>
|
||||
<div>{{ .Content }}</div>
|
||||
|
||||
<table>
|
||||
{{ range .Site.Params.profiles }}
|
||||
{{ partial "profile_link.html" . }}
|
||||
{{ end }}
|
||||
<tr>
|
||||
{{ if ne .Site.Params.Resume "" }}
|
||||
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td>
|
||||
<td> <a href="/resume/{{ .Site.Params.Resume }}" target="_blank">Resume</a></td>
|
||||
<table>
|
||||
{{ range .Site.Params.profiles }}
|
||||
{{ partial "profile_link.html" . }}
|
||||
{{ end }}
|
||||
</tr>
|
||||
<tr>
|
||||
{{ if ne .Site.Params.Email "" }}
|
||||
<td><i class="fas fa-envelope" aria-hidden="true"></i></td>
|
||||
<td> <code>{{ .Site.Params.Email }}</code></td>
|
||||
{{ end }}
|
||||
</tr>
|
||||
</table>
|
||||
<tr>
|
||||
{{ if ne .Site.Params.Resume "" }}
|
||||
<td><i class="fas fa-file-alt" aria-hidden="true"></i></td>
|
||||
<td> <a href="/resume/{{ .Site.Params.Resume }}" target="_blank">Resume</a></td>
|
||||
{{ end }}
|
||||
</tr>
|
||||
<tr>
|
||||
{{ if ne .Site.Params.Email "" }}
|
||||
<td><i class="fas fa-envelope" aria-hidden="true"></i></td>
|
||||
<td> <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>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a><br />
|
||||
<time>{{ .Date.Format "January 2, 2006" }}</time>
|
||||
<!-- orders content according to the "publishdate" field in front matter -->
|
||||
{{ 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>
|
||||
<br />
|
||||
{{ end }}
|
||||
|
||||
|
||||
<h3><a href="posts/">View all posts</a></h3>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
|
||||
<script src="/js/dark.js" defer="" ></script>
|
||||
</html>
|
||||
|
11
layouts/partials/categories.html
Normal file
11
layouts/partials/categories.html
Normal 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 }}
|
@ -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>
|
||||
|
11
layouts/partials/tags.html
Normal file
11
layouts/partials/tags.html
Normal 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 }}
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user