From 0d78601fd9d7ef57661125049434845599fdc22a Mon Sep 17 00:00:00 2001 From: jpk Date: Thu, 23 Mar 2023 11:49:13 +0100 Subject: [PATCH] Hax0r hugo theme --- archetypes/default.md | 4 +- archtypes/links.md | 2 +- archtypes/posts.md | 2 +- assets/css/_base.scss | 92 +++++++++++++++++++++++++++ assets/css/components/_tag_lists.scss | 14 ++++ assets/css/main.scss | 22 +++++++ layouts/_default/baseof.html | 1 + layouts/_default/list.html | 2 +- layouts/_default/single.html | 36 +++++++++-- layouts/_default/terms.html | 12 ++-- layouts/partials/footer.html | 7 +- layouts/partials/head.html | 4 +- layouts/partials/header.html | 4 +- layouts/partials/menu.html | 39 ++++++++++++ layouts/partials/metadata.html | 11 ---- static/css/style.css | 82 ------------------------ theme.toml | 23 ++++--- 17 files changed, 231 insertions(+), 126 deletions(-) create mode 100644 assets/css/_base.scss create mode 100644 assets/css/components/_tag_lists.scss create mode 100644 assets/css/main.scss create mode 100644 layouts/partials/menu.html delete mode 100644 layouts/partials/metadata.html delete mode 100644 static/css/style.css diff --git a/archetypes/default.md b/archetypes/default.md index ac36e06..a845151 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -1,2 +1,2 @@ -+++ -+++ +--- +--- diff --git a/archtypes/links.md b/archtypes/links.md index c1a80a9..08a95f6 100644 --- a/archtypes/links.md +++ b/archtypes/links.md @@ -1,6 +1,6 @@ --- title: Link collection -author: JPK +author: GoatFOo date: {{ .Date }} categories: tags: diff --git a/archtypes/posts.md b/archtypes/posts.md index d1094f4..de6eb13 100644 --- a/archtypes/posts.md +++ b/archtypes/posts.md @@ -1,6 +1,6 @@ --- title: "{{ replace .Name "-" " " | title }}" -author: JPK +author: GoatFoo date: {{ .Date }} categories: tags: diff --git a/assets/css/_base.scss b/assets/css/_base.scss new file mode 100644 index 0000000..88dd176 --- /dev/null +++ b/assets/css/_base.scss @@ -0,0 +1,92 @@ +html { + font-family: "Lucida Console", "monospace"; + font-size: 14px; + box-sizing: border-box; +} + +body { + margin: 0px; +} + +*, *:before, *:after { + font-family: inherit; + font-size: inherit; + box-sizing: inherit; +} + +body { + background-color: $background-color; + color: $text-color; +} + +article header { + font-size: smaller; +} + +a { + color: $anchor-color; + text-decoration: none; +} + +pre { + font-size: smaller; + margin: 2em; + padding: 0.4em; + border: 1px dashed $border-color; + overflow: auto; + color: #f8f8f2; + background-color: #272822; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; +} + +img { + display: block; + margin-left: auto; + margin-right: auto; + max-width: 80%; + height: auto; +} + +a.active { + color: $anchor-active-color; +} + +a:hover { + color: $anchor-hover-color; + text-decoration: underline; +} + +ul { + list-style: square; +} + +nav ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +nav ul li { + display: inline; +} + +.boxed { + border-bottom: 1px dashed $border-color; + width: 1024px; + margin: auto; + padding: 1em; +} + +@media only screen and (max-width: 1024px) { + .goatpr0n-wide { + display: none; + } +} + +@media only screen and (min-width: 1024px) { + .goatpr0n-small { + display: none; + } +} diff --git a/assets/css/components/_tag_lists.scss b/assets/css/components/_tag_lists.scss new file mode 100644 index 0000000..57a4727 --- /dev/null +++ b/assets/css/components/_tag_lists.scss @@ -0,0 +1,14 @@ +.tag-lists { + list-style: none; + padding-left: 0; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + line-height: 2.5rem; +} + +.tag-lists-item { + --size: attr(data-weight number, 2); + font-size: calc(var(--size) * 1rem); +} diff --git a/assets/css/main.scss b/assets/css/main.scss new file mode 100644 index 0000000..6638d4a --- /dev/null +++ b/assets/css/main.scss @@ -0,0 +1,22 @@ +/* +https://coolors.co/04080f-507dbc-a1c6ea-bbd1ea-dae3e5 +*/ + +$background-color: {{ .Site.Params.style.backgroundColor | default "#04080f" }}; +$text-color: {{ .Site.Params.style.textColor | default "#dae3e5" }}; +$border-color: {{ .Site.Params.style.borderColor | default "#dae3e5" }}; +$anchor-color: {{ .Site.Params.style.anchorColor | default "#507dbc" }}; +$anchor-active-color: {{ .Site.Params.style.anchorActiveColor | default "#bbd1ea" }}; +$anchor-hover-color: {{ .Site.Params.style.anchorHoverColor | default "#bbd1ea" }}; +$pre-text-color: {{ .Site.Params.style.preTextColor | default "#f8f8f2" }}; +$pre-background-color: {{ .Site.Params.style.preBackgroundColor | default "#272822" }}; + +@charset "UTF-8"; +@font-face { + font-family: 'DOS'; + src: url("./fonts/Perfect DOS VGA 437 Win.ttf"); +} + +@import "base"; + +@import "components/tag_lists"; diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a6223b0..4d3bb9f 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -3,6 +3,7 @@ {{- partial "head.html" . -}} {{- partial "header.html" . -}} +
{{- block "main" . }}{{- end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c03e8e8..e95d4d7 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,7 +3,7 @@

diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 94b2b88..686dc6c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,7 +1,35 @@ {{ define "main" }}
-

{{ .Title }}

-{{ partial "metadata.html" . }} -

-{{ .Content }} + +
+
+

{{ .Title }}

+ {{- if ne .Type "page" }} + + {{- end }} +
+
+ +
+ {{ .Content }} +
+
{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index f20dafc..1eb2a2c 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -1,12 +1,10 @@ {{ define "main" }} -
-
    +
    + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index f0ef4ea..6eac8e1 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1 +1,6 @@ - + + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 7badc17..b290e96 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,7 +1,9 @@ + - + {{ $style := resources.Get "css/main.scss" | resources.ExecuteAsTemplate "css/main.scss" . | resources.ToCSS | resources.Minify | resources.Fingerprint -}} + {{ $title := print .Site.Title " | " .Title }} {{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} {{ $title }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9129d15..75a66e2 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -15,8 +15,6 @@ diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000..daa42b1 --- /dev/null +++ b/layouts/partials/menu.html @@ -0,0 +1,39 @@ +{{- $page := .page }} +{{- $menuID := .menuID }} + +{{- with index site.Menus $menuID }} + +{{- end }} + + {{ range .Site.Menus.main }} + {{ end }} + +{{- define "partials/inline/menu/walk.html" }} + {{- $page := .page }} + {{- range .menuEntries }} + {{- $attrs := dict "href" .URL}} + {{- if $page.IsMenuCurrent .Menu . }} + {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} + {{- else if $page.HasMenuCurrent .Menu .}} + {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} + {{- end }} +
  • + [ {{ or (T .Identifier) .Name | safeHTML }} + {{- with .Children }} +
      + {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }} +
    + {{- end }} + ]
  • + {{- end }} +{{- end }} diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html deleted file mode 100644 index 65a164f..0000000 --- a/layouts/partials/metadata.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ $dateTime := .PublishDate.Format "2006-01-02" }} -{{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} - - -{{ with .Params.tags }} - -{{ range . }} -{{ $href := print (absURL "tags/") (urlize .) }} -{{ . }} -{{ end }} -{{ end }} diff --git a/static/css/style.css b/static/css/style.css deleted file mode 100644 index fb25e91..0000000 --- a/static/css/style.css +++ /dev/null @@ -1,82 +0,0 @@ -/* -Base Color -#0f1111 - -Monochromatic - 100 -#343b3b - -Monochromatic - 200 -#5a6666 - -Monochromatic - 300 -#7f9090 - -Monochromatic - 400 -#a5bbbb - -Monochromatic - 500 -#cae5e5 -*/ -@charset "UTF-8"; -@font-face { - font-family: 'DOS'; - src: url("./fonts/Perfect DOS VGA 437 Win.ttf"); -} - -html { - font-family: "Lucida Console", "monospace"; - font-size: 14px; - box-sizing: border-box; -} - -body { - margin: 0px; -} - -*, *:before, *:after { - font-family: inherit; - font-size: inherit; - box-sizing: inherit; -} - -body { - background-color: #0f1111; - color: #7f9090; -} - -a { - color: #cae5e5; - text-decoration: none; -} - -a:active { - color: #a5bbbb; -} - -a:hover { - color: #a5bbbb; - text-decoration: underline; -} - -ul { - list-style: square; -} - -.boxed { - border-bottom: 2px dotted #343b3b; - width: 1024px; - margin: auto; - padding: 1em; -} - -@media only screen and (max-width: 1024px) { - .goatpr0n-wide { - display: none; - } -} - -@media only screen and (min-width: 1024px) { - .goatpr0n-small { - display: none; - } -} diff --git a/theme.toml b/theme.toml index 40cbb12..d279fea 100644 --- a/theme.toml +++ b/theme.toml @@ -1,15 +1,14 @@ -name = "tui" -description = "hax0r" +name = "hax0r" +description = "hax0r lulz" homepage = "https://localhost" license = "MIT" licenselink = "https://localhost" -# tags = ["blog", "retro", "dos", "terminal"] -# features = [ -# "minimalistic blog", -# ] -# min_version = 0.55 -# -# [author] -# name = "GoatFoo" -# homepage = "https://goatpr0n.farm" -# +tags = ["blog", "minimalistic", "dark", "ascii"] +features = [ + "minimalistic blog", +] +min_version = 0.55 + +[author] + name = "GoatFoo" + homepage = "https://goatpr0n.farm"