From aec8a123a4f7a5d86d173cc722ab45ddb8fdb4eb Mon Sep 17 00:00:00 2001 From: Eorn Date: Sun, 12 Apr 2020 10:16:04 +0200 Subject: [PATCH] First clean commit --- LICENSE | 20 ++ archetypes/default.md | 2 + i18n/en.toml | 30 +++ i18n/fr.toml | 31 +++ layouts/404.html | 0 layouts/_default/baseof.html | 11 + layouts/_default/index.rss.xml | 39 +++ layouts/_default/list.html | 1 + layouts/_default/single.html | 26 ++ layouts/index.html | 36 +++ layouts/partials/footer.html | 16 ++ layouts/partials/header.html | 31 +++ layouts/partials/nav.html | 31 +++ layouts/partials/related.html | 9 + layouts/partials/section-menu.html | 15 ++ layouts/partials/section-menu2.html | 46 ++++ layouts/partials/section-tags.html | 9 + layouts/partials/sidebar.html | 10 + layouts/partials/svg/icons.html | 17 ++ layouts/partials/tags.html | 9 + static/css/style.css | 353 ++++++++++++++++++++++++++++ theme.toml | 21 ++ 22 files changed, 763 insertions(+) create mode 100644 LICENSE create mode 100644 archetypes/default.md create mode 100644 i18n/en.toml create mode 100644 i18n/fr.toml create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/index.rss.xml create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.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/nav.html create mode 100644 layouts/partials/related.html create mode 100644 layouts/partials/section-menu.html create mode 100644 layouts/partials/section-menu2.html create mode 100644 layouts/partials/section-tags.html create mode 100644 layouts/partials/sidebar.html create mode 100644 layouts/partials/svg/icons.html create mode 100644 layouts/partials/tags.html create mode 100644 static/css/style.css create mode 100644 theme.toml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..46fe619 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2019 YOUR_NAME_HERE + +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 new file mode 100644 index 0000000..ac36e06 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,2 @@ ++++ ++++ diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..3224979 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,30 @@ +[categories] +other = "Categories" + +[recent-posts] +other = "Recent posts" + +[tags] +other = "Tags" + +[poweredby] +other = "Brooding made possible by Hugo & Simple-Goeland." + +[publishedIn] +other = "Published in" + +[on] +other = "on" + +[readingTime] +other = "Reading time" + +[readingTimeValue] +one = "~1 min" +other = "~{{ .Count }} mins" + +[recentContent] +other = "Recent content on" + +[readMore] +other = "Read more" diff --git a/i18n/fr.toml b/i18n/fr.toml new file mode 100644 index 0000000..4298b46 --- /dev/null +++ b/i18n/fr.toml @@ -0,0 +1,31 @@ +[categories] +other = "Catégories" + +[recent-posts] +other = "Billets récents" + +[tags] +other = "Tags" + +[poweredby] +other = "Couvaison rendue possible par Hugo & Simple-Goeland." + +[publishedIn] +other = "Publié dans" + +[on] +other = "le" + +[readingTime] +other = "Durée de lecture" + +[readingTimeValue] +one = "~1 min" +other = "~{{ .Count }} mins" + +[recentContent] +other = "Contenu récent sur" + + +[readMore] +other = "Lire la suite" diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..5f8e2ec --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,11 @@ + + + {{- partial "head.html" . -}} + + {{- partial "header.html" . -}} +
+ {{- block "main" . }}{{- end }} +
+ {{- partial "footer.html" . -}} + + diff --git a/layouts/_default/index.rss.xml b/layouts/_default/index.rss.xml new file mode 100644 index 0000000..feccc7a --- /dev/null +++ b/layouts/_default/index.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.Params.rss.limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ i18n "recentContent" }} {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }} {{ .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.Params.rss.authorName }}{{.}}{{end}} + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..6c2402f --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1 @@ +{{ template "index.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..601bba2 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,26 @@ +{{ partial "header" . }} +{{ partial "nav" . }} +{{ partial "sidebar" . }} + +
+
+
+

{{ .Title }}

+
+ {{ if .Params.tags }} + {{ partial "tags" .Params.tags }} + {{ end }} +
+ + +
+ {{ .Content }} + {{ if .Site.Params.Info.related }} + +
+
+ {{ end }} +
+
+ +{{ partial "footer" . }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..7baa611 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,36 @@ +{{ partial "header" . }} +{{ partial "nav" . }} +{{ partial "sidebar" . }} +
+
+ {{- $pctx := . -}} + {{ if .IsHome -}}{{ $pctx = .Site }}{{- end -}} + {{- $pages := $pctx.RegularPages -}} + {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }} + {{ range sort .Paginator.Pages }} +
+

{{ .Title }}

+
+ {{ if .Params.tags }} + {{ partial "tags" .Params.tags }} + {{ end }} +
+ + +
+ {{ if .Description }} + {{ .Description | plainify | safeHTML }} + {{ i18n "readMore" }} + {{ else }} + {{ .Summary | plainify | safeHTML }} + {{ if .Truncated }} + {{ i18n "readMore" }} + {{ end }} + {{ end }} +
+
+ {{ end }} +
+ {{ template "_internal/pagination.html" . }} +
+{{ partial "footer" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..075e6fb --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,16 @@ + + + +{{ if .Site.Params.matomoAnalytics }} +{{- partial "analytitcs/matomo" . -}} +{{ end }} + + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..62d9eed --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,31 @@ + + + + + + {{ if eq .IsHome false }} + {{ .Title }} | {{ .Site.Title }} + {{ else }} + {{ .Site.Title }} + {{ end }} + + {{ if .Site.Params.Info.enableSocial }} + + {{ end }} + + {{ if .Site.Params.rss }} + + {{ end }} + + + + + + + + + + + + + diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..b02d300 --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,31 @@ + diff --git a/layouts/partials/related.html b/layouts/partials/related.html new file mode 100644 index 0000000..55c8738 --- /dev/null +++ b/layouts/partials/related.html @@ -0,0 +1,9 @@ +{{ $related := .Site.RegularPages.Related . | first 5 }} +{{ with $related }} +

Billets similaires

+ +{{ end }} diff --git a/layouts/partials/section-menu.html b/layouts/partials/section-menu.html new file mode 100644 index 0000000..13f3b04 --- /dev/null +++ b/layouts/partials/section-menu.html @@ -0,0 +1,15 @@ +{{ $page := .currentPage }} +{{ range .menu }} +{{ $posts := (where .Pages "File.Dir" "in" .Dir) }} +{{ $postCount := len $posts }} + +
  • + {{ .Name }} + {{/* if ne $postCount 0 */}}{{/* $postCount */}}{{/* end */}} + +
  • +{{ end }} diff --git a/layouts/partials/section-menu2.html b/layouts/partials/section-menu2.html new file mode 100644 index 0000000..69e7af9 --- /dev/null +++ b/layouts/partials/section-menu2.html @@ -0,0 +1,46 @@ +{{ template "structure-menu" (dict "currentLevel" $.Site "currentPage" .Page "level" 0 ) }} + + +{{ define "structure-menu" }} + {{ $level := .level }} + {{ $currentLevel := .currentLevel }} + {{ $currentPage := .currentPage }} + {{ $children := .currentLevel.Sections }} + + {{ if $currentLevel.Pages }} + {{ range $currentLevel.Pages }} + {{ if not (eq 0 $level) }} + {{ $children = $children | append . }} + {{ else }} + {{ if and ( eq .Section "" ) ( not .IsHome ) }} + {{ $children = $children | append . }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + + + {{ $url := "#" }} + {{ if gt $level 0 }} + {{ $url = $currentLevel.Permalink }} + {{ else }} + {{ $url = $currentLevel.BaseURL }} + {{ end }} + + {{ $currentLevel.Title }} + + {{ if $children }} +
      + {{ range $children }} +
    1. + {{ if .IsNode }} + {{ template "structure-menu" (dict "currentLevel" . "currentPage" $currentPage "level" (add 1 $level)) }} + {{ else }} + * {{ .Title }} + {{ end }} +
    2. + {{ end }} +
    + {{ end }} + +{{ end }} diff --git a/layouts/partials/section-tags.html b/layouts/partials/section-tags.html new file mode 100644 index 0000000..1645f30 --- /dev/null +++ b/layouts/partials/section-tags.html @@ -0,0 +1,9 @@ +{{ $currentPageName := .Page.Name }} + +
    + {{ range $name, $items := .Site.Taxonomies.tags }} + + #{{ $name }} ({{ len $items }}) + + {{ end }} +
    diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html new file mode 100644 index 0000000..9d8f3c9 --- /dev/null +++ b/layouts/partials/sidebar.html @@ -0,0 +1,10 @@ +
    + diff --git a/layouts/partials/svg/icons.html b/layouts/partials/svg/icons.html new file mode 100644 index 0000000..9dea0c3 --- /dev/null +++ b/layouts/partials/svg/icons.html @@ -0,0 +1,17 @@ + diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html new file mode 100644 index 0000000..e5b97db --- /dev/null +++ b/layouts/partials/tags.html @@ -0,0 +1,9 @@ +{{ range first 1 . }} +#{{ . }} +{{ end }} + +{{ if gt (len .) 1 }} +{{ range after 1 . }} +| #{{ . }} +{{ end }} +{{ end }} diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..a82123f --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,353 @@ +/*********** + * CSS style for the Simple-Goeland Hugo theme + * Author: eorn (https://forge.goe.land/eorn/simple-goeland) + ***********/ + +/* CSS reset */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + + + + +/* Sections, containers... */ +main { + display: block; +} +.flex { + display: flex; +} +.container { + max-width: 80rem; + margin: 0 auto; +} +.sidebar { + flex: 0 0 250px; + font-size: 0.9em; +} +.page-content { + font-size: 1em; + min-width: 320px; + flex-grow: 1; + padding-left: 12px; +} +main.container { + margin-top : 12px; + margin-bottom: 25px; + padding-top: 20px; + border-top: 1px solid #53bcdf; +} + + +/* Navbar */ +#navbar { + height: 40px; + font-family: "Source Code Pro", monospace; +} + +.nav-left { + float: left; +} +.nav-right { + float: right; + margin-top: 8px; +} +.nav-left a, .nav-left h1 { + text-decoration: none; + color: #53bcdf; + font-size: 30px; + font-weight: bold; + vertical-align: middle; +} +.nav-right a { + text-decoration: none; + color: white; +} +.nav-right img, .nav-right svg { + margin: 0px; + padding: 0px; + vertical-align: bottom; +} +.pleroma svg { + fill: #f39f54; +} +.pleroma svg:hover { + fill: #ffc992; +} +.pixelfed svg { + fill: #c02fa8; +} +.pixelfed svg:hover { + fill: #ff61f2; +} +.gitea svg { + fill: #5f9825; +} +.gitea svg:hover { + fill: #8dcc4a; +} +.rss svg { + fill: #f76300; +} +.rss svg:hover { + fill: #ffac46; +} + + +/* Sidebar */ +.sidebar { + font-family: "Source Code Pro", monospace; + line-height: 1.5; +} +.sidebar hr { + border 0; +} +.sidebar h2 { + border-top: 1px solid #53bcdf; + font-size: 20px; + font-weight: bold; + text-align: center; + margin-bottom: 10px; + padding-top: 5px; +} +.sidebar a { + color: #53bcdf; + text-decoration: underline; +} +.sidebar a:hover { + text-decoration: none; + color: #9de2ff; +} +.sidebar ul, .sidebar li, .sidebar ul li { + margin: 0px; + padding: 0px; + list-style: none; +} +.sidebar li ul { + margin-left: 20px; +} +a.active { + font-weight: bold; + color: #9de2ff; +} + +.pagination { + font-family: "Source Code Pro", monospace; + padding-top: 15px; + text-align: center; +} +.pagination ul, .pagination li { + display: inline; + margin: 0; + padding: 0; + list-style: none; +} +.page-content li.page-item::before { + content: ""; + width: 0em; + margin-left: 0em; + margin: 0px; + padding: 0px; +} +.pagination a { + background-color: #2f3335; + padding: 4px; +} + + +/* Footer */ +.footer { + font-family: "Source Code Pro", monospace; + border-top: 1px solid #53bcdf; + padding-top: 15px; +} + + +/* Content defaults */ +body { + font-family: "Source Sans Pro", sans-serif; + color: white; + background-color: #232627; + text-rendering: optimizeLegibility; + line-height: 1.15; + margin: 0 auto; + max-width: 1280px; + padding: 15px; +} + + +.has-text-centered { + text-align: center; +} + + +.page-content p { + margin-top: 10px; + margin-bottom: 10px; +} + +a { + color: #53bcdf; + text-decoration: underline; + font-family: "Source Code Pro", monospace; +} +a:hover { + text-decoration: none; + color: #9de2ff; +} + +.tag a { + background-color: #2f3335; + padding: 2px; + color: #76e09d; +} +.tag a:hover { + color: #b4ffd2; +} +.tag.active a { + font-weight: bold; + color: #b4ffd2; +} +.button a { + background-color: #2f3335; + padding: 2px; + margin: 2px; +} + +.page-content article { + margin-bottom: 25px; + border-top: 1px dashed #bbb677; +} + +.page-content h1, .page-content h1 a { + font-size: 30px; + margin-bottom: 10px; + font-weight: bold; + color: #bbb677; +} +.page-content h1 a:hover { + color: #f0eca9; +} +.page-content h2 { + font-size: 25px; + font-weight: bold; + color: #bbb677; +} +.page-content h3 { + font-size: 20px; + font-weight: bold; + color: #bbb677; +} +.page-content h4 { + font-size: 15px; + font-weight: bold; + color: #bbb677; +} +.page-content h5 { + font-size: 15px; + color: #bbb677; +} + +.page-content .article-date { + font-family: "Source Code Pro", monospace; + font-size: 0.8em; + margin: 0px; +} +.page-content .tags-list { + float: right; +} + +article .post-content { + margin-top: 20px; +} + +.page-content ul { + padding: 0px; + list-style: none; +} +.page-content ul li{ + margin-left: 10px; +} +.page-content ul li::before { + content: "\2022"; + color: #53bcdf; + font-weight: bold; + display: inline-block; + width: 0.75em; + margin-left: -0.5em; + +} + + +.related { + margin-top: 25px; + border-top: 1px dashed #bbb677; + padding-top: 10px; +} + + + + +/* Responsive */ +@media only screen and (max-width: 800px) { + .flex { + display: table; + } + .sidebar { + display: table-footer-group; + } + .page-content { + display: table-header-group; + padding: 0px; + } + #navbar .nav-left, #navbar .nav-right { + float: none; + text-align: center; + } + #navbar { + min-height: 75px; + } + +} + diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..455df12 --- /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 = "Simple Goeland" +license = "MIT" +licenselink = "https://forge.goe.land/eorn/simple-goeland/src/branch/master/LICENSE" +description = "" +homepage = "http://forge.goe.land/eorn/simple-goeland" +tags = [] +features = [] +min_version = "0.58" + +[author] + name = "Eorn" + homepage = "https://blog.goe.land" + +# If porting an existing theme +[original] + name = "" + homepage = "" + repo = ""