From 1cabc70d75d5a01c6022153d5c9d9607fc328630 Mon Sep 17 00:00:00 2001 From: Renken Date: Fri, 16 Aug 2024 23:32:46 +0200 Subject: [PATCH] build: migrate to hugo-bearblog theme --- .gitmodules | 3 + archetypes/default.md | 6 - assets/main.scss | 341 -------------------- content/{_index.html => _index.md} | 0 content/{misc.md => misc/_index.md} | 0 content/{services.md => services/_index.md} | 0 layouts/_default/single.html | 11 - layouts/blog/rss.xml | 41 --- layouts/blog/section.html | 10 - layouts/blog/single.html | 18 -- layouts/index.html | 55 ---- layouts/partials/foot.html | 6 - layouts/partials/head.html | 14 - themes/hugo-bearblog | 1 + 14 files changed, 4 insertions(+), 502 deletions(-) create mode 100644 .gitmodules delete mode 100644 archetypes/default.md delete mode 100644 assets/main.scss rename content/{_index.html => _index.md} (100%) rename content/{misc.md => misc/_index.md} (100%) rename content/{services.md => services/_index.md} (100%) delete mode 100644 layouts/_default/single.html delete mode 100644 layouts/blog/rss.xml delete mode 100644 layouts/blog/section.html delete mode 100644 layouts/blog/single.html delete mode 100644 layouts/index.html delete mode 100644 layouts/partials/foot.html delete mode 100644 layouts/partials/head.html create mode 160000 themes/hugo-bearblog diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c53b474 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/hugo-bearblog"] + path = themes/hugo-bearblog + url = https://github.com/janraasch/hugo-bearblog.git diff --git a/archetypes/default.md b/archetypes/default.md deleted file mode 100644 index 00e77bd..0000000 --- a/archetypes/default.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: "{{ replace .Name "-" " " | title }}" -date: {{ .Date }} -draft: true ---- - diff --git a/assets/main.scss b/assets/main.scss deleted file mode 100644 index 9b0c5ea..0000000 --- a/assets/main.scss +++ /dev/null @@ -1,341 +0,0 @@ -$black: #080808; - -html { - font-family: sans-serif; - color: $black; -} - -body { - max-width: 920px; - margin: 0 auto; - padding: 1rem; -} - -h1 { - margin-top: 0; - font-size: 1.5rem; - - small { - display: block; - font-size: 1rem; - } -} - -.index { - display: flex; - flex-direction: row; - - .article-list { - flex-grow: 1; - - .article { - margin-bottom: 1rem; - } - - .date { - display: block; - color: #333; - } - } - - aside { - width: 40%; - - img { - display: block; - margin: 0 auto 1rem; - border-radius: 5px; - } - - dt { - font-size: 0.9rem; - } - - dd { - margin-left: 0; - - &:not(:last-child) { - margin-bottom: 0.5rem; - } - } - } - - @media(max-width: 640px) { - aside { - display: none; - } - } -} - -article { - margin: 0 auto; - max-width: 720px; - line-height: 1.3; - - img, video, iframe { - // !important for asciinema frames - display: block !important; - margin: 0 auto !important; - max-width: 90%; - - @media(max-width: 640px) { - max-width: calc(100% - 2rem); - } - } - - sup { - line-height: 1; - } - - .comment { - margin: 2rem auto 0; - max-width: 80%; - color: #333; - } -} - -.footnotes { - font-size: 0.85rem; -} - -footer { - margin-top: 2rem; - text-align: center; - font-size: 0.8rem; - color: #333; -} - -.float-img { - float: right; - display: inline; - padding-left: 1rem; - - @media(max-width: 640px) { - display: block; - float: none; - padding-left: inherit; - } -} - -pre { - background-color: #eee; - padding: 0.25rem 1rem; - margin: 0 -1rem; - max-width: 100%; - overflow-x: auto; - - .cp { - color: #800; - } - - .k { - color: #008; - } - - .kt, .kd, .kc { - color: #44F; - } - - .s { - color: #484; - font-style: italic; - } - - .cm, .c1 { - color: #333; - font-style: italic; - } - - .gi { - color: green; - } - - .gd { - color: red; - } - - .gu { - color: blue; - } -} - -.webring { - margin-top: 2rem; - - h2 { - font-size: 1.2rem; - } - - .articles { - display: flex; - - @media(max-width: 640px) { - flex-direction: column; - } - } - - .title { - margin: 0; - } - - .article { - flex: 1 1 0; - display: flex; - flex-direction: column; - background: #eee; - padding: 0.5rem; - - margin: 0 0.5rem; - - @media(max-width: 640px) { - margin: 0.5rem 0; - } - } - - .article:first-child { - margin-left: 0; - } - - .article:last-child { - margin-right: 0; - } - - .summary { - font-size: 0.8rem; - flex: 1 1 0; - } - - .attribution { - float: right; - font-size: 0.8rem; - color: #555; - line-height: 3; - } - - .date { - color: black; - } -} - -summary { - cursor: pointer; - background-color: #eee; - padding: 0.25rem 1rem; - margin: 0 -1rem; -} - -details[open] { - border-bottom: 1rem solid #eee; - margin: 0 -1rem 1rem; - padding: 0 1rem; -} - -.text-center { - text-align: center; -} - -blockquote { - border-left: 5px solid #777; - background-color: #eee; - padding: 0 1rem; - margin-left: 0; - margin-right: 0; - - blockquote { - margin-right: 0; - margin-left: 0; - } -} - -dl { - display: grid; - grid-template-columns: auto 1fr; - grid-gap: 0.2rem 1rem; - - dt { - font-weight: bold; - grid-column-start: 1; - } - - dd { - grid-column-start: 2; - margin: 0; - } -} - -.alert { - padding: 0.5rem; - border: 1px solid transparent; - margin-bottom: 1rem; - - &.alert-danger { - background: #f8d7da; - color: #721c24; - border-color: #f5c6cb; - } - - &.alert-info { - background: #d1ecf1; - color: #0c5460; - border-color: #bee5eb; - } -} - -table { - color: #333; - background: white; - border: 1px solid grey; - font-size: 12pt; - border-collapse: collapse; -} -table thead th, -table tfoot th { - background: rgba(0,0,0,.1); -} -table caption { - padding:.5em; -} -table th, -table td { - padding: .5em; - border: 1px solid lightgrey; -} -td.red { - background: #F8D7DA; -} -td.yellow { - background: #FFF3CD; -} -td.blue { - background: #CFE2FF; -} - -.error, -.info, -.warn -.todo { - background: #efefef; - border-left-style: solid; - border-left-width: 0.4rem; - border-radius: 0.2rem; - margin-left: 0; - > p { - padding: 0.5rem 1rem; - } -} - -.warn { - border-left-color: #ffbb00; -} - -.info { - border-left-color: #0000ee; -} - -.error { - border-left-color: #ee0000; -} - -.todo { - border-left-color: #eeee00; -} diff --git a/content/_index.html b/content/_index.md similarity index 100% rename from content/_index.html rename to content/_index.md diff --git a/content/misc.md b/content/misc/_index.md similarity index 100% rename from content/misc.md rename to content/misc/_index.md diff --git a/content/services.md b/content/services/_index.md similarity index 100% rename from content/services.md rename to content/services/_index.md diff --git a/layouts/_default/single.html b/layouts/_default/single.html deleted file mode 100644 index cc2c399..0000000 --- a/layouts/_default/single.html +++ /dev/null @@ -1,11 +0,0 @@ -{{ partial "head.html" . }} - -

