hugo

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 4ae859b630e27f59ffc1e1d58cc8e4449eeaff33
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Thu, 14 Apr 2022 16:07:48 -0400

initial

Diffstat:
Aarchetypes/default.md | 6++++++
Aconfig.toml | 11+++++++++++
Alayouts/404.html | 7+++++++
Alayouts/_default/list.html | 16++++++++++++++++
Alayouts/_default/rss.xml | 26++++++++++++++++++++++++++
Alayouts/_default/single.html | 7+++++++
Alayouts/_default/terms.html | 7+++++++
Alayouts/blog.html | 10++++++++++
Alayouts/index.html | 9+++++++++
Alayouts/partials/footer.html | 17+++++++++++++++++
Alayouts/partials/header.html | 14++++++++++++++
Alayouts/partials/nav.html | 7+++++++
Alayouts/partials/tagcloud.html | 10++++++++++
Alayouts/shortcodes/hidvid.html | 9+++++++++
Alayouts/shortcodes/vid.html | 6++++++
Astatic/style.css | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
16 files changed, 214 insertions(+), 0 deletions(-)

diff --git a/archetypes/default.md b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/config.toml b/config.toml @@ -0,0 +1,11 @@ +baseURL = 'https://example.org' +languageCode = 'en-us' +title = "Website Name" + +# [menu] +# [[menu.main]] +# identifier = 'home' +# name = 'Home' +# pre = "🏡" +# url = '/index.html' +# weight = -110 diff --git a/layouts/404.html b/layouts/404.html @@ -0,0 +1,7 @@ +{{ partial "header.html" . }} + +<header><h1>404: Page not found</h1></header> + +{{ .Content }} + +{{ partial "footer.html" . }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html @@ -0,0 +1,16 @@ +{{ partial "header.html" . }} + +<header><h1>{{ .Title }}</h1></header> + +{{ .Content }} + +{{ range.Pages }} + +<li> + <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format "2006 Jan 2" }}</time> &ndash; + <a href="{{ .RelPermalink }}">{{ .Title }}</a> +</li> + +{{ end }} + +{{ partial "footer.html" . }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml @@ -0,0 +1,26 @@ +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range .Pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{- .Content | html -}}</description> + </item> + {{ end }} + </channel> +</rss> diff --git a/layouts/_default/single.html b/layouts/_default/single.html @@ -0,0 +1,7 @@ +{{ partial "header.html" . }} + +<header><h1>{{ .Title }}</h1></header> + +{{ .Content }} + +{{ partial "footer.html" . }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html @@ -0,0 +1,7 @@ +{{ partial "header.html" . }} + +<header><h1>{{ .Title }}</h1></header> + +{{ .Content }} + +{{ partial "footer.html" . }} diff --git a/layouts/blog.html b/layouts/blog.html @@ -0,0 +1,10 @@ +{{ define "main" }} +{{ .Content }} + +{{range.Site.RegularPages}} +<li><a href="{{.Permalink}}">{{.Title}}</a></li> +{{end}} + +{{ partial "tagcloud.html" . }} + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html @@ -0,0 +1,9 @@ +{{ partial "header.html" . }} + +<header><h1>{{ .Site.Title }}</h1></header> + +{{ .Content }} + +{{ partial "tagcloud.html" . }} + +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -0,0 +1,17 @@ + {{ if isset .Params "tags" }} + {{ $tagsLen := len .Params.tags }} + {{ if gt $tagsLen 0 }} + <div class=taglist> + See related recipes:</br> + {{ range $k, $v := .Params.tags }} + {{ $url := printf "tags/%s" (. | urlize | lower) }} + <a href="{{ $url | absURL }}">{{ . }}</a> + {{ if lt $k (sub $tagsLen 1) }}&middot;{{ end }} + {{ end }} + </div> + {{ end }} + {{ end }} + </main> + <footer><a href="{{ .Site.BaseURL }}">{{ .Site.BaseURL }}</a></footer> +</body> +</html> diff --git a/layouts/partials/header.html b/layouts/partials/header.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html lang="{{ .Site.Language }}"> + <head> + <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title> + <meta charset="utf-8"/> + <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> + <link rel='stylesheet' type='text/css' href='/style.css'> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="keywords" content="{{ .Params.tags }}"> + <link rel='alternate' type='application/rss+xml' title="{{ .Site.Title }} RSS" href='/rss.xml'> + </head> +<body> + {{ partial "nav.html" . }} + <main> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html @@ -0,0 +1,7 @@ +<nav> + <ul> + {{ range.Site.Menus.main }} + <a href="{{ .URL }}"><li>{{ .Pre }}{{ .Name }}</li></a> + {{ end }} + </ul> +</nav> diff --git a/layouts/partials/tagcloud.html b/layouts/partials/tagcloud.html @@ -0,0 +1,10 @@ +{{ if isset .Site.Taxonomies "tags" }} +{{ if not (eq (len .Site.Taxonomies.tags) 0) }} + <div class="tagcloud"> + {{ range $name, $items := .Site.Taxonomies.tags }} + {{ $url := printf "%s/%s" "tags" ($name | urlize | lower)}} + <a href="{{ $url | absURL }}">{{ $name }}</a> + {{ end }} + </div> +{{ end }} +{{ end }} diff --git a/layouts/shortcodes/hidvid.html b/layouts/shortcodes/hidvid.html @@ -0,0 +1,9 @@ +<details> + <summary>Click to reveal video.</summary> +<iframe src="{{ index .Params 0 }}" + loading="lazy" + sandbox="allow-same-origin allow-scripts allow-popups" + allowfullscreen frameborder="0" + title="Embedded Video"> +</iframe> +</details> diff --git a/layouts/shortcodes/vid.html b/layouts/shortcodes/vid.html @@ -0,0 +1,6 @@ +<iframe src="{{ index .Params 0 }}" + loading="lazy" + sandbox="allow-same-origin allow-scripts allow-popups" + allowfullscreen frameborder="0" + title="Embedded Video"> +</iframe> diff --git a/static/style.css b/static/style.css @@ -0,0 +1,52 @@ +body { + font-style: sans-serif ; + background: #100 ; + color: #ddd ; +} + +main { + max-width: 800px ; + margin: auto ; +} + +header h1 { + text-align: center ; +} + +h1,h2,h3,h4,h5,h6 { + text-align: center ; +} + +nav,footer { + text-align: center ; + clear: both ; + border-radius: 20px ; + margin: auto ; +} +nav li,footer li { + display: inline-block ; + list-style: none ; + border-radius: 10px ; + padding: .5em ; + max-width: 7em ; +} +nav ul, footer ul, #taglist { + padding: 0; + margin: .5em; +} + + +@media (min-width: 1200px) { + nav { + float: left ; + width: 175px ; + position: fixed ; + text-align: left ; + font-size: large ; + } + nav li { + display: block ; + text-align: center ; + margin: .5em auto ; + } +}