From b409a5c5ffcaffe074b24082f16be1843da78456 Mon Sep 17 00:00:00 2001 From: Ethan Yoo Date: Fri, 1 Oct 2021 12:49:55 -0400 Subject: [PATCH] Initial commit --- LICENSE | 20 ++++++++++++++++ README.md | 41 ++++++++++++++++++++++++++++++++ archetypes/default.md | 19 +++++++++++++++ layouts/404.html | 6 +++++ layouts/_default/baseof.html | 39 ++++++++++++++++++++++++++++++ layouts/_default/list.html | 21 ++++++++++++++++ layouts/_default/permalink.html | 12 ++++++++++ layouts/_default/rss.xml | 39 ++++++++++++++++++++++++++++++ layouts/_default/single.html | 16 +++++++++++++ layouts/_default/summary.html | 11 +++++++++ layouts/index.html | 9 +++++++ layouts/partials/footer.html | 9 +++++++ layouts/partials/header.html | 11 +++++++++ layouts/partials/pagination.html | 9 +++++++ layouts/partials/sidebar.html | 12 ++++++++++ static/css/style.css | 21 ++++++++++++++++ static/img/CC-BY-SA.svg | 1 + static/img/built-with-love.svg | 1 + theme.toml | 17 +++++++++++++ 19 files changed, 314 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 archetypes/default.md create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/permalink.html create mode 100644 layouts/_default/rss.xml create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/summary.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/pagination.html create mode 100644 layouts/partials/sidebar.html create mode 100644 static/css/style.css create mode 100644 static/img/CC-BY-SA.svg create mode 100644 static/img/built-with-love.svg create mode 100644 theme.toml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8abc32a --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2021 Ethan Yoo + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..07f0da0 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# Geronimo + +This repository hosts my modified version of [smol](https://github.com/colorchestra/smol/), a theme for Hugo. + +# To browse the source code + +This project is pushed to two remote repositories. + +* [Amolith](https://secluded.site/) maintains [NixNet](https://nixnet.services/) as an individual, hosting "a variety of services that are available for anyone to use free of charge." These services include [a Gitea instance.](https://git.nixnet.services/ethan) +* [Framasoft](https://framasoft.org/) is a French nonprofit organization actively engaged in the free culture movement and host to [a GitLab instance.](https://framagit.org/ethan) + +# To submit feedback, suggest specific changes, etc. + +* Email +* [Issue tracker on Framagit](https://framagit.org/ethan/hugo-src/-/issues/) for both theming and website issues + +# Licensing + +SPDX-License-Identifier: `MIT` + +[MIT (Expat) License](https://choosealicense.com/licenses/mit/) + +Copyright © 2021 Ethan Yoo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..6786c24 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,19 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +tags: ['Black Lives Matter', 'Climate crisis', 'Disability', 'Education', 'Electronic Frontier Foundation (EFF)', 'Free culture', 'Free software', 'Gender', 'Health', 'Mental health', 'Miscellaneous', 'Public policy'] +categories: ['August 2021'] +year: ['2021'] +slug: Hugo will hyphenate it +description: "I add a question, quote, or summary." +--- + +[Last, F. (Year, Month Date). Title. *The New York Times.*](https://www.nytimes.com/) + +> *Block quote* + +[Last, F. (Year, Month Date). *Title.* National Public Radio.](https://text.npr.org/) + +> *Block quote* + +Consider adding related links, pictures, or posts! diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..218d5d6 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,6 @@ +{{ define "main" }} +
+
+ Page not found +
+{{- end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..f47581e --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,39 @@ + + + + + + + {{ .Title }} | {{ .Site.Title }} + + {{ with .Site.Params.author }}{{ end }} + {{ with .Params.date }}{{ else }}{{end}} +{{- with .Description }} + + +{{ else }} + + +{{- end }} + +{{- with .RelPermalink }} + + +{{- end }} + + + +{{- with .OutputFormats.Get "RSS" -}}{{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}{{ end }} + + + + + {{- if not .IsHome }}{{ partial "header" . }}{{ end }} + {{- if .IsHome }}{{- block "header" . }}{{ end }} + {{- end }} + {{- block "main" . }}{{ end }} + + {{ if not .IsHome }}{{ partial "footer" . }} + {{ end }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..ba9956e --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,21 @@ +{{ define "main" }} +
+{{ $listtitle := .Title }}{{ if or .Title .Content }} +
+ {{ with .Title }}

{{ . }}

{{ end }} + {{ with .Content }}
{{ . }}
{{ end }} +
+{{- end }} + +

Because I post current events, it might be helpful to browse by month or by tag.

+ + + +
+{{ end }} diff --git a/layouts/_default/permalink.html b/layouts/_default/permalink.html new file mode 100644 index 0000000..7154f68 --- /dev/null +++ b/layouts/_default/permalink.html @@ -0,0 +1,12 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+
+ {{ .Content }} +
+
+
+{{ partial "sidebar.html" . }} +

I last updated this page with commit {{ .GitInfo.AbbreviatedHash }} on {{ .Lastmod.Format "January 2, 2006" }}.

+{{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..025f615 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,39 @@ +{{- $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 }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + 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 MST" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..f737372 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,16 @@ +{{ define "main" }} +
+
+

{{ .Title }}

+ + Tags: +{{ range .Params.tags }} + {{ . }}. +{{ end }} +
+ {{ .Content }} +
+
+
+{{ partial "sidebar.html" . }} +{{ end }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html new file mode 100644 index 0000000..95c8032 --- /dev/null +++ b/layouts/_default/summary.html @@ -0,0 +1,11 @@ +
+

{{ .Title }}

+ + {{ range .Params.tags }} + {{ . }} + {{ end }} +
+ {{ .Summary }} + {{ if .Truncated }}Read more?{{ end }} +
+
diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..cd86013 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,9 @@ +{{ define "main" }} +
+ {{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) }} + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ end }} + {{ partial "pagination.html" . }} +
+{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..d796548 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,9 @@ + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..d3ba539 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,11 @@ +
+

{{ .Site.Title }}

+
{{ .Site.Params.subtitle }}
+ +{{- end }} +
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..379afcc --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,9 @@ +
+{{ if .Paginator.HasPrev }} + Previous +{{ end }} +{{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }} +{{ if .Paginator.HasNext }} + Next page +{{ end }} +
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..4b242c6 --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,12 @@ + diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..e30d3c3 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,21 @@ +/* Body */ +a{text-decoration:none;} +body{background:#10151a;color:#d3dae3;font:1em/1.5 sans-serif;margin:2em auto;max-width:50em;padding:0 2em;} +header a:link, footer a:link {color:#FFF;} +a:link{color:#ace;}a:hover {background:#2b5278;text-decoration:underline dotted;border:1px solid;}a:visited{color:#FFF;} +main h1,h2{text-align:center;} +h1{font-size:2.1em;}h2{font-size:1.8em;}h3{font-size:1.5em;} +article, main {padding:4px 2px;} +blockquote{padding:0.5em 1.5em;background:#EEE;color:#000;border-radius:4px;} +code{background:#000;font:1em/1.5 monospace, monospace;padding:2px} + +/* Light theme */ +@media(prefers-color-scheme:light){body{background:#333;color:#FFF;}main a:link{color:#bdf;}main a:visited{color:#ccf;}} + +/* Classes */ +a.link-000{background:#000;border:none;} +.center{display:block;margin-left:auto;margin-right:auto;text-align:center;} +img[src$='#center']{display:block;margin-left:auto;margin-right:auto;} +.post-title{line-height:1.8;} +.subtitle{float:right;} +html{overflow-y:scroll;visibility:visible;opacity:1;} diff --git a/static/img/CC-BY-SA.svg b/static/img/CC-BY-SA.svg new file mode 100644 index 0000000..d502299 --- /dev/null +++ b/static/img/CC-BY-SA.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/img/built-with-love.svg b/static/img/built-with-love.svg new file mode 100644 index 0000000..58de8e2 --- /dev/null +++ b/static/img/built-with-love.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..bfe1db9 --- /dev/null +++ b/theme.toml @@ -0,0 +1,17 @@ +name = "geronimo" +license = "MIT" +licenselink = "https://framagit.org/ethan/geronimo/~/blob/main/LICENSE" +description = "Hugo theme based on smol" +homepage = "https://framagit.org/ethan/geronimo" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "Ethan Yoo" + homepage = "https://ethanyoo.com/" + +[original] + name = "morph" + homepage = "https://morph.sh/" + repo = "https://github.com/colorchestra/smol"