- {{$.Title}} -

- -
- {{.Content}} -
- -{{ partial "foot.html" }} diff --git a/layouts/blog/rss.xml b/layouts/blog/rss.xml deleted file mode 100644 index ce991d4..0000000 --- a/layouts/blog/rss.xml +++ /dev/null @@ -1,41 +0,0 @@ -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} -{{- $limit := .Site.Config.Services.RSS.Limit -}} -{{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} -{{- end -}} -{{- printf "" | safeHTML }} - - - renken's weblog - https://shione.net - Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} - Hugo -- gohugo.io{{ with .Site.LanguageCode }} - {{.}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} - {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{ with .OutputFormats.Get "RSS" }} - {{ printf "" .Permalink .MediaType | safeHTML }} - {{ end }} - {{ range $pages }} - {{- if .OutputFormats.Get "HTML" -}} - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }} - {{- .Content | html -}} - - {{- end -}} - {{ end }} - - diff --git a/layouts/blog/section.html b/layouts/blog/section.html deleted file mode 100644 index 7819c86..0000000 --- a/layouts/blog/section.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -{{.Title}} -{{ $style := resources.Get "main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }} - - -
- {{.Content}} -
diff --git a/layouts/blog/single.html b/layouts/blog/single.html deleted file mode 100644 index 2a04523..0000000 --- a/layouts/blog/single.html +++ /dev/null @@ -1,18 +0,0 @@ -{{ partial "head.html" . }} - -

- {{$.Title}} - - {{.Date.Format "January 2, 2006"}} - on - {{.Site.Title}} - -

- -
-
- {{.Content}} -
-
- -{{ partial "foot.html" }} diff --git a/layouts/index.html b/layouts/index.html deleted file mode 100644 index 53e503b..0000000 --- a/layouts/index.html +++ /dev/null @@ -1,55 +0,0 @@ -{{ partial "head.html" . }} - -
-
-

{{$.Title}}

- - {{ range (where (where .Site.RegularPages "Section" "blog") "Params.nohtml" "!=" "true") }} - {{- if .OutputFormats.Get "html" }} -
- {{.Date.Format "January 2, 2006"}} - {{.Title}} -
- {{ end }} - {{ end }} -
- - -
- -{{ partial "foot.html" . }} diff --git a/layouts/partials/foot.html b/layouts/partials/foot.html deleted file mode 100644 index 740fcd4..0000000 --- a/layouts/partials/foot.html +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/layouts/partials/head.html b/layouts/partials/head.html deleted file mode 100644 index ca22e36..0000000 --- a/layouts/partials/head.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - {{ if $.Params.noindex }} - - {{ end }} - {{$.Title}} - - - {{ $style := resources.Get "main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }} - - diff --git a/themes/hugo-bearblog b/themes/hugo-bearblog new file mode 160000 index 0000000..efc24bc --- /dev/null +++ b/themes/hugo-bearblog @@ -0,0 +1 @@ +Subproject commit efc24bc5e95f0ccb88051e1a7d95e8a1404e953e