From 4c365d552e3d8dc41a54aea338d10d10c15384d5 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 20 Nov 2019 19:56:22 +0100 Subject: [PATCH] Initial commit. --- README.adoc | 29 ++++++++++++++++++ archetypes/default.md | 15 ++++++++++ archetypes/posts.md | 14 +++++++++ layouts/_default/baseof.html | 28 ++++++++++++++++++ layouts/_default/list.html | 17 +++++++++++ layouts/_default/rss.xml | 36 ++++++++++++++++++++++ layouts/_default/single.html | 6 ++++ layouts/_default/terms.html | 17 +++++++++++ layouts/index.html | 18 +++++++++++ layouts/partials/footer.html | 25 ++++++++++++++++ layouts/partials/header.html | 17 +++++++++++ layouts/partials/pagination.html | 48 ++++++++++++++++++++++++++++++ layouts/partials/post_meta.html | 18 +++++++++++ static/assets/style.css | 51 ++++++++++++++++++++++++++++++++ theme.toml | 17 +++++++++++ 15 files changed, 356 insertions(+) create mode 100644 README.adoc create mode 100644 archetypes/default.md create mode 100644 archetypes/posts.md create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/rss.xml create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/terms.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/post_meta.html create mode 100644 static/assets/style.css create mode 100644 theme.toml diff --git a/README.adoc b/README.adoc new file mode 100644 index 0000000..5521172 --- /dev/null +++ b/README.adoc @@ -0,0 +1,29 @@ += nocolor + +A Hugo theme with no predefined colors. If you want source code highlighting, +take a look at https://github.com/mozmorris/tomorrow-pygments[]. + +The theme is based on https://github.com/spookey/slick[Slick]. + +== Installation + +Just download the theme or clone it into your `themes/` directory: + +[source,shell] +---- +cd themes && git clone https://schlomp.space/tastytea/hugo-theme-nocolor.git +---- + +Then reference it in your `config`: + +[source,toml] +---- +theme = "nocolor" +---- + +Or when building the site, pass it in to the CLI: + +[source,shell] +---- +hugo -t nocolor +---- diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..b554783 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,15 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +slug: {{ replace .TranslationBaseName "_" "-" | urlize }} +description: null +date: {{ .Date }} +type: {{ .Type }} +draft: true +menu: main +categories: +- General +tags: +- +series: +- +--- diff --git a/archetypes/posts.md b/archetypes/posts.md new file mode 100644 index 0000000..3704e6e --- /dev/null +++ b/archetypes/posts.md @@ -0,0 +1,14 @@ +--- +title: "{{ replace .TranslationBaseName "-" " " | title }}" +slug: {{ replace .TranslationBaseName "_" "-" | urlize }} +description: null +date: {{ .Date }} +type: {{ .Type }} +draft: true +categories: +- General +tags: +- +series: +- +--- diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..5561d88 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,28 @@ + + + + + {{ if and (.Title) (not (eq .Title .Site.Title)) }}{{ .Title }} | {{ end }}{{ .Site.Title }} + + + + + {{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end -}} + {{ if .Site.Params.schema }}{{ template "_internal/schema.html" . }}{{ end -}} + {{ if .Site.Params.twitter_cards }}{{ template "_internal/twitter_cards.html" . }}{{ end -}} + {{ .Hugo.Generator }} + {{- with .Site.RSSLink }} + + {{- end }} + {{- $favicon := .Site.Params.favicon | default "favicon.ico" }} + {{- $favtype := cond (eq (path.Ext $favicon) ".png") "image/png" "image/x-icon" }} + + + + + +{{ partial "header.html" . }} +{{ block "main" . }}{{ end }} +{{ partial "footer.html" . }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..d03ccab --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,17 @@ +{{- define "main" }} +
+

{{ .Title }}:

+ +
+{{ partial "pagination.html" . }} +{{- end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..a651b6e --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,36 @@ + + + {{ 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 {{ .Hugo.Version }} -- gohugo.io + {{- with .Site.LanguageCode }} + {{ . }} + {{- end }} + {{- with .Site.Author.email }} + {{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }} + {{ . }}{{ 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 .Data.Pages }} + + {{ .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 }} + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..b4dcb8f --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,6 @@ +{{- define "main" }} +

{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}

+ {{ partial "post_meta.html" . }} + +
{{ .Content }}
+{{- end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..d921b37 --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,17 @@ +{{- define "main" }} +
+

{{ .Title }}:

+ +
+{{- end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..81b6a86 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,18 @@ +{{- define "main" }} +{{ $showfull := cond (isset $.Site.Params "showfullcontent") $.Site.Params.showfullcontent false }} +{{- range $idx, $_ := .Paginator.Pages }} +

+

+

+ {{ if .Draft }}DRAFT: {{ end }} + {{ .Title }} +

+ {{ partial "post_meta.html" . }} +
+
+ {{ cond $showfull .Content .Summary }} +
+

+{{- end }} +{{ partial "pagination.html" . }} +{{- end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..cfffd9e --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,25 @@ + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..1867b4f --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,17 @@ +
+ {{ .Site.Title }} + {{- with .Site.Params.subtitle }} + – {{ . }} + {{- end }} +
+ diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..77f265e --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,48 @@ +{{ $pag := .Paginator }} + + diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html new file mode 100644 index 0000000..751743e --- /dev/null +++ b/layouts/partials/post_meta.html @@ -0,0 +1,18 @@ +
+ + + {{- range $taxo := (slice "Categories" "Series" "Tags") }} + {{- $elems := $.Param $taxo }} + {{- if $elems }} + {{ $taxo }}: [ + {{- range $name := $elems }} + {{- with $.Site.GetPage (lower (printf "/%s/%s" $taxo (urlize $name))) }} + {{ $name }} + {{- end }} + {{- end }} + ] + {{- end }} + {{- end }} +
diff --git a/static/assets/style.css b/static/assets/style.css new file mode 100644 index 0000000..3f8e2c3 --- /dev/null +++ b/static/assets/style.css @@ -0,0 +1,51 @@ +html +{ + font-family: serif; +} + +body +{ + max-width: 100ch; + margin: auto; +} + +.header +{ + font-size: 150%; + margin-bottom: 1em; + font-family: sans-serif; +} +.header .description +{ + font-size: 75%; +} + +.nav ul, .pagination ul +{ + font-family: sans-serif; + margin: 0; + padding: 0; + display:inline-block; +} + +.nav li, .pagination li +{ + list-style: none; + display:inline-block; + margin-right: 0.5em; + padding: 0; +} + +h1, h2, h3, h4, h5, h6, h7, h8 +{ + font-family: sans-serif; +} + +.footer +{ + margin-top: 1em; +} +.copyright +{ + margin-top: 1em; +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..f03fb2a --- /dev/null +++ b/theme.toml @@ -0,0 +1,17 @@ +name = "nocolor" +license = "MIT" +licenselink = "http://opensource.org/licenses/MIT" +description = "A Hugo theme with no predefined colors." +homepage = "https://schlomp.space/tastytea/hugo-theme-nocolor" +tags = ["blog", "minimal", "high contrast"] +features = ["responsive", "black-and-white", "fulltext rss feed"] +min_version = "0.43" + +[author] + name = "tastytea" + homepage = "https://tastytetea.de/" + +[original] + name = "Slick" + homepage = "https://themes.gohugo.io/slick" + repo = "https://github.com/spookey/slick"