commit a896142a54fde2c4b4a84e80bbcf375cb2bacca0
Author: Christian Ermann <christianermann@gmail.com>
Date: Sun, 5 Sep 2021 12:08:16 -0700
Initial commit
Diffstat:
16 files changed, 232 insertions(+), 0 deletions(-)
diff --git a/LICENSE b/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2021 Christian Ermann
+
+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
@@ -0,0 +1,3 @@
+# Simple Hugo
+
+This is a simple hugo theme I created for my website inspired by the [smol](https://github.com/colorchestra/smol) theme.
diff --git a/archetypes/default.md b/archetypes/default.md
@@ -0,0 +1,2 @@
++++
++++
diff --git a/layouts/404.html b/layouts/404.html
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html lang="{{ .Site.LanguageCode }}">
+ {{- partial "head.html" . -}}
+ <body>
+ {{- partial "header.html" . -}}
+ {{- block "main" . }}{{- end }}
+ {{- partial "footer.html" . -}}
+ </body>
+</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -0,0 +1,12 @@
+{{ define "main" }}
+ <h1>{{ .Page.Title }}</h1>
+ <ul>
+ {{ range .Paginator.Pages.ByDate }}
+ <li>
+ <time>{{ .Date.Format "2006-01-02" }}</time>
+ <a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ partial "pagination.html" . }}
+{{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -0,0 +1,6 @@
+{{ define "main" }}
+ <article>
+ <h1>{{ .Title }}</h1>
+ <div>{{ .Content }}</div>
+ </article>
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
@@ -0,0 +1,6 @@
+{{ define "main" }}
+ {{ .Content }}
+ {{ range .Site.RegularPages }}
+ {{ partial "summary.html" . }}
+ {{ end }}
+{{ end }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
@@ -0,0 +1,6 @@
+<footer>
+ {{ range .Site.Menus.footer }}
+ <a href="{{ .URL }}">{{ .Name }}</a>.
+ {{ end }}
+ <p>Copyright © {{ now.Year }} {{ .Site.Params.author }}.</p>
+</footer>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
@@ -0,0 +1,6 @@
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width">
+ <title>{{ .Page.Title }}</title>
+ <link rel="stylesheet" href="{{ "css/styles.css" | relURL }}">
+</head>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
@@ -0,0 +1,10 @@
+<header>
+ <div id="title">
+ <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
+ </div>
+ <nav>
+ {{ range .Site.Menus.main }}
+ <a href="{{ .URL | relURL }}">{{ .Name }}</a>.
+ {{ end }}
+ </nav>
+</header>
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
@@ -0,0 +1,11 @@
+<div>
+ {{ if gt .Paginator.TotalPages 1 }}
+ {{ if .Paginator.HasPrev }}
+ <a href="{{ .Paginator.Prev.URL }}">Previous Page</a>
+ {{ end }}
+ {{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}
+ {{ if .Paginator.HasNext }}
+ <a href="{{ .Paginator.Next.URL }}">Next Page</a>
+ {{ end }}
+ {{ end }}
+</div>
diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html
@@ -0,0 +1,15 @@
+<div class="summary">
+ <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+ <div class="summary_metadata">
+ <time>{{ .Date.Format "2006-01-02" }}</time>
+ {{ range .Params.tags }}
+ <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>.
+ {{ end }}
+ </div>
+ <div class="summary_body">
+ {{ .Summary }}
+ </div>
+ {{ if .Truncated }}
+ <a href="{{ .Permalink }}">Read more...</a>
+ {{ end }}
+</div>
diff --git a/layouts/tags/terms.html b/layouts/tags/terms.html
@@ -0,0 +1,9 @@
+{{ define "main" }}
+ <h1>Tags</h1>
+ <ul>
+ {{ range .Paginator.Pages.ByTitle }}
+ <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a></li>
+ {{ end }}
+ </ul>
+ {{ partial "pagination.html" . }}
+{{ end }}
diff --git a/static/css/styles.css b/static/css/styles.css
@@ -0,0 +1,96 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+
+html {
+ overflow-y: scroll;
+ background-color: #fffefc;
+ color: #444;
+}
+
+time {
+ font-weight: bold;
+}
+
+body {
+ max-width: 600px;
+ margin: 40px auto;
+ padding: 0 10px;
+ font: 14px/1.5 monospace;
+}
+
+a:link, a:visited, a:active, a:hover {
+ color: #24a5d4;
+}
+
+a:link, a:visited, a:active {
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+h1, h2, h3 {
+ line-height: 1.2;
+}
+
+header {
+ margin-bottom: 20px;
+}
+
+#title {
+ margin-bottom: 5px;
+}
+
+.summary {
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+.summary_metadata {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+
+.summary_body {
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+
+footer {
+ margin-top: 20px;
+}
+
+ul {
+ margin-top: 20px;
+ margin-left: 20px;
+ margin-bottom: 20px;
+}
+
+article {
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+article p {
+ margin-top: 15px;
+ margin-bottom: 15px;
+}
+
+.highlight {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+
+.highlight pre {
+ border-style: solid;
+ padding-top: 5px;
+ padding-left: 10px;
+ padding-bottom: 5px;
+}
+
+code {
+ white-space: pre-wrap;
+}
diff --git a/theme.toml 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 = "Simple"
+license = "MIT"
+licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
+description = "A simple theme I made for my website."
+homepage = "https://christianermann.dev"
+tags = []
+features = []
+min_version = "0.41.0"
+
+[author]
+ name = "Christian Ermann"
+ homepage = "https://christianermann.dev"
+
+# If porting an existing theme
+[original]
+ name = "smol"
+ homepage = "https://github.com/colorchestra"
+ repo = "https://github.com/colorchestra/smol"