hugo-theme-mofo

Minimal theme for Hugo
git clone https://git.bracken.jp/hugo-theme-mofo.git
Log | Files | Refs | LICENSE

commit 98b46e6d2795095dbd9dd9025aef95fcffd5b9ef
Author: Chris Bracken <chris@bracken.jp>
Date:   Fri,  1 Jun 2018 15:47:41 -0700

Initial import

Diffstat:
A.gitignore | 1+
ALICENSE.md | 20++++++++++++++++++++
Aarchetypes/default.md | 2++
Alayouts/404.html | 3+++
Alayouts/_default/baseof.html | 15+++++++++++++++
Alayouts/_default/list.html | 11+++++++++++
Alayouts/_default/single.html | 9+++++++++
Alayouts/index.html | 24++++++++++++++++++++++++
Alayouts/partials/footer.html | 13+++++++++++++
Alayouts/partials/head.html | 12++++++++++++
Alayouts/partials/header.html | 13+++++++++++++
Astatic/css/site.css | 48++++++++++++++++++++++++++++++++++++++++++++++++
Atheme.toml | 15+++++++++++++++
13 files changed, 186 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +*.sw? diff --git a/LICENSE.md b/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2018 Chris Bracken + +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 @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/layouts/404.html b/layouts/404.html @@ -0,0 +1,3 @@ +{{- define "content" -}} +<div class="center"><b>404.</b> Ceci n'est pas un page web.</div> +{{- end }} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html @@ -0,0 +1,15 @@ +<!doctype html> +<html lang="{{ .Site.Language }}"> +<head> +{{ partial "head.html" . -}} +</head> +<body> +{{ partial "header.html" . -}} + +<main id="main"> +{{ block "content" . }}{{ end }} +</main> + +{{ partial "footer.html" . -}} +</body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html @@ -0,0 +1,11 @@ +{{- define "content" -}} +{{- .Content }} +<section id="posts"> +<ol class="post-list"> +{{- range .Pages }} +<li><a href="{{ .Permalink }}">{{ .Title }}</a> +{{- end }} +</ol> +</section> +{{- end }} + diff --git a/layouts/_default/single.html b/layouts/_default/single.html @@ -0,0 +1,9 @@ +{{- define "content" -}} +<article> +<h2 class="post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2> +{{- if not .Date.IsZero }} +{{ dateFormat (default "2006-01-02" .Site.Params.dateFormat) .Date }} +{{- end }} +{{ .Content -}} +</article> +{{- end }} diff --git a/layouts/index.html b/layouts/index.html @@ -0,0 +1,24 @@ +{{- define "content" -}} +<section id="posts"> +{{- $paginator := .Paginate (where .Data.Pages "Type" "post") 50 }} +<ol class="post-list"> +{{- range $paginator.Pages }} +<li>{{ dateFormat "2006-01-02" .Date }}: <a href="{{ .Permalink }}">{{ .Title }}</a> +{{- end }} +</ol> + +<div class="pager"> +{{- if $paginator.HasPrev -}} +<a href="{{ $paginator.Prev.URL }}">« Previous</a> +{{- else }} +« Previous +{{- end }} +&nbsp;|&nbsp;&nbsp;Page {{ $paginator.PageNumber }}&nbsp;&nbsp;|&nbsp; +{{- if $paginator.HasNext }} +<a href="{{ $paginator.Next.URL }}">Next »</a> +{{- else }} +Next » +{{- end }} +</div> +</section> +{{- end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -0,0 +1,13 @@ +<footer id="footer"> +<div class="copyright"> +<p>&copy;&nbsp; +{{- $current := now.Format "2006" }} +{{- if ne .Site.Params.since $current }}{{ .Site.Params.since }}–{{ end }} +{{- $current }}&nbsp; +{{- if .Site.Copyright }} + {{- .Site.Copyright | safeHTML }} +{{- else }} + {{- .Site.Author.name | safeHTML }} +{{- end }} +</div> +</footer> diff --git a/layouts/partials/head.html b/layouts/partials/head.html @@ -0,0 +1,12 @@ +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<title> + {{- block "title" . }} + {{- if .IsPage }} + {{- .Title }} - {{ .Site.Title }} + {{- else }} + {{- default .Site.Title .Title }} + {{- end }} + {{- end -}} +</title> +<link href="{{ "css/site.css" | relURL }}" rel="stylesheet"> diff --git a/layouts/partials/header.html b/layouts/partials/header.html @@ -0,0 +1,13 @@ +<header id="header"> +<div class="site-title"> +<h1><a href="{{ "/" | relLangURL }}">{{ .Site.Title }}</a></h1> +</div> + +<nav class="site-navbar"> +<ul id="menu" class="menu"> + {{- range .Site.Menus.main }} + <li class="menu-item"><a class="menu-item-a" href="{{ .URL | safeURL }}">{{ .Name }}</a></li> + {{- end }} +</ul> +</nav> +</header> diff --git a/static/css/site.css b/static/css/site.css @@ -0,0 +1,48 @@ +/* Basics. */ +body { + margin: 40px auto; + max-width: 650px; + line-height: 1.6; + font-size: 16px; + color: #333; + padding: 0 10px +} +code { font-size: 14px; } +a { text-decoration: none; } +h1,h2,h3 { line-height: 1.2; } +h1 > a { color: #333; } +h2 > a { color: #333; } +h3 > a { color: #333; } +.center { text-align: center; } + +/* Header */ +header { margin-bottom: 2.5em; } +header > div.site-title > h1 { + text-align: center; + margin: 0; +} + +/* Navbar */ +nav > .menu { + list-style-type: none; + padding: 0; + margin: 0; + text-align: center; +} +nav > ul > li.menu-item { + display: inline; + padding: 0 0.5em 0 0.5em; +} +nav > ul > li.menu-item > a { color: #333; } + +/* Footer */ +footer > div.copyright { display: none; text-align: center; } + +/* Home */ +section#posts > ol.post-list { list-style-type: none; } + +/* Single */ +article h2.post-title { margin-bottom: 0.15em; } +article img { display: block; max-width: 100%; margin-left: auto; margin-right: auto; } +article figcaption { text-align: center; } +article figcaption > h4 { font-weight: normal; margin-top: 0; } diff --git a/theme.toml b/theme.toml @@ -0,0 +1,15 @@ +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "mofo" +license = "MIT" +licenselink = "https://github.com/cbracken/hugo-theme-mofo/blob/master/LICENSE.md" +description = "A better motherfucking theme for Hugo" +homepage = "https://github.com/cbracken/hugo-theme-mofo/" +tags = [] +features = [] +min_version = "0.38" + +[author] + name = "Chris Bracken" + homepage = "https://chris.bracken.jp/"