This commit is contained in:
Speyll
2022-11-21 22:15:50 +01:00
parent b6b4a9ce6e
commit ba684522ce
37 changed files with 679 additions and 0 deletions

View File

@@ -0,0 +1 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if or (strings.HasPrefix .Destination "http") (strings.HasPrefix .Destination "https") }} target="_blank"{{ end }} >{{ .Text | safeHTML }}</a>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language }}">
{{ partial "head.html" . }}
<body>
{{ partial "header.html" . }}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
{{ partial "footer.html" . }}
</body>
</html>

View File

@@ -0,0 +1,20 @@
{{ define "main" }}
{{ if isset .Data "Term" }}
<h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }}
<h1>Random pondering</h1>
{{ end }}
<ul>
{{- range .Data.Pages -}}
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
<li>
<time class="readData metaData">{{ dateFormat "02, 01 2006" .Date }}</time>
<a href="{{ .RelPermalink }}">{{.Title}}</a>
<span class="readData">» {{ .ReadingTime }} min read.</span>
{{ if .Draft }} <span class="metaData">» draft</span> {{ end }}
</li>
{{- end -}}
{{- end -}}
</ul>
{{ end }}

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

@@ -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.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<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>{{ .Summary | html }}</description>
</item>
{{ end }}
</channel>
</rss>

View File

@@ -0,0 +1,32 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ if .Params.showdate }}
<p>Published on: <time class="metaData">{{ dateFormat "02, Jan 2006" .Date }}</time></p>
{{ end }}
{{ if .Draft }} <span class="metaData">» draft</span> {{ end }}</p>
{{ if isset .Params "tldr" }}
<div class="tldr">
<strong class="metaData">tl;dr:</strong>
{{ .Params.tldr }}
</div>
{{ end }}
<article>
{{ .Content }}
<div>
{{ if ne .Type "page" }}
{{ if gt .Params.tags 0 }}
<ul class="tagsData">
{{ range .Params.tags }}
<li><a href="{{ "tags/" | absLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end }}
</ul>
{{ end }}
{{ end }}
</div>
</article>
{{ end }}

View File

@@ -0,0 +1,20 @@
{{ define "main" }}
{{ if isset .Data "Term" }}
<h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }}
<h1>Random pondering</h1>
{{ end }}
<ul>
{{- range .Data.Pages -}}
{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
<li>
<time class="readData metaData">{{ dateFormat "02, 01 2006" .Date }}</time>
<a href="{{ .RelPermalink }}">{{.Title}}</a>
<span class="readData">» {{ .ReadingTime }} min read.</span>
{{ if .Draft }} <span class="metaData">» draft</span> {{ end }}
</li>
{{- end -}}
{{- end -}}
</ul>
{{ end }}

View File

@@ -0,0 +1,19 @@
{{ define "main" }}
<h1>All tags</h1>
{{ $biggest := 1 }}
{{ $smallest := 1 }}
{{ $max := 3 }}
{{ $min := 1 }}
{{ $size := $min }}
{{ $data := .Data }}
<ul class="tags moreContainer">
{{ range $key, $value := .Data.Terms.ByCount }}
{{ $size := (add (mul (div $value.Count $biggest) (sub $max $min)) $min) }}
{{ $size := (cond (eq $biggest $smallest) $min $size) }}
<li><a href="{{ $.Site.LanguagePrefix | absURL }}{{ $data.Plural }}/{{ $value.Name | urlize }}/">{{ $value.Name }}</a></li>
{{ end }}
</ul>
</div>
{{ end }}