Added files of the theme

This commit is contained in:
N07070
2021-01-03 14:33:26 +01:00
parent 9c6bbe51e9
commit 274b1c55ef
181 changed files with 3899 additions and 3 deletions

0
layouts/404.html Normal file
View File

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}" dir="ltr">
{{ partial "head.html" . }}
<body class="list-body">
<main class="card-container side-gutter">
{{ partial "nav-bar.html" . }}
{{ if or (not (eq .Description "")) (not (eq .Title "")) -}}
{{- end }}
{{ with .Content -}}
<section class="list-header-content">
{{ . }}
</section>
{{- end }}
{{ $pages := .Pages }}
{{ if .IsHome }}
{{ $pages = .Site.RegularPages }}
{{ end }}
{{ $paginator := .Paginate (where $pages "Params.displayinlist" "!=" false) -}}
{{- range $paginator.Pages -}}
{{ .Render "li" }}
{{- end }}
</main>
{{ if or ($paginator.HasPrev) ($paginator.HasNext) -}}
<nav class="pagination-nav side-padding">
{{ if $paginator.HasPrev }}<a href="{{ $paginator.Prev.URL }}" class="pagination-newer pagination-text">&lt; Newer Posts</a>{{ end }}
{{ if $paginator.HasNext }}<a href="{{ $paginator.Next.URL }}" class="pagination-older pagination-text">Older Posts &gt;</a>{{ end }}
</nav>
{{- end }}
{{ partial "scripts.html" . }}
</body>
</html>

View File

@@ -0,0 +1,34 @@
<a href="{{ .Permalink }}" class="card blog-card bc-next bg-color-4" rel="bookmark" >
<div class="card-img-container">
{{ with .Resources.GetMatch "featuredImage" }}
<p class="card-img-overlay">Next Article</p>
<picture>
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
<source srcset="{{ .Permalink }}" type="image/webp">
{{- end }}
<source srcset="{{ .Permalink }}">
<img src="{{ .Permalink }}" class="card-img" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
</picture>
{{ end }}
</div>
<article class="card-body">
<h2 class="card-title">{{ .Title }}</h2>
<p class="card-text">{{ if (isset .Params "description") }}{{ index .Params "description" | htmlUnescape }}{{ else }}{{ .Summary | plainify | htmlUnescape }}{{ end }}</p>
<div class="card-subtext muted-text">
<p>
Posted <time datetime="{{ .PublishDate.Format "2006-01-02 12:00" }}">{{ .PublishDate.Format "Jan 2, 2006" }}</time>
</p>
{{ if (isset .Params "categories") }}
<p>
{{ range .Params.categories }}#{{ . }} {{ end }}
</p>
{{ end }}
</div>
<p class="card-subtext muted-text">This is the next article in the same categorie</p>
</article>
</a>

23
layouts/_default/li.html Normal file
View File

@@ -0,0 +1,23 @@
<a
href="{{ .Permalink }}" class="card blog-card" rel="bookmark" >
<div class="card-img-container">
{{ with .Resources.GetMatch "featuredImage" }}
<picture>
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
<source srcset="{{ .Permalink }}" type="image/webp">
{{- end }}
{{ $thumbnail := .Fit "800x600 Lanczos" }}
<source srcset="{{ $thumbnail.Permalink }}">
<img src="{{ $thumbnail.Permalink }}" class="card-img" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
</picture>
{{- end }}
</div>
<article class="card-body">
<h2 class="card-title">{{ .Title }}</h2>
<p class="card-text">{{ if (isset .Params "description") }}{{ index .Params "description" | htmlUnescape }}{{ else }}{{ .Summary | plainify | htmlUnescape }}{{ end }}</p>
<div class="card-subtext muted-text">
<p>Posted <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "Jan 2, 2006" }}</time></p>
{{ if (isset .Params "categories") }}<p>{{ range .Params.categories }}#{{ . | urlize | title }} {{ end }}</p>{{ end }}
</div>
</article>
</a>

View File

@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}" dir="ltr">
{{ partial "head.html" . }}
<body class="list-body">
{{ partial "nav-bar.html" . }}
<main class="card-container side-gutter">
{{ if or (not (eq .Description "")) (not (eq .Title "")) -}}
<!-- <header class="list-header">
{{ with .Title }}<h1 class="list-header-title">{{ . }}</h1>{{ end }}
{{ with .Description }}<p class="list-header-subtext">{{ . }}</p>{{ end }}
</header> -->
{{- end }}
{{ with .Content -}}
<section class="list-header-content">
{{ . }}
</section>
{{- end }}
{{ $pages := .Pages }}
{{ if .IsHome }}
{{ $pages = .Site.RegularPages }}
{{ end }}
{{ $paginator := .Paginate (where $pages "Params.displayinlist" "!=" false) -}}
{{- range $paginator.Pages -}}
{{ .Render "li" }}
{{- end }}
</main>
{{ if or ($paginator.HasPrev) ($paginator.HasNext) -}}
<nav class="pagination-nav side-padding">
{{ if $paginator.HasPrev }}<a href="{{ $paginator.Prev.URL }}" class="pagination-newer pagination-text">&lt; Newer Posts</a>{{ end }}
{{ if $paginator.HasNext }}<a href="{{ $paginator.Next.URL }}" class="pagination-older pagination-text">Older Posts &gt;</a>{{ end }}
</nav>
{{- end }}
{{ partial "scripts.html" . }}
</body>
</html>

