From 6b5742b1bdae1efd4ba6a2371d14ec78ff6fd18f Mon Sep 17 00:00:00 2001 From: Dorian Wood Date: Sat, 3 Apr 2021 09:34:30 -0400 Subject: [PATCH] Initial commit. Been working on these theme from the ground up in my free time. --- archetypes/daily_accomplishments.md | 14 +++ archetypes/default.md | 5 + layouts/404.html | 3 + layouts/_default/baseof.html | 22 ++++ layouts/_default/list.html | 15 +++ layouts/_default/single.html | 10 ++ layouts/index.html | 7 ++ layouts/music-therapy/baseof.html | 22 ++++ layouts/music-therapy/list.html | 17 +++ layouts/music-therapy/single.html | 10 ++ layouts/partials/footer.html | 6 + layouts/partials/head.html | 3 + layouts/partials/nav.html | 6 + layouts/partials/post-preview.html | 49 +++++++++ layouts/rss.xml | 39 +++++++ layouts/shortcodes/audioplayer.html | 6 + layouts/shortcodes/rawhtml.html | 2 + static/css/style.css | 163 ++++++++++++++++++++++++++++ theme.toml | 21 ++++ 19 files changed, 420 insertions(+) create mode 100644 archetypes/daily_accomplishments.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/single.html create mode 100644 layouts/index.html create mode 100644 layouts/music-therapy/baseof.html create mode 100644 layouts/music-therapy/list.html create mode 100644 layouts/music-therapy/single.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/nav.html create mode 100644 layouts/partials/post-preview.html create mode 100644 layouts/rss.xml create mode 100644 layouts/shortcodes/audioplayer.html create mode 100644 layouts/shortcodes/rawhtml.html create mode 100644 static/css/style.css create mode 100644 theme.toml diff --git a/archetypes/daily_accomplishments.md b/archetypes/daily_accomplishments.md new file mode 100644 index 0000000..67fcb47 --- /dev/null +++ b/archetypes/daily_accomplishments.md @@ -0,0 +1,14 @@ +--- +date: {{ .Date }} +title: "{{ dateFormat "Monday" .Date }}'s Accomplishments" +draft: true +--- + +Today I accomplished: +1. + +Next time I would like to do better on: +1. + +Tomorrow I would like to: +1. diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..351a260 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true ++++ diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..884bc89 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,3 @@ +{{ partial "head.html" . }} +

Well. Looks like we can't find the page you were looking for. One of us (probably me) typed something wrong. If it was me, send me an email so I can fix it please.

