From 7c892580b5c6da844793712a699143c8fb24b90a Mon Sep 17 00:00:00 2001 From: J S Date: Sun, 15 Oct 2023 22:00:24 -0400 Subject: [PATCH] feat[taxonomy] Added tags and categories Added template files for tags and categories. Updated css themes to something crappy. --- layouts/_default/baseof.html | 2 +- layouts/_default/category.html | 13 ++++++ layouts/_default/tag.html | 13 ++++++ layouts/index.html | 72 ++++++++++++++++---------------- layouts/partials/categories.html | 11 +++++ layouts/partials/footer.html | 5 +++ layouts/partials/tags.html | 11 +++++ static/css/style.css | 55 +++++++++++++++--------- 8 files changed, 126 insertions(+), 56 deletions(-) create mode 100644 layouts/_default/category.html create mode 100644 layouts/_default/tag.html create mode 100644 layouts/partials/categories.html create mode 100644 layouts/partials/tags.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 9c49f6b..95a06c5 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,8 +16,8 @@ {{ end }} {{ block "footer" . }} - + {{ end }} diff --git a/layouts/_default/category.html b/layouts/_default/category.html new file mode 100644 index 0000000..1039e45 --- /dev/null +++ b/layouts/_default/category.html @@ -0,0 +1,13 @@ +{{ define "main" }} + +
+

Back to all categories

+
+ +{{ end }} diff --git a/layouts/_default/tag.html b/layouts/_default/tag.html new file mode 100644 index 0000000..08698db --- /dev/null +++ b/layouts/_default/tag.html @@ -0,0 +1,13 @@ +{{ define "main" }} + +
+

Back to all tags

+
+ +{{ end }} diff --git a/layouts/index.html b/layouts/index.html index 548f117..af6411c 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,48 +1,50 @@ -{{ partial "head.html" . }} + {{ partial "head.html" . }} - + -

{{ .Site.Params.Name }}

-

{{ .Site.Params.About| markdownify }}

+

{{ .Site.Params.Name }}

+

{{ .Site.Params.About| markdownify }}

-
{{ .Content }}
+
{{ .Content }}
- - {{ range .Site.Params.profiles }} - {{ partial "profile_link.html" . }} - {{ end }} - - {{ if ne .Site.Params.Resume "" }} - - +
 Resume
+ {{ range .Site.Params.profiles }} + {{ partial "profile_link.html" . }} {{ end }} - - - {{ if ne .Site.Params.Email "" }} - - - {{ end }} - -
 {{ .Site.Params.Email }}
+ + {{ if ne .Site.Params.Resume "" }} + +  Resume + {{ end }} + + + {{ if ne .Site.Params.Email "" }} + +  {{ .Site.Params.Email }} + {{ end }} + + -

Posts

+

Posts

-
- - - {{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }}
- {{ .Title }}
- + + {{ range first (.Site.Params.PostLimit | default 4) (where .Site.RegularPages.ByPublishDate "Section" "posts") }} +
+ {{ .Title }}
+ +
+
+ {{ end }} + +
+

View all posts

+

View all categories

+

View all tags

-
- {{ end }} - - -

View all posts

-
- + + diff --git a/layouts/partials/categories.html b/layouts/partials/categories.html new file mode 100644 index 0000000..8f4e022 --- /dev/null +++ b/layouts/partials/categories.html @@ -0,0 +1,11 @@ +{{ $taxonomy := "categories" }} + +{{ with .GetTerms $taxonomy }} +

+ {{ (site.GetPage $taxonomy).LinkTitle }}: + {{ range $k, $_ := . -}} + {{ if $k }}, {{ end }} + {{ .LinkTitle }} + {{- end }} +

+{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a35cc91..186d51a 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,8 +1,13 @@ diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..d468f02 --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,11 @@ +{{ $taxonomy := "tags" }} + +{{ with .GetTerms $taxonomy }} +

+ {{ (site.GetPage $taxonomy).LinkTitle }}: + {{ range $k, $_ := . -}} + {{ if $k }}, {{ end }} + {{ .LinkTitle }} + {{- end }} +

+{{ end }} diff --git a/static/css/style.css b/static/css/style.css index f39d4ca..bc14911 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -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; +}