27
layouts/_default/rss.xml Normal file
View File

@@ -0,0 +1,27 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} - {{ 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 }}
{{ $paginator := .Paginate (where .Pages "Params.displayinlist" "!=" false) -}}
{{- range $paginator.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>{{ if (isset .Params "description") }}{{ index .Params "description" | html }}{{ else }}{{ .Summary | html }}{{ end }}</description>
</item>
{{- end }}
</channel>
</rss>

View File

@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}" dir="ltr">
{{ partial "head.html" . }}
<body class="single-body">
{{ partial "nav-bar.html" . }}
<main class="content side-text-padding">
<article class="post {{ if ne .Params.dropcap false }}dropcase{{ end }}">
<header class="post-header">
<h1 class="post-title">{{ .Title }}</h1>
{{ if isset .Params "date" }}<p class="post-date">Posted <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "Jan 2, 2006" }}</time></p>{{ end }}
</header>
{{ with .Resources.GetMatch "featuredImage" -}}
<picture class="post-figure">
{{ with $.Resources.GetMatch (replace (.Title) (path.Ext (.Title)) ".webp") -}}
<source srcset="{{ .Permalink }}" type="image/webp">
{{- end }}
{{ $featured := .Resize "800x Lanczos" }}
<source srcset="{{ $featured.Permalink }}">
<img src="{{ $featured.Permalink }}" {{ with .Params.description -}} alt="{{ . }}" {{- end }}>
</picture>
{{- end }}
{{ if .Params.toc -}}
<h2>Contents</h2>
{{ .TableOfContents }}
{{- end }}
{{ .Content }}
</article>
</main>
<nav class="end-nav side-padding">
{{ with .PrevInSection }}
{{ .Render "li-next" }}
{{ end }}
</nav>
{{ partial "footer.html" . }}
{{ partial "scripts.html" . }}
</body>
</html>

View File

@@ -0,0 +1,3 @@
<footer class="side-padding" >
The Octet Press, N07070's blog. Self-hosted, low-tech, no JS and static, as it should be.
</footer>

View File

@@ -0,0 +1,43 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{{ if not .IsHome }}{{with .Title }}{{ . }} &middot; {{ end }}{{ end }}{{ .Site.Title }}</title>
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
{{ if (fileExists "static/apple-touch-icon.png") -}}
<link rel="apple-touch-icon" sizes="180x180" href="{{ "/apple-touch-icon.png" | absURL }}">
{{ end -}}
{{ if (fileExists "static/favicon-32x32.png") -}}
<link rel="icon" type="image/png" sizes="32x32" href="{{ "/favicon-32x32.png" | absURL }}">
{{ end -}}
{{ if (fileExists "static/favicon-16x16.png") -}}
<link rel="icon" type="image/png" sizes="16x16" href="{{ "/favicon-16x16.png" | absURL }}">
{{ end -}}
{{ if (fileExists "static/site.webmanifest") -}}
<link rel="manifest" href="{{ "/site.webmanifest" | absURL }}">
{{ end -}}
{{ if (fileExists "static/safari-pinned-tab.svg") -}}
<link rel="mask-icon" href="{{ "/safari-pinned-tab.svg" | absURL }}" color="#5bbad5">
{{ end -}}
{{ if (fileExists "layouts/partials/meta-tags.html") -}}
{{ partial "meta-tags.html" . }}
{{ end -}}
{{ with resources.Get "css/katex.css" -}}
<link href="{{ .Permalink }}" rel="stylesheet">
{{ end -}}
{{ $normalizeStyle := resources.Get "css/normalize.css" }}
{{ $mainStyle := resources.Get "css/style.css" }}
{{ $overrideStyle := resources.Get "css/override.css" }}
{{ $style := slice $normalizeStyle $mainStyle $overrideStyle | resources.Concat "css/concated.css" | minify }}
<link href="{{ $style.Permalink }}" rel="stylesheet">
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ with resources.GetMatch .Site.Params.bgimg -}}
<style>
body {
background: #ecedef url("{{ .Permalink | safeCSS }}") repeat;
}
</style>
{{- end }}
</head>

View File

@@ -0,0 +1,3 @@
<a href="{{ .Site.BaseURL }}" class="card home-card" style="background-image: url({{if isset .Site.Params "homeimg"}} {{ (resources.Get .Site.Params.homeimg).Permalink | safeCSS }} {{ else }} {{ (resources.Get "img/grey-cloud.jpg").Permalink | safeCSS }} {{ end }})" rel="bookmark" >
Home
</a>

View File

@@ -0,0 +1,35 @@
<nav class="nav-bar card-container">
<div class="card blog-card menu-container">
<h1 class="nav-header">
<a href="{{ .Site.BaseURL }}" class="nav-text">
{{- if isset $.Site.Params "brand"}}
{{- $.Site.Params.brand -}}
{{ else }}
{{- $.Site.Title -}}
{{ end -}}
</a>
</h1>
<br>
<section id="menu">
<ul>
<li><a href="{{ .Site.BaseURL }}" class="">HOME</a></li>
{{ range where .Site.Pages "Params.displayinmenu" true -}}
<li><a href="{{ .Permalink }}" class="">{{ .Title | upper }}</a></li>
{{ end -}}
<!-- Categories -->
<!-- {{ range $key, $value := .Site.Taxonomies.categories -}}
<!-- {{ with $.Site.GetPage (printf "%s%s" "categories/" ($key | urlize)) }}
<li><a href="{{ .Permalink }}" class="">{{ .Title | upper }}</a></li>
{{ end }}
{{- end }} -->
{{ if eq .Site.Params.rssinmenu true -}}
<li><a href="{{ "/index.xml" | absURL }}" class="hamburger-menu-overlay-link">RSS</a></li>
{{- end }}
</ul>
</section>
</div>
</nav>

View File

@@ -0,0 +1,6 @@
<!-- {{ with resources.Get "js/katex.js" }}
<script defer src="{{ .Permalink }}"></script>
{{ end }}
{{ with resources.Get "js/auto-render.js" }}
<script defer src="{{ .Permalink }}" onload="renderMathInElement(document.body);"></script>
{{ end }} -->

View File

@@ -0,0 +1 @@
<div style="clear: both;"></div>

View File

@@ -0,0 +1,14 @@
<picture>
{{ if (fileExists (printf "%s/%s" "content" (replace (.Get "src") (path.Ext (.Get "src")) ".webp"))) -}}
<source srcset="{{ replace (.Get "src") (path.Ext (.Get "src")) ".webp" | absURL }}" type="image/webp">
{{- end }}
{{ $image := $.Page.Resources.GetMatch (.Get "src") }}
{{ if gt $image.Width 800 -}}
{{ $resized := $image.Resize "800x Lanczos" }}
<source srcset="{{ $resized.Permalink }}">
<img src="{{ $resized.Permalink }}" {{ if isset .Params "alt" -}} alt="{{ .Get "alt"}}" {{- end }}>
{{ else }}
<source srcset="{{ $image.Permalink }}">
<img src="{{ $image.Permalink }}" {{ if isset .Params "alt" -}} alt="{{ .Get "alt"}}" {{- end }}>
{{- end}}
</picture>

View File

@@ -0,0 +1 @@
{{.Inner}}

View File

@@ -0,0 +1,36 @@
<picture class="small-pic {{ if eq .Params.clear "true" -}} clear {{- end }}">
{{ if (fileExists (printf "%s/%s" "content" (replace (.Get "src") (path.Ext (.Get "src")) ".webp"))) -}}
<source srcset="{{ replace (.Get "src") (path.Ext (.Get "src")) ".webp" | absURL }}" type="image/webp">
{{- end }}
{{ $image := $.Page.Resources.GetMatch (.Get "src") }}
{{ if or (gt $image.Width 800) (and (isset .Params "width") (gt $image.Width (.Get "width"))) -}}
{{ $.Scratch.Set "imgwidth" "800" }}
{{ if and (isset .Params "width") (lt (.Get "width") 800) -}}
{{ $.Scratch.Set "imgwidth" (trim (.Get "width") "px") }}
{{- end }}
{{ $resized := $image.Resize (printf "%sx Lanczos" ($.Scratch.Get "imgwidth")) }}
<source srcset="{{ $resized.Permalink }}">
<img src="{{ $resized.Permalink }}" class="small-img {{ if isset .Params "smartfloat" -}}
{{- if eq .Params.smartfloat "left" -}}
smartfloat-left
{{- else if eq .Params.smartfloat "right" -}}
smartfloat-right
{{- end -}}
{{- end }}"
{{- with .Get "alt" }} alt="{{ . }}" {{ end -}}
{{- with .Get "width" }} style="width: {{ . }};" {{- end -}}
/>
{{ else }}
<source srcset="{{ $image.Permalink }}">
<img src="{{ $image.Permalink }}" class="small-img {{ if isset .Params "smartfloat" -}}
{{- if eq .Params.smartfloat "left" -}}
smartfloat-left
{{- else if eq .Params.smartfloat "right" -}}
smartfloat-right
{{- end -}}
{{- end }}"
{{- with .Get "alt" }} alt="{{ . }}" {{ end -}}
{{- with .Get "width" }} style="width: {{ . }};" {{- end -}}
/>
{{- end }}
</picture>