+{{ partial "footer.html" . }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..94690bc --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,22 @@ + + + + + + + + + + + {{ block "title" . }}{{ .Site.Title }}{{ end }} + + + +

{{- .Title }}

+ {{- partial "nav.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..c98ccdd --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,15 @@ +{{ define "title" }} + {{ .Title }} +{{ end }} +{{ define "main" }} +
+ {{- range first 10 .Data.Pages }} + +
+

{{ .Title }}

+ {{ .Plain | truncate 500 | htmlUnescape | safeHTML }} +
+ + {{- end }} +
+{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..52c948d --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,10 @@ +{{ define "title" }}{{ .Title }}{{ end }} +{{ define "main" }} +
+ {{ .WordCount }} words // {{ div .WordCount 200 }} minute read + Published: {{ .Date.Format "2006-01-02" }} +
+
+ {{ .Content }} +
+{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..47a7f02 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,7 @@ +{{ define "main" }} + {{ .Content }} + {{ $currentPage := . }} + {{ range .Site.Menus.social }} + {{ .Name }}
+ {{ end }} +{{ end }} diff --git a/layouts/music-therapy/baseof.html b/layouts/music-therapy/baseof.html new file mode 100644 index 0000000..94690bc --- /dev/null +++ b/layouts/music-therapy/baseof.html @@ -0,0 +1,22 @@ + + + + + + + + + + + {{ block "title" . }}{{ .Site.Title }}{{ end }} + + + +

{{- .Title }}

+ {{- partial "nav.html" . }} +
+ {{- block "main" . }}{{- end }} +
+ {{- partial "footer.html" . -}} + + diff --git a/layouts/music-therapy/list.html b/layouts/music-therapy/list.html new file mode 100644 index 0000000..b14bfb5 --- /dev/null +++ b/layouts/music-therapy/list.html @@ -0,0 +1,17 @@ +{{ define "title" }} + {{ .Title }} +{{ end }} +{{ define "main" }} +
+ {{ .Content }} +
+
+ {{- range first 10 .Data.Pages }} + +
+

{{ .Title }}

+
+ + {{- end }} +
+{{ end }} diff --git a/layouts/music-therapy/single.html b/layouts/music-therapy/single.html new file mode 100644 index 0000000..52c948d --- /dev/null +++ b/layouts/music-therapy/single.html @@ -0,0 +1,10 @@ +{{ define "title" }}{{ .Title }}{{ end }} +{{ define "main" }} +
+ {{ .WordCount }} words // {{ div .WordCount 200 }} minute read + Published: {{ .Date.Format "2006-01-02" }} +
+
+ {{ .Content }} +
+{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..278c4be --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,6 @@ + + + + diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..2be86de --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,3 @@ + + {{ partial "nav.html" . }} +
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..41462ab --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,6 @@ + diff --git a/layouts/partials/post-preview.html b/layouts/partials/post-preview.html new file mode 100644 index 0000000..937386d --- /dev/null +++ b/layouts/partials/post-preview.html @@ -0,0 +1,49 @@ +{{ $full := false }} +{{ $bigTitle := true }} +{{ $content := .page.Content }} + +{{ if isset . "full" }}{{ $full = .full }}{{ end }} +{{ if isset . "bigTitle" }}{{ $bigTitle = .bigTitle }}{{ end }} + +{{ if not $full}} +{{ $content = $content | truncate 200}} +{{ end }} + +{{ if $bigTitle }} +
+
+ {{ if .page.PublishDate }} +

{{ .page.Title }}

+ + {{ .page.PublishDate.Format "January 2, 2006" }} + + {{ else }} + +

{{ .page.Title }}

+
+ {{ end }} +
+
+{{ else }} +
+
+ {{ if .page.PublishDate }} + {{ .page.Title }} - + + + {{ .page.PublishDate.Format "January 2, 2006" }} + + {{ else }} + + {{ .page.Title }} + + {{ end }} +
+
+{{ end }} + +
+ {{ $content }} +
+ +
diff --git a/layouts/rss.xml b/layouts/rss.xml new file mode 100644 index 0000000..e49c966 --- /dev/null +++ b/layouts/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 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $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/shortcodes/audioplayer.html b/layouts/shortcodes/audioplayer.html new file mode 100644 index 0000000..03616b9 --- /dev/null +++ b/layouts/shortcodes/audioplayer.html @@ -0,0 +1,6 @@ + + diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html new file mode 100644 index 0000000..b90bea2 --- /dev/null +++ b/layouts/shortcodes/rawhtml.html @@ -0,0 +1,2 @@ + +{{.Inner}} diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..b96c408 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,163 @@ +:root { + --base03: #002b36; + --base02: #073642; + --base01: #586e75; + --base00: #657b83; + --base0: #839496; + --base1: #93a1a1; + --base2: #eee8d5; + --base3: #fdf6e3; + --yellow: #b58900; + --orange: #cb4b16; + --red: #dc322f; + --magenta: #d33682; + --violet: #6c71c4; + --blue: #268bd2; + --cyan: #2aa198; + --green: #859900; + + --background: var(--base3); + --color: var(--base02); + --highlight: var(--base2); + --accent: var(--base01); +} + +body { + display: flex; + flex-direction: column; + font-size: 1.8em; + font-family: serif; + background-color: var(--background); + color: var(--color); + width: 99vw; +} + +.main-content { + max-width: 40em; + margin: auto; +} + +a, a:visited { + color: var(--blue); +} + +#navbar { + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-end; + margin-top: 10px; + padding: 10px 0px; + border-width: 0 0 1px 0; + border-color: var(--accent); + border-style: solid; + font-family: monospace; +} + +#banner { + padding: 1em; + grid-area: head; + font-size: 30px; + text-align: center; +} + +.active { + border-width: .1em; + border-style: solid; + border-color: var(--color); +} + +.nav-link, nav header, .nav-link:visited { + /* margin: .5em 0em; */ + padding: .5em 2em; + text-align: center; + color: var(--color); + /* border-radius: 5px; */ +} + +code, pre { + background-color: var(--highlight); + font-family: monospace; +} +pre { + border-width: 1px 1px 1px 5px; + border-style: solid; + border-color: var(--highlight) var(--highlight) var(--highlight) var(--red); + padding: .5em; +} + +code > p { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: var(--red); +} + +.date { + margin-left: auto; +} + +.postinfo { + display: flex; + width: 95vw; + margin: 1em 0; + padding: 0 0 0 0; +} + +h1, h2 { + font-family: monospace; +} + +h1 { + font-size: 3em; + text-align: center; +} + +h2 { + font-size: 2.5em; + text-align: right; + border-width: 0 0 4px 0; + border-style: dashed; + border-color: var(--accent); +} + +h3 { + font-size: 1.8em; + margin: 0; + padding: 0; +} + +h4 { + border-width: 0 0 2px 0; + border-style: solid; + border-color: var(--base00); +} + +#projects { + display: flex; + flex-wrap: wrap; + justify-content: space-around; +} + +.project-tile { + max-width: 25em; + margin: 1em; + padding: 1em; + border-width: 2px; + border-style: solid; + border-color: var(--accent); + border-radius: 20px; + /* box-shadow: 1em 1em var(--highlight); */ + color: var(--color); +} + +.button { + text-decoration: none; +} + +.license-text { + text-align: center; +} + +audio { + align: center; +} diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..419475f --- /dev/null +++ b/theme.toml @@ -0,0 +1,21 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Dor" +license = "MIT" +licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE" +description = "" +homepage = "http://example.com/" +tags = [] +features = [] +min_version = "0.41.0" + +[author] + name = "" + homepage = "" + +# If porting an existing theme +[original] + name = "" + homepage = "" + repo = ""