initial commit

This commit is contained in:
Vicky Steeves 2020-10-15 00:39:37 -04:00
commit 311c28ae08
249 changed files with 14034 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
public/
resources/

23
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,23 @@
# This file is a template, and might need editing before it works on your project.
---
# All available Hugo versions are listed here:
# https://gitlab.com/pages/hugo/container_registry
image: registry.gitlab.com/pages/hugo/hugo_extended:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
test:
script:
- hugo
except:
- main
pages:
script:
- hugo
artifacts:
paths:
- public
only:
- main

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "themes/zen"]
path = themes/zen
url = https://github.com/frjo/hugo-theme-zen.git

6
archetypes/default.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

36
archetypes/episodes.md Normal file
View File

@ -0,0 +1,36 @@
---
title: "{{ replace .TranslationBaseName "-" " " | humanize }}"
slug:
author: Vicky Zelda
date: {{ .Date }}
publishDate:
audio: https://files.lorescape.xyz/XX-XXXX.mp3
transcript: https://files.lorescape.xyz/XX-XXXX.txt
draft: true
keywords:
- crypt of the necrodancer
- podcast
- video games
series:
- Crypt of the Necrodancer
tags:
-
-
podcast:
mp3: https://files.lorescape.xyz/XX-XXXX.mp3
duration:
image:
src: /images/01-necrodancer.png
alt: Logo for Crypt of the Necrodancer
episode:
season: 1
---
<!--more-->
{{< audio src="https://files.lorescape.xyz/0X-.mp3">}}
[&darr; Download episode mp3](https://files.lorescape.xyz/00-intro.mp3)
## Transcript
[&darr; Download transcript](https://files.lorescape.xyz/00-intro.txt)

79
config.yaml Normal file
View File

@ -0,0 +1,79 @@
baseurl: "https://zeldaplanted.online/"
title: "Zelda Planted"
theme: "zen"
enableEmoji: true
publishdir: "public"
languageCode: "en-US"
author:
name: "Vicky Zelda"
taxonomies:
category: categories
series: series
tag: tags
params:
contact: "info@zeldaplanted.online"
copyright: "Original content is licensed [CC BY-NC](https://creativecommons.org/licenses/by-nc/4.0/)."
dateformat: "2006-01-02" # Set the date format, default to "2 January, 2006"
description: "" # Set site description, used in meta tags and JSON-LD
metadescription: ""
favicon: "favicon.ico" # Relative path to favicon in json feed, no leading slash.
feedlinks: true # Show feed links in the footer.
footer: ""
icon: "favicon-32x32.png" # Relative path to icon in json feed and JSON-LD, no leading slash.
image: "images/logo.png" # Relative path to site image in JSON-LD, no leading slash.
imageMaxWidth: "" # Max width for images added via figure shortcode.
jquery: true # Add jQuery
languageDir: "" # Set ltr or rtl, defaults to ltr.
logo: false # Turn off the logo.
mainSections: # The sections you want to have listed on the front page.
- "" # Default to the section with most content if not set.
- "" # Set to empty if no section should be listed.
microUsername: "" # Your micro.blog username.
mobileMenu: true # Turn on a mobile menu on small screens.
piwikSiteId: # Matamo site id
piwikTrackerUrl: "" # Matamo url, schemaless and no slash on end (example.org/matamo).
poweredby: false # Show powered by hugo in footer
realfavicongenerator: true # If full set of favicons, site manifest etc. exists, default false.
safariPinnedColor: "#d2f8d2" # Hex color value, used in meta tags, default "#000000".
searchLimit: 20 # Max number of search hits, default 20.
sidebar: false # Show a sidebar to the right
submitted: true # Show author and date information for a post.
themeColor: "#d2f8d2" # Hex color value, used in meta tags, default "#ffffff".
podcast:
title: # * Feed title, defaults to site title (iTunes).
description: # * Feed description/summary, defaults to site description (iTunes).
image: "images/logo.png" # * Feed image, place inside assets directory (iTunes).
category:
name: "" # * Feed category (iTunes).
subcategories: [""] # Feed sub category (iTunes).
explicit: true # Feed explicit settting, default to false (iTunes).
author: "Vicky Zelda" # Feed author (iTunes).
owner:
name: "Vicky Zelda" # Feed owner name (iTunes).
email: "info@zeldaplanted.online" # Feed owner e-mail (iTunes).
lang: # Feed language, defaults to site language (iTunes).
block: no # Block the feed from iTunes, default to no (iTunes).
complete: no # Set the feed as complete, defaults to no (iTunes).
type: "episodic" # Podcast type, defaults to episodic (iTunes).
newfeed: # Are you moving? Set the new feed url here (iTunes).
cdn: "" # CDN url, no slash on end (https://cdn.example.org).
preload: "metadata" # Set on the HTML5 audio tag, defaults to "metadata".
menu:
main:
- Name: "Home"
Identifier: "home"
Weight: -100
URL: "/"
- Name: "Episodes"
Identifier: "episodes"
Weight: -90
URL: "/episodes/"
- Name: "RSS"
Identifier: "subscribe"
Weight: -80
URL: "/episodes/index.xml"

9
content/_index.md Normal file
View File

@ -0,0 +1,9 @@
---
title: "Zelda Planted"
---
# Welcome to the Zelda Planted
{{< figure src="/imgs/zeldaplanted.png" class="mb-1" >}}
This is a podcast all about the wonderful plant, marijuana.

View File

@ -0,0 +1,38 @@
---
title: "Enter the Garden where Zelda is Planted"
author: Vicky Zelda
date: 2020-10-12T19:26:18-04:00
audio: https://files.zeldaplanted.online/00-intro.mp3
transcript: https://files.zeldaplanted.online/00-intro.txt
keywords:
- podcast
- weed
- marijuana
slug: 00-intro
series:
- General
tags:
- intro
podcast:
mp3: https://files.zeldaplanted.online/00-intro.mp3
duration:
image:
src: /images/logo.png
alt: The Zelda Planted logo
episode: 0
season: 1
---
This episode introduces Zelda Planted, a new podcast exploring the multifaceted cultures, technologies, laws, and social norms around marijuana.
<!--more-->
{{< audio src="https://files.zeldaplanted.online/00-intro.mp3">}}
[&darr; Download episode mp3](https://files.zeldaplanted.online/00-intro.mp3)
## Transcript
[&darr; Download transcript](https://files.zeldaplanted.online/00-intro.txt)
00:00:00

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

7
layouts/404.html Normal file
View File

@ -0,0 +1,7 @@
{{ define "main"}}
<main id="main">
<div>
<h1 id="title"><a href="{{ "/" | relURL }}">Go Home</a></h1>
</div>
</main>
{{ end }}

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html class="nojs" lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.LanguageDirection | default "ltr" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ block "title" . }}{{ .Title }} {{ .Site.Title }}{{ end }}</title>
{{ partial "meta.html" . }}
{{ partialCached "styles.html" . }}
{{- block "head" . }}{{ end }}
{{ partial "meta_json_ld.html" . }}
{{ partial "scripts.html" . }}
{{ partialCached "tracking.html" . }}
</head>
{{- partial "header.html" . -}}
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}">
<div class="page layout__page{{ if $.Param "sidebar" | default true }} layout__sidebar-second{{ end }}">
<!-- <header class="header layout__header">
{{ if $.Param "logo" | default true }}<a href="{{ "/" | relLangURL }}" title="Home" rel="home" class="header__logo"><img src="{{ "/images/logo.png" | relURL }}" alt="Home" class="header__logo-image"></a>{{ end }}
<h1 class="header__site-name">
<a href="{{ "/" | relLangURL }}" title="Home" class="header__site-link" rel="home"><span>{{ .Site.Title }}</span></a>
</h1>-->
<div class="region header__region">
{{ if .Site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end -}}
</div>
</header>
{{ partial "menu.html" . }}
{{ block "main" . }}{{ end }}
{{ if $.Param "sidebar" }}{{ partial "sidebar.html" . }}{{ end -}}
<footer class="footer layout__footer">
{{ if $.Param "feedlinks" }}{{ partial "feedlinks.html" . }}{{ end -}}
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>© {{ .Site.Title }}</span>{{ end }}</p>
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://github.com/frjo/hugo-theme-zen">Zen theme</a>.</p>{{ end }}
</footer>
</div>
{{ if $.Param "mobilemenu" }}{{ partial "mobilemenu.html" . }}{{ end -}}
</body>
</html>

View File

@ -0,0 +1,9 @@
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}full-view">
<header>
<h1 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . }}{{ end -}}
</header>
<div class="content">
{{ .Content }}
</div>
</article>

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

@ -0,0 +1 @@
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a> <time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time></li>

View File

@ -0,0 +1,10 @@
{{ define "main" -}}
<main class="main layout__main">
<h1 class="title">{{ .Title }}</h1>
{{ $paginator := .Paginate (.Pages) -}}
{{ range $paginator.Pages -}}
<h2 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end -}}
{{ partial "pagination.html" . }}
</main>
{{ end }}

View File

@ -0,0 +1,47 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{ $length := (len $pages) -}}
{
"version" : "https://jsonfeed.org/version/1",
"title" : "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ .Site.Title }}{{ end }}",
"description": "{{ i18n "string_recent_content" }} {{ if ne .Title .Site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_on" }} {{ .Site.Title }}",
"home_page_url" : "{{ .Site.BaseURL }}",
{{ with .OutputFormats.Get "JSON" -}}
"feed_url" : "{{ .Permalink }}",
{{ end -}}
{{ with $.Param "icon" -}}
"icon" : "{{ . | absURL }}",
{{ end -}}
{{ with $.Param "favicon" -}}
"favicon" : "{{ . | absURL }}",
{{ end -}}
{{ with .Site.Author.name -}}
"author" : {
"name" : "{{ . }}"{{ with $.Site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
"avatar": "{{ . | absURL }}"{{ end }}
},
{{ end -}}
"items" : [
{{ range $index, $element := $pages -}}
{
"title" : {{ .Title | jsonify }},
"date_published" : "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
"date_modified" : "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}",
"id" : "{{ .Permalink }}",
"url" : "{{ .Permalink }}",
{{ with .Params.author -}}
"author" : {
"name" : "{{ . }}"
},
{{ end -}}
"content_html" : {{ .Content | jsonify }}
}{{ if ne (add $index 1) $length }},{{ end }}
{{ end -}}
]
}

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

@ -0,0 +1,46 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $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 }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>{{ i18n "string_recent_content" }} {{ if ne .Title .Site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_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>

View File

@ -0,0 +1,12 @@
{{ define "main" -}}
<main class="main layout__main">
<h1 class="title">{{ .Title }} <a href="/episodes/index.xml"><img src="/images/rss.png" style="vertical-align:sub;"></a></h1>
{{ $paginator := .Paginate (.Pages) -}}
{{ range $paginator.Pages -}}
{{ .Render "summary"}}
<a href="{{ .Param "audio" }}" class="download">&darr; Download episode mp3</a> &nbsp; <a href="{{ .Param "transcript" }}" class="download">&darr; Download transcript</a>
{{ end -}}
{{ partial "pagination.html" . }}
</main>
{{ end }}

View File

@ -0,0 +1,18 @@
{{ define "main" -}}
<main class="main layout__main">
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}single-view">
<header>
<h1 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}">{{ .Title }}</h1>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . }}{{ end -}}
{{ if .Params.tags }}{{ partial "tags.html" . }}{{ end -}}
</header>
<div class="content">
{{ .Content }}
{{ if ne .Lastmod .Date }}{{ partial "dates.html" . }}{{ end -}}
</div>
</article>
</main>
{{ end }}

View File

@ -0,0 +1,10 @@
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}list-view">
<header>
<h2 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . -}}{{ end }}
</header>
<div class="content">
{{ .Summary }}
</div>
</article>

View File

@ -0,0 +1,10 @@
{{ define "main" -}}
<main class="main layout__main">
<h1 class="title">{{ .Title }} </h1>
{{ $paginator := .Paginate (.Pages) -}}
{{ range $paginator.Pages -}}
<h2 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end -}}
{{ partial "pagination.html" . }}
</main>
{{ end }}

View File

@ -0,0 +1,5 @@
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := .Site.RegularPages -}}
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "permalink" $element.RelPermalink "tags" (delimit ($element.Params.tags | default "") " ") "content" $element.Plain "summary" $element.Summary "date" ($element.Date.Format ($.Param "dateformat" | default "2 January, 2006"))) -}}
{{- end -}}
{{- $.Scratch.Get "searchindex" | jsonify -}}

19
layouts/index.html Normal file
View File

@ -0,0 +1,19 @@
{{ define "title" }}{{ .Site.Title }}{{ end }}
{{ define "main" -}}
<main class="main layout__main">
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}single-view">
<div class="content">
{{ .Content }}
</div>
</article>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $paginator := .Paginate $pages -}}
{{ range $paginator.Pages -}}
{{ .Render "summary"}}
{{ end -}}
{{ partial "pagination.html" . }}
</main>
{{ end }}

14
layouts/micro/list.html Normal file
View File

@ -0,0 +1,14 @@
{{ define "main" -}}
<main class="main layout__main">
<h1 class="title">Micro posts</h1>
<p class="micro__follow"><a href="https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}">{{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }}</a></p>
{{ $paginator := .Paginate (.Pages) -}}
{{ range $paginator.Pages -}}
{{ .Render "summary"}}
{{ end -}}
{{ partial "pagination.html" . }}
</main>
{{ end }}

View File

@ -0,0 +1,35 @@
{{ $list := .Pages -}}
{{ $length := (len $list) -}}
{
"version" : "https://jsonfeed.org/version/1",
"title" : "Micro posts {{ i18n "string_on" }} {{ .Site.Title }}",
"description": "Micro blog {{ i18n "string_by" }} {{ with $.Site.Author.name }}{{ . }}{{end}}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}",
"home_page_url" : "{{ .Site.BaseURL }}",
{{ with .OutputFormats.Get "JSON" -}}
"feed_url" : "{{ .Permalink }}",
{{ end -}}
{{ with $.Param "icon" -}}
"icon" : "{{ . | absURL }}",
{{ end -}}
{{ with $.Param "favicon" -}}
"favicon" : "{{ . | absURL }}",
{{ end -}}
{{ with .Site.Author.name -}}
"author" : {
"name" : "{{ . }}"{{ with $.Site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
"avatar": "{{ . | absURL }}"{{ end }}
},
{{ end -}}
"items" : [
{{ range $index, $element := $list -}}
{
"date_published" : "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
"date_modified" : "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}",
"id" : "{{ .Permalink }}",
"url" : "{{ .Permalink }}",
"content_html" : {{ .Content | jsonify }}
}{{ if ne (add $index 1) $length }},{{ end }}
{{ end -}}
]
}

34
layouts/micro/rss.xml Normal file
View File

@ -0,0 +1,34 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Micro posts {{ i18n "string_on" }} {{ .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>Micro blog {{ i18n "string_by" }} {{ with $.Site.Author.name }}{{ . }}{{end}}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}</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>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

16
layouts/micro/single.html Normal file
View File

@ -0,0 +1,16 @@
{{ define "main" -}}
<main class="main layout__main">
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}single-view">
<header>
<h1 class="hidden">{{ .Title }}</h1>
<p>
{{ with $.Param "author" }}<span class="author">{{ . }}</span> {{ end -}}
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
</p>
</header>
<div class="content">
{{ .Content }}
</div>
</article>
</main>
{{ end }}

View File

@ -0,0 +1,12 @@
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}list-view">
<header>
<h2 class="hidden">{{ .Title }}</h2>
<p><a href="{{ .RelPermalink }}">
{{ with $.Param "author" }}<span class="author">{{ . }}</span> {{ end -}}
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
</a></p>
</header>
<div class="content">
{{ .Content }}
</div>
</article>

View File

@ -0,0 +1,4 @@
<p class="content-dates">
{{ i18n "last_mod" }} {{ .Lastmod.Format ($.Param "dateformat" | default "2 January, 2006") }}<br>
{{ i18n "created" }} {{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}
</p>

View File

@ -0,0 +1,8 @@
{{ $list := .AlternativeOutputFormats -}}
{{ $length := (len $list) -}}
{{ if $list -}}
<p>Subscribe{{ with .Section }} to {{ . }}{{ end }}: {{ range $index, $element := $list -}}
<a rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">{{ .Name }}</a>{{ if ne (add $index 1) $length }} | {{ end }}
{{- end -}}
</p>
{{ end -}}

View File

@ -0,0 +1,3 @@
<link rel="stylesheet" href="/css/custom.css">
<div><img src="/images/header.png" style="margin: 0 auto; display:block;"></div>

View File

@ -0,0 +1,16 @@
<h2 class="visually-hidden">{{ i18n "lang_select_title" }}</h2>
<nav class="language-selector layout__language-selector">
<ul class="navbar">
{{ if .IsTranslated -}}
{{ range .Translations }}
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .Language.LanguageName }}</a></li>
{{ end -}}
{{ else -}}
{{ range .Site.Languages -}}
{{ if ne $.Site.Language.Lang .Lang }}
<li><a rel="alternate" href="{{ .Lang | relURL }}" hreflang="{{ .Lang }}" lang="{{ .Lang }}">{{ .LanguageName }}</a></li>
{{ end -}}
{{ end -}}
{{ end -}}
</ul>
</nav>

View File

@ -0,0 +1,24 @@
<nav class="main-menu layout__navigation">
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
<ul class="navbar">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ if .HasChildren }}
<li class="dropdown">
<a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a>
<ul class="dropdown-content">
{{ range .Children }}
<li>
<a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a>
</li>
{{ end }}
</ul>
</li>
{{ else }}
<li>
<a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</nav>

View File

@ -0,0 +1,31 @@
{{ range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" {{ printf "type=%q" .MediaType.Type | safeHTMLAttr }} title="{{ .Name }}" href="{{ .Permalink | safeURL }}">
{{ end -}}
<meta name="description" content="{{ with (.Description | default (replaceRE "\n" " " (.Summary | truncate 170))) }}{{ . }}{{ end }}">
<meta name="created" {{printf "content=%q" (.Date.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
<meta name="modified" {{printf "content=%q" (.Lastmod.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:title" content="{{ .Title }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
{{ with $.Param "image" }}<meta property="og:image" content="{{ . | absURL }}">{{ end }}
{{ hugo.Generator }}
<meta name="msapplication-TileColor" content="{{ $.Param "themecolor" | default "#ffffff" }}">
<meta name="theme-color" content="{{ $.Param "themecolor" | default "#ffffff" }}">
{{ with .Site.Params.piwikTrackerUrl }}<link rel="dns-prefetch" href="https://{{ . }}">{{ end }}
{{ with $.Param "microusername" }}<link rel="me" href="https://micro.blog/{{ . }}">{{ end }}
<link rel="canonical" href="{{ .Permalink }}">
{{ if .IsTranslated -}}
{{ range .Translations }}
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .RelPermalink }}">
{{ end -}}
{{ end -}}
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | relURL }}">
{{ if $.Param "realfavicongenerator" -}}
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon-32x32.png" | relURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon-16x16.png" | relURL }}">
<link rel="mask-icon" href="{{ "safari-pinned-tab.svg" | relURL }}" color="{{ $.Param "safaripinnedcolor" | default "#000000" }}">
<link rel="manifest" href="{{ "site.webmanifest" | relURL }}">
{{ end -}}

View File

@ -0,0 +1,47 @@
<script type="application/ld+json">
{
"@context": "https://schema.org",
{{ if .IsPage -}}
"@type": {{ if or (eq .Section "blog") (eq .Section "post") }}"BlogPosting"{{ else }}"WebPage"{{ end }},
"headline": {{ .Title }},
"datePublished": {{ .Date.Format "2006-01-02T15:04:05Z07:00" }},
"dateModified": {{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
"url" : {{ .Permalink }},
"description": {{ with (.Description | default (replaceRE "\n" " " (.Summary | truncate 170))) }}{{ . }}{{ end }},
{{ with .Params.tags -}}
"keywords": {{ . }},
{{ end -}}
{{ else -}}
"@type": "WebPage",
"url" : {{ .Permalink }},
"name": {{ .Title }},
{{ with $.Param "description" -}}
"description": {{ . }},
{{ end -}}
{{ end -}}
{{ with $.Param "image" -}}
"image" : {{ . | absURL }},
{{ end -}}
{{ with $.Param "author" -}}
"author": {
"@type": "Person",
"name": {{ . }}
},
{{ end -}}
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{ .Site.BaseURL }}
},
"publisher": {
"@type": "Organization",
"name": {{ .Site.Title }},
{{ with $.Param "icon" -}}
"logo" : {
"@type": "ImageObject",
"url": {{ . | absURL }}
},
{{ end -}}
"url": {{ .Site.BaseURL }}
}
}
</script>

View File

@ -0,0 +1,35 @@
<div class="mobile-nav" dir="ltr">
<div class="mobile-nav__cover"></div>
<a href="#navigation" class="mobile-nav__toggle" aria-haspopup="true" role="button">{{ i18n "menu_mobile" }}</a>
<div class="mobile-nav__sheet">
<div class="mobile-nav__region">
{{ if .Site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }}
</div>
<nav class="mobile-nav__main-menu">
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
<ul class="mobile-nav__navbar">
{{ if .Site.Menus.main -}}
{{ $currentPage := . -}}
{{ range .Site.Menus.main -}}
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a></li>
{{ end -}}
{{ else -}}
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
{{ with .Site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where .Site.RegularPages "Section" "" -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
{{ range .Site.Sections -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
{{ end -}}
</ul>
</nav>
</div>
</div>

View File

@ -0,0 +1,11 @@
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) -}}
<nav class="pager">
{{ if .Paginator.HasPrev -}}
<a href="{{ .Paginator.Prev.URL }}" rel="prev" class="pager-item pager-prev">{{ i18n "pager_prev" }}</a>
{{ end -}}
{{ if .Paginator.HasNext -}}
<a href="{{ .Paginator.Next.URL }}" rel="next" class="pager-item pager-next">{{ i18n "pager_next" }}</a>
{{ end -}}
</nav>
{{ end -}}

View File

@ -0,0 +1,12 @@
{{ $src := (.Params.podcast.mp3 | absURL) -}}
{{ if .Site.Params.Podcast.cdn -}}
{{ $src = add $.Site.Params.Podcast.cdn (.Params.podcast.mp3 | relURL) -}}
{{ end -}}
<figure class="podcast">
<audio controls preload="{{ .Site.Params.Podcast.preload | default "metadata" }}"><source src="{{ $src }}" type="audio/mpeg"></audio>
<figcaption><a href="{{ $src }}">{{ .Title }}</a></figcaption>
</figure>
{{ with .Params.podcast.image }}
{{ $resource := resources.Get .src }}{{ $size := "250x" }}{{ with .width }}{{ $size = (add (string .) "x") }}{{ end }}{{ $image := $resource.Resize $size -}}
<figure class="image {{ .class | default "right" }}"><img src="{{ $image.RelPermalink }}" width="{{ .width | default "250" }}" alt="{{ .alt }}"></figure>
{{ end -}}

View File

@ -0,0 +1,24 @@
{{ $early := resources.Get "js/script-early.js" | minify | fingerprint -}}
<script src="{{ $early.RelPermalink }}"></script>
{{ if $.Param "jquery" -}}
{{ $jquery := resources.Get "js/lib/jquery.slim.min.js" | fingerprint -}}
<script defer src="{{ $jquery.RelPermalink }}"></script>
{{ end -}}
{{ $umbrella := resources.Get "js/lib/umbrella.min.js" | fingerprint -}}
<script defer src="{{ $umbrella.RelPermalink }}"></script>
{{ if $.Param "mobilemenu" -}}
{{ $mobilemenu := resources.Get "js/mobile.js" | minify | fingerprint -}}
<script defer src="{{ $mobilemenu.RelPermalink }}"></script>
{{ end -}}
{{ if .HasShortcode "contact" -}}
{{ $contact := resources.Get "js/contact.js" | minify | fingerprint -}}
<script defer src="{{ $contact.RelPermalink }}"></script>
{{ end -}}
{{ if .HasShortcode "search" -}}
{{ $flexsearch := resources.Get "js/lib/flexsearch.min.js" | fingerprint -}}
<script defer src="{{ $flexsearch.RelPermalink }}"></script>
{{ $search := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" . | minify | fingerprint -}}
<script defer src="{{ $search.RelPermalink }}"></script>
{{ end -}}
{{ $script := resources.Get "js/script.js" | minify | fingerprint -}}
<script defer src="{{ $script.RelPermalink }}"></script>

View File

@ -0,0 +1,15 @@
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
<aside class="sidebar layout__second-sidebar">
{{ range .Site.Sections -}}
<section>
<h4 class="menu"><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></h4>
<ul class="menu">
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
</ul>
</section>
{{ end -}}
</aside>

View File

@ -0,0 +1,19 @@
{{ $main_options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" false "includePaths" (slice "assets/lib/typey/stylesheets")) -}}
{{ if eq hugo.Environment "development" -}}
{{ $main_options = merge $main_options (dict "outputStyle" "nested" "enableSourceMap" true) -}}
{{ end -}}
{{ $mobile_options := merge $main_options (dict "targetPath" "css/mobile.css") -}}
{{ $print_options := merge $main_options (dict "targetPath" "css/print.css") -}}
{{ $main_style := resources.Get "sass/styles.scss" | toCSS $main_options -}}
{{ $mobile_style := resources.Get "sass/mobile.scss" | toCSS $mobile_options -}}
{{ $print_style := resources.Get "sass/print.scss" | toCSS $print_options -}}
{{ if ne hugo.Environment "development" -}}
{{ $main_style = $main_style | fingerprint -}}
{{ $mobile_style = $mobile_style | fingerprint -}}
{{ $print_style = $print_style | fingerprint -}}
{{ end -}}
{{ if $.Param "mobilemenu" -}}
<link rel="stylesheet" href="{{ $mobile_style.RelPermalink }}" media="screen">
{{ end -}}
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
<link rel="stylesheet" href="{{ $print_style.RelPermalink }}" media="print">

View File

@ -0,0 +1,4 @@
<div class="submitted">
{{ with $.Param "author" }}<span class="author" itemprop="author">{{ . }}</span> {{ end -}}
<time class="created-date" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">{{ .Date.Format ($.Param "dateformat" | default "2 January, 2006") }}</time>
</div>

View File

@ -0,0 +1,8 @@
<div class="tags">
{{ i18n "taxo_tags" }}:
<ul>
{{ range .Params.tags -}}
<li><a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a></li>
{{ end -}}
</ul>
</div>

View File

@ -0,0 +1,11 @@
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID -}}
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
<script defer src="https://{{ .Site.Params.piwikTrackerUrl }}/matomo.js"></script>
{{ end -}}
{{ if .Site.GoogleAnalytics -}}
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
<script defer src="https://ssl.google-analytics.com/ga.js"></script>
{{ end -}}

10
layouts/podcast/full.html Normal file
View File

@ -0,0 +1,10 @@
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}full-view">
<header>
<h1 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . }}{{ end -}}
</header>
{{ partial "podcast.html" . -}}
<div class="content">
{{ .Content }}
</div>
</article>

64
layouts/podcast/rss.xml Normal file
View File

@ -0,0 +1,64 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ .Site.Params.Podcast.Title | default .Site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>{{ .Site.Params.Podcast.Description | default .Site.Params.Description }}</description>
<generator>Hugo -- gohugo.io</generator>
<language>{{ .Site.Params.Podcast.Lang | default .Site.LanguageCode }}</language>
{{ 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 -}}
{{ with .Site.Params.Podcast.Image }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
{{ with .Site.Params.Podcast.Category -}}
<itunes:category {{ if .name }}text="{{ .name }}"{{end}}>
{{ range .subcategories }}<itunes:category text="{{ . }}" />{{ end }}
</itunes:category>
{{ end -}}
{{ with .Site.Params.Podcast.Owner -}}
<itunes:owner>
{{ with .name }}<itunes:name>{{ . }}</itunes:name>{{ end }}
{{ with .email }}<itunes:email>{{ . }}</itunes:email>{{ end }}
</itunes:owner>
{{ end -}}
{{ with .Site.Params.Podcast.Description }}<itunes:summary>{{ . }}</itunes:summary>{{ end }}
{{ with .Site.Params.Podcast.Author }}<itunes:author>{{ . }}</itunes:author>{{ end }}
{{ with .Site.Params.Podcast.Type }}<itunes:type>{{ . }}</itunes:type>{{ end }}
{{ with .Site.Params.Podcast.Block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
{{ with .Site.Params.Podcast.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
{{ with .Site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ end }}
<itunes:explicit>{{ if .Site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
{{ range .Pages }}
<item>
<title>{{ .Title }}</title>
<itunes:title>{{ .Title }}</itunes:title>
<link>{{ .Permalink }}</link>
<guid>{{ .Permalink }}</guid>
<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 -}}
<description>{{ .Content | html }}</description>
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (add "/static" (. | relURL)) }}<enclosure url="{{ if $.Site.Params.Podcast.cdn }}{{ add $.Site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
{{ with .Params.podcast.duration }}<itunes:duration>{{ . }}</itunes:duration>{{ end }}
{{ with .Params.podcast.image.src }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
{{ with .Params.podcast.episode }}<itunes:episode>{{ . }}</itunes:episode>{{ end }}
{{ with .Params.podcast.episodeType }}<itunes:episodeType>{{ . }}</itunes:episodeType>{{ end }}
{{ with .Params.podcast.season }}<itunes:season>{{ . }}</itunes:season>{{ end }}
{{ with .Params.podcast.block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
<itunes:explicit>{{ if .Params.podcast.explicit }}true{{ else }}false{{ end }}</itunes:explicit>
</item>
{{ end }}
</channel>
</rss>

View File

@ -0,0 +1,15 @@
{{ define "main" -}}
<main class="main layout__main">
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}single-view">
<header>
<h1 class="title {{ if $.Param "submitted" | default false }}title-submitted{{ end }}">{{ .Title }}</h1>
{{ if $.Param "submitted" | default false }}{{ partial "submitted.html" . }}{{ end -}}
{{ if .Params.tags }}{{ partial "tags.html" . }}{{ end -}}
</header>
{{ partial "podcast.html" . -}}
<div class="content">
{{ .Content }}
</div>
</article>
</main>
{{ end }}

View File

@ -0,0 +1,6 @@
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
<audio controls preload="{{ .Get "preload" | default "metadata" }}">
{{ with .Get "src" }}<source src="{{ . | relURL }}" type="audio/mpeg">{{ end }}
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
</audio>
</figure>

View File

@ -0,0 +1 @@
<div class="clearfix"></div>

View File

@ -0,0 +1,16 @@
<p class="error message js-hidden">{{ i18n "js_required" }}</p>
<p class="contact-submitted status message hidden">{{ i18n "contact_submitted" }}</p>
<p class="contact-error error message hidden">{{ i18n "contact_error" }}</p>
<form class="contact-form hidden" action="#" method="post" accept-charset="UTF-8">
<label for="edit-name">{{ i18n "contact_name" }}</label>
<input type="text" id="edit-name" name="name" placeholder="{{ i18n "contact_name_placeholder" }}" tabindex="1" required autofocus><span></span>
<label for="edit-mail">{{ i18n "contact_mail" }}</label>
<input type="email" id="edit-mail" name="email" placeholder="{{ i18n "contact_mail_placeholder" }}" tabindex="2" required><span></span>
<input type="text" id="edit-url" class="hidden" name="url" placeholder="{{ i18n "contact_honypot" }}">
<label for="edit-subject">{{ i18n "contact_subject" }}</label>
<input type="text" id="edit-subject" name="subject" placeholder="{{ i18n "contact_subject_placeholder" }}" tabindex="3" required><span></span>
<label for="edit-message">{{ i18n "contact_message" }}</label>
<textarea id="edit-message" name="message" rows="5" placeholder="{{ i18n "contact_message_placeholder" }}" tabindex="4" required></textarea><span></span>
<button type="submit" name="submit" class="form-submit" disabled>{{ i18n "contact_submit" }}</button>
</form>

View File

@ -0,0 +1,50 @@
{{ $maxwidth := .Site.Params.imageMaxWidth -}}
{{ $realwidth := 0 -}}
{{ $realheight := 0 -}}
{{ $width := 0 -}}
{{ $height := 0 -}}
{{ $height := 0 -}}
{{ if (fileExists (add "/static" (.Get "src"))) -}}
{{ with (imageConfig (add "/static" (.Get "src"))) -}}
{{ $realwidth = .Width -}}
{{ $realheight = .Height -}}
{{ $width = .Width -}}
{{ $height = .Height -}}
{{ end -}}
{{ end -}}
{{ if and (.Get "width") (.Get "height") -}}
{{ $width = (int (.Get "width")) -}}
{{ $height = (int (.Get "height")) -}}
{{ else if (.Get "width") -}}
{{ $width = (int (.Get "width")) -}}
{{ if and ($realwidth) (lt ($width) ($realwidth)) -}}
{{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}}
{{ $height = (math.Round $height) -}}
{{ end -}}
{{ else if (.Get "height") -}}
{{ $height = (int (.Get "height")) -}}
{{ if and ($realheight) (lt ($height) ($realheight)) -}}
{{ $width = (mul ($realwidth) (div (add ($height) 0.0) ($realheight))) -}}
{{ $width = (math.Round $width) -}}
{{ end -}}
{{ else if and ($maxwidth) (lt ($maxwidth) ($width)) -}}
{{ $width = ($maxwidth) -}}
{{ $height = (mul ($realheight) (div (add ($width) 0.0) ($realwidth))) -}}
{{ $height = (math.Round $height) -}}
{{ end -}}
<figure class="image {{ .Get "class" | default "" }}">
{{ with .Get "link" }}<a href="{{ . }}">{{ end -}}
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }}{{ with $width }} width="{{ . }}"{{ end }}{{ with $height }} height="{{ . }}"{{ end }}>
{{- if .Get "link" }}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption" | markdownify)) (.Get "attr") -}}
<figcaption>{{ if isset .Params "title" }}
<h4>{{ .Get "title" }}</h4>{{ end }}
{{ if or (.Get "caption") (.Get "attr") -}}
<p>
{{- .Get "caption" -}}
{{ with .Get "attrlink" }}<a href="{{ . }}">{{ end }}{{ .Get "attr" | markdownify }}{{ if .Get "attrlink" }}</a>{{ end -}}
</p>
{{ end -}}
</figcaption>
{{ end -}}
</figure>

View File

@ -0,0 +1,22 @@
<p class="error message js-hidden">{{ i18n "js_required" }}</p>
<p class="search-loading status message hidden">{{ i18n "search_loading" }}</p>
<div class="search-input hidden">
<form id="search-form" class="search-form" action="#" method="post" accept-charset="UTF-8" role="search">
<label for="query" class="visually-hidden">{{ i18n "search_title" }}</label>
<input type="search" id="query" name="query" class="search-text" placeholder="{{ i18n "search_placeholder" }}" maxlength="128">
<button type="submit" name="submit" class="form-submit" >{{ i18n "search_title" }}</button>
</form>
</div>
<div class="search-results"></div>
<template>
<article class="search-result list-view">
<header>
<h2 class="title title-submitted"><a href="#">Title here</a></h2>
<div class="submitted"><time class="created-date">Date here</time></div>
</header>
<div class="content">Summary here</div>
</article>
</template>

View File

@ -0,0 +1,6 @@
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
<video controls preload="{{ .Get "preload" | default "metadata" }}" {{ with .Get "width" }}width="{{ . }}"{{ end }}>
{{ with .Get "src" }}<source src="{{ . | relURL }}" type="video/mp4">{{ end }}
</video>
{{ with .Get "caption" }}<figcaption>{{ . }}</figcaption>{{ end }}
</figure>

View File

@ -0,0 +1 @@
<div class="{{ .Get 0 }}">{{ if eq (.Get 1) "nomarkdown" }}{{ .Inner }}{{ else }}{{ .Inner | markdownify }}{{ end }}</div>

View File

@ -0,0 +1,11 @@
{{ define "main" -}}
<main class="main layout__main">
<h1 class="title">{{ .Title }} <a href="{{ .Permalink | safeURL }}"><img src="/images/rss.png" style="vertical-align:sub;"></a></h1>
{{ $paginator := .Paginate (.Pages) -}}
{{ range $paginator.Pages -}}
{{ .Render "summary"}}
<a href="{{ .Param "audio" }}" class="download">&darr; Download episode mp3</a> &nbsp; <a href="{{ .Param "transcript" }}" class="download">&darr; Download transcript</a>
{{ end -}}
{{ partial "pagination.html" . }}
</main>
{{ end }}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
static/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

9
static/browserconfig.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

48
static/css/custom.css Normal file
View File

@ -0,0 +1,48 @@
@font-face {
font-family: 'Comfortaa';
src: url('/fonts/Comfortaa/Comfortaa-VariableFont_wght.ttf');
}
.list-page, .single-page {
background-color: #93cb56;
}
h1, h2, h3, h4, h5, h6 {
font-family: Comfortaa;
}
body, .submitted, .tags, .navbar {
font-family: Comfortaa;
}
body p {
font-size: 1.3em;
}
.submitted, .tags {
font-size: 1.3em;
color: black;
}
.navbar {
font-size: 1.3em;
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
}
.dropdown:hover .dropdown-content {
display: block;
}

BIN
static/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

BIN
static/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

View File

@ -0,0 +1,93 @@
Copyright 2011 The Comfortaa Project Authors (https://github.com/alexeiva/comfortaa), with Reserved Font Name "Comfortaa".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@ -0,0 +1,67 @@
Comfortaa Variable Font
=======================
This download contains Comfortaa as both a variable font and static fonts.
Comfortaa is a variable font with this axis:
wght
This means all the styles are contained in a single file:
Comfortaa-VariableFont_wght.ttf
If your app fully supports variable fonts, you can now pick intermediate styles
that arent available as static fonts. Not all apps support variable fonts, and
in those cases you can use the static font files for Comfortaa:
static/Comfortaa-Light.ttf
static/Comfortaa-Regular.ttf
static/Comfortaa-Medium.ttf
static/Comfortaa-SemiBold.ttf
static/Comfortaa-Bold.ttf
Get started
-----------
1. Install the font files you want to use
2. Use your app's font picker to view the font family and all the
available styles
Learn more about variable fonts
-------------------------------
https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
https://variablefonts.typenetwork.com
https://medium.com/variable-fonts
In desktop apps
https://theblog.adobe.com/can-variable-fonts-illustrator-cc
https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
Online
https://developers.google.com/fonts/docs/getting_started
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
Installing fonts
MacOS: https://support.apple.com/en-us/HT201749
Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
Android Apps
https://developers.google.com/fonts/docs/android
https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
License
-------
Please read the full license text (OFL.txt) to understand the permissions,
restrictions and requirements for usage, redistribution, and modification.
You can use them freely in your products & projects - print or digital,
commercial or otherwise. However, you can't sell the fonts on their own.
This isn't legal advice, please consider consulting a lawyer and see the full
license for all details.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
static/images/header.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

BIN
static/images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
static/images/logo@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
static/images/rss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/mstile-150x150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

19
static/site.webmanifest Normal file
View File

@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

2
themes/zen/.eslintignore Normal file
View File

@ -0,0 +1,2 @@
*.min.js
umbrella.js

143
themes/zen/.eslintrc.yaml Normal file
View File

@ -0,0 +1,143 @@
extends: eslint:recommended
env:
browser: true
globals:
jQuery: true
u: true
rules:
array-bracket-spacing:
- "error"
- never
block-scoped-var: "error"
brace-style:
- "error"
- stroustrup
- allowSingleLine: true
comma-dangle:
- "error"
- never
comma-spacing: "error"
comma-style:
- "error"
- last
computed-property-spacing:
- "error"
- never
curly:
- "error"
- all
eol-last: "error"
eqeqeq:
- "error"
- smart
guard-for-in: "error"
indent:
- "error"
- 2
- SwitchCase: 1
key-spacing:
- "error"
- afterColon: true
beforeColon: false
keyword-spacing:
- "error"
- after: true
before: true
linebreak-style:
- "error"
- unix
lines-around-comment:
- "error"
- afterBlockComment: false
beforeBlockComment: true
max-nested-callbacks:
- "warn"
- 3
new-parens: "error"
no-array-constructor: "error"
no-caller: "error"
no-catch-shadow: "error"
no-eval: "error"
no-extend-native: "error"
no-extra-bind: "error"
no-extra-parens:
- "error"
- functions
no-implied-eval: "error"
no-iterator: "error"
no-label-var: "error"
no-labels: "error"
no-lone-blocks: "error"
no-loop-func: "error"
no-multi-spaces: "error"
no-multi-str: "error"
no-native-reassign: "error"
no-nested-ternary: "error"
no-new-func: "error"
no-new-object: "error"
no-new-wrappers: "error"
no-octal-escape: "error"
no-process-exit: "error"
no-proto: "error"
no-return-assign: "error"
no-script-url: "error"
no-sequences: "error"
no-shadow-restricted-names: "error"
no-spaced-func: "error"
no-trailing-spaces: "error"
no-undef-init: "error"
no-undefined: "error"
no-unused-expressions: "error"
no-unused-vars:
- "error"
- args: none
vars: all
no-with: "error"
object-curly-spacing:
- "error"
- never
one-var:
- "error"
- never
quote-props:
- "error"
- consistent-as-needed
quotes:
- "error"
- single
- avoid-escape
semi:
- "error"
- always
semi-spacing:
- "error"
- after: true
before: false
space-before-blocks:
- "error"
- always
space-before-function-paren:
- "error"
- anonymous: always
named: never
space-in-parens:
- "error"
- never
space-infix-ops: "error"
space-unary-ops:
- "error"
- nonwords: false
words: true
spaced-comment:
- "error"
- always
strict: "error"
valid-jsdoc:
- "warn"
- prefer:
property: prop
returns: return
requireReturn: false
yoda:
- "error"
- never

1
themes/zen/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

124
themes/zen/.sass-lint.yml Normal file
View File

@ -0,0 +1,124 @@
# Documentation for the sass-lint Linters is available at:
# https://github.com/sasstools/sass-lint/tree/master/docs/rules
options:
formatter: stylish
merge-default-rules: true
rules:
# Extends
extends-before-mixins: 2
extends-before-declarations: 2
placeholder-in-extend: 2
# Mixins
mixins-before-declarations:
- 2
- exclude:
- 'breakpoint'
- 'mq'
- 'respond-to'
- 'rtl'
- 'zen-breakpoint'
- 'zen-layout'
- 'zen-mq'
- 'zen-respond-to'
# Line Spacing
one-declaration-per-line: 2
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: false
single-line-per-selector: 2
# Disallows
no-attribute-selectors: 0
no-color-hex: 2
no-color-keywords: 2
no-color-literals: 2
no-combinators: 0
no-css-comments: 2
no-debug: 2
no-disallowed-properties: 2
no-duplicate-properties: 2
no-empty-rulesets: 0
no-extends: 0
no-ids: 2
no-important: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
no-misspelled-properties:
- 2
- extra-properties:
- '*font-family'
- '*height'
- 'interpolation-mode'
- '*margin-left'
- '*vertical-align'
- '*width'
no-qualifying-elements: 0
no-trailing-whitespace: 2
no-trailing-zero: 2
no-transition-all: 0
no-universal-selectors: 0
no-url-protocols: 2
no-vendor-prefixes: 2
no-warn: 2
property-units: 0
# Nesting
force-attribute-nesting: 0
force-element-nesting: 0
force-pseudo-nesting: 0
# Name Formats
class-name-format:
- 2
- convention: hyphenatedbem
function-name-format: 2
id-name-format: 2
mixin-name-format:
- 2
- convention: hyphenatedbem
placeholder-name-format:
- 2
- convention: hyphenatedbem
variable-name-format: 2
# Style Guide
attribute-quotes: 2
bem-depth: 0
border-zero: 2
brace-style:
- 2
- style: stroustrup
- allow-single-line: false
clean-import-paths: 2
empty-args: 0
hex-length: 2
hex-notation: 2
indentation: 2
leading-zero: 2
nesting-depth:
- 2
- max-depth: 4
property-sort-order: 0
pseudo-element: 1
quotes: 2
shorthand-values: 2
url-quotes: 2
variable-for-property: 2
zero-unit: 2
# Inner Spacing
space-after-comma: 2
space-before-colon: 2
space-after-colon: 2
space-before-brace: 2
space-before-bang: 2
space-after-bang: 2
space-between-parens: 0
space-around-operator: 0
# Final Items
trailing-semicolon: 2
final-newline: 2

339
themes/zen/LICENSE.txt Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

550
themes/zen/README.md Normal file
View File

@ -0,0 +1,550 @@
# The Hugo Zen theme
**Zen** theme strives to be as clean and standard compliant as possible with some neat features. A solid base for your custom [Hugo](https://gohugo.io/) theme.
It uses HTML5 with a modern CSS grid and flex layout. Recent versions of all the mayor browsers support it, see [Can I use css grid](http://caniuse.com/#search=grid).
Sass is processed with Hugo pipes. To make using npm optional I have added the stylesheets from the excellent sass plugin [typey](https://www.npmjs.com/package/typey) directly to the theme.
![Lighthouse report](https://raw.githubusercontent.com/frjo/hugo-theme-zen/master/images/lighthouse_report.png)
## Table of contents
* [Features](#features)
* [Demo](#demo)
* [Minimum Hugo version](#minimum-hugo-version)
* [Installation](#installation)
* [Updating](#updating)
* [Run example site](#run-example-site)
* [Performance](#performance)
* [Sites using the Hugo Zen theme](#sites-using-the-hugo-zen-theme)
* [Screenshots](#screenshots)
* [Configuration](#configuration)
* [Customise](#customise)
* [Multilingual](#multilingual)
* [Search](#search)
* [Contact form](#contact-form)
* [Dates](#dates)
* [Podcast](#podcast)
* [Shortcodes](#shortcodes)
* [Choose between using jQuery or Umbrella JS](#choose-between-using-jquery-or-umbrella-js)
* [Use Gulp to lint Sass and JavaScript](#use-gulp-to-lint-sass-and-javascript)
* [Getting help](#getting-help)
* [Credits](#credits)
## Features
* A mobile menu
* Analytics with Matamo (Piwik)
* Automatic linting of css and js
* Contact form (PHP)
* CSS grid and flex for layout
* Gulp.js (only for sass/js lint)
* HTML5
* Hugo Pipes for js and sass
* jQuery 3
* Micro.blog
* Minify css
* Meta tags and JSON-LD
* Multilingual (i18n)
* Normalize CSS
* Podcast
* Responsive design
* RSS and JSON feeds with full content
* Search with FlexSearch.js
* Sub theme support (Theme Components)
* Umbrella JS 3 (tiny jQuery replacement, 2.5kB when gzipped)
## Demo
https://themes.gohugo.io/theme/hugo-theme-zen/
## Minimum Hugo version
Hugo Extended version 0.67.1 or higher is required.
## Installation
You can download and unpack the theme manually from Github but it's easier to use git to clone the repo.
From the root of your site:
```
$ git clone https://github.com/frjo/hugo-theme-zen.git themes/zen
```
If you use git to version control your site, highly recommended, it's best to add the zen theme as a submodule.
From the root of your site:
```
git submodule add https://github.com/frjo/hugo-theme-zen.git themes/zen
```
## Updating
From the root of your site:
```
git submodule update --remote --merge
```
## Run example site
From the root of `themes/zen/exampleSite`:
```
hugo server --themesDir ../..
```
## Performance
Performance should be excellent.
* Minimal and compliant HTML5
* Styles 17,7 kB (4,3 kB when gzipped)
* JavaScript 8,4 kB (2,7 kB when gzipped)
* All scripts loaded in head with "defer"
* Optimised for HTTP/2
Some performance tools will complain about to many files (js and css files are not concatenated) but with HTTP/2 that can be ignored.
## Sites using the Hugo Zen theme
* [BypassCensorship](https://www.bypasscensorship.org/) (multilingual)
* [Combonetwork development](https://combonet.se/) (multilingual)
* [DevSecOps Talks](https://devsecops.fm)
* [Drejargården](https://www.drejargarden.se/)
* [Helmer Grundström](https://www.helmergrundstrom.se/)
* [xdeb.org](https://xdeb.org/)
* [xdeb.net](https://xdeb.net/)
## Screenshots
### On the large screen
![screenshot](https://raw.githubusercontent.com/frjo/hugo-theme-zen/master/images/tn.png)
### On the small screen
![screenshot](https://raw.githubusercontent.com/frjo/hugo-theme-zen/master/images/tn_mobil.png)
### The mobile menu
![screenshot](https://raw.githubusercontent.com/frjo/hugo-theme-zen/master/images/tn_mobil_menu.png)
## Configuration
Configurations parameters for the sites config file, in yaml format. All the "params" are optional.
```
baseurl: "https://example.org/"
title: "SiteTitle"
theme: "zen"
params:
contact: "info@example.org"
copyright: "This site is licensed under a
(https://creativecommons.org/licenses/by-sa/4.0/)."
[Creative Commons Attribution-ShareAlike 4.0 International License]
dateformat: "" # Set the date format, default to "2 January, 2006"
description: "" # Set site description, used in meta tags and JSON-LD
favicon: "" # Relative path to favicon in json feed, no leading slash.
feedlinks: true # Show feed links in the footer.
footer: "A [example.org](https://example.org/) production."
icon: "" # Relative path to icon in json feed and JSON-LD, no leading slash.
image: "" # Relative path to site image in JSON-LD, no leading slash.
imageMaxWidth: "" # Max width for images added via figure shortcode.
jquery: true # Add jQuery
languageDir: "" # Set ltr or rtl, defaults to ltr.
logo: false # Turn off the logo.
mainSections: # The sections you want to have listed on the front page.
- "section1" # Default to the section with most content if not set.
- "section2" # Set to empty if no section should be listed.
microUsername: "" # Your micro.blog username.
mobileMenu: true # Turn on a mobile menu on small screens.
piwikSiteId: # Matamo site id
piwikTrackerUrl: "" # Matamo url, schemaless and no slash on end (example.org/matamo).
poweredby: true # Show powered by hugo in footer
realfavicongenerator: # If full set of favicons, site manifest etc. exists, default false.
safariPinnedColor: # Hex color value, used in meta tags, default "#000000".
searchLimit: 20 # Max number of search hits, default 20.
sidebar: true # Show a sidebar to the right
submitted: true # Show author and date information for a post.
themeColor: # Hex color value, used in meta tags, default "#ffffff".
podcast:
title: # * Feed title, defaults to site title (iTunes).
description: # * Feed description/summary, defaults to site description (iTunes).
image: # * Feed image, place inside assets directory (iTunes).
category:
name: # * Feed category (iTunes).
subcategories: [] # Feed sub category (iTunes).
explicit: false/true # Feed explicit settting, default to false (iTunes).
author: # Feed author (iTunes).
owner:
name: # Feed owner name (iTunes).
email: # Feed owner e-mail (iTunes).
lang: # Feed language, defaults to site language (iTunes).
block: no/yes # Block the feed from iTunes, default to no (iTunes).
complete: no/yes # Set the feed as complete, defaults to no (iTunes).
type: episodic/serial # Podcast type, defaults to episodic (iTunes).
newfeed: # Are you moving? Set the new feed url here (iTunes).
cdn: # CDN url, no slash on end (https://cdn.example.org).
preload: none/metadata/auto # Set on the HTML5 audio tag, defaults to "metadata".
```
The site will work without setting any of the podcast parameters but your podcast feed will not be accepted by iTunes. At a minimum you need to set the first four, title, description, image and category name. Read more in the podcast section below.
## Customise
### Front page
This is a part that almost everyone will like to customise in some manner. The template file is `layouts/index.html`. By default it will include any text you put in `content/_index.md` and below that list the posts in "mainSections" as summaries.
If you do not specify any sections in the "mainSections" param (see configuration above) it will list the section with the most posts. If you do not want to list anything, set it but leave the value empty.
### Logo
Place your logo at `static/images/logo.png`. If you don't provide a logo, then the default theme logo will be used.
### Favicons
Upload your image to [RealFaviconGenerator](https://realfavicongenerator.net/) then copy-paste the generated favicon files under `static`.
Then set the "realfavicongenerator" param to true to add the needed meta tags. Also good to set the "themeColor" and "safariPinnedColor" params to correct colours.
### Layouts
To customise a layout included in the zen theme, copy it to the root layout directory and edit it there. Make sure to maintain the directory structure inside the layouts directory.
Add any new layouts to the root layout directory as well. This way they will not be overwritten when updating the theme.
#### Menu and sidebar layouts
If a Hugo main menu is defined (.Sites.Menu.main) the menu template will use it to build a navigation menu. If not, the template will automatically add entries for the home page, each root page and each section, in that order.
If the default sidebar is activated it will display each section with all its pages listed below.
They are set up in `layouts/partials/menu.html`, `layouts/partials/mobilmenu.html` and `layouts/partials/sidebar.html`.
### Styles and scripts
Styles and scripts are processed with Hugo pipes that was added in Hugo 0.46.
To customise a js or sass file, copy it to the root assets directory and edit it there. Make sure to maintain the directory structure inside the assets/sass directory.
There is an `assets/sass/_custom.scss` file meant for your custom styles. Copy it to the root `assets/sass/_custom.scss` to use it.
The default styles in `assets/sass/_zen.scss` are boring but functional. You can easily overide them completely by placing an empty file named "_zen.scss" in root assets/sass directory.
The sass files are by default built for production, compressed with fingerprint.
By setting the Hugo environment variable to "development" (default when running `hugo server`) they will instead be nested with sourcemaps.
### CSS grid for layout
Modern CSS grid is the easiest and cleanest way to layout your pages.
The CSS grid layout are in `assets/sass/layouts/_layouts.scss`. A lot can be done by just reordering "grid-template-rows".
## Multilingual
English, French, German, Norwegian, Portugis and Swedish translations are included and you can easily add more to the `i18n` site directory. All but English and Swedish are contributed by users.
A language selector will be included on sites with more than one language. Add `languageName` to your language configuration, this is what will be displayed in the selector.
The language selector will link to a translation of the current page if it exist and to the front page if it does not.
For "rtl" languages add a `languageDirection` parameter to the language configuration. If not added it will default to "ltr".
```
languages:
sv:
weight: 1
languageName: "Svenska"
en:
weight: 2
languageName: "English"
ar:
weight: 3
languageName: "العربية"
languageDirection: "rtl"
```
## Search
Built in integration with the excellent [FlexSearch.js](https://github.com/nextapps-de/flexsearch). A fast full text search that reads a JSON file created by Hugo to index and search the site.
Here is the three steps needed to create a search page.
1. Add a new output format in your configuration file.
```
outputFormats:
SearchIndex:
mediaType: "application/json"
baseName: "searchindex"
isPlainText: true
notAlternative: true
```
2. Add the new output format to output setting for "home".
```
outputs:
home: ["HTML", "SearchIndex", "[other formats you need]"]
```
3. Add the shortcode `{{< search >}}` to a page. The search and flexsearch js files gets loaded automatically on pages that use the shortcode.
Your search page will now have a search field where all the posts of the site can be searched.
The only setting is "searchLimit" that defaults to 20.
## Contact form
If your server support php with the mail() command (very common) you can use the included contact form feature to get a contact form for your site.
1. Copy the file `themes/zen/php/contact.php.example` to `static/php/contact.php`.
2. Edit the contact.php file so it has your own e-mail address. You may also change the mail subject prefix.
3. Add the shortcode `{{< contact >}}` to a page. The contact.js file gets loaded automatically on pages that use the shortcode.
If you have a SPF record for your domain, make sure the web server is listed or other mail server may mark the mail as spam.
Two types of spam protection is implemented. The form can only be posted after the user have moved the mouse or pressed the tab or enter key. The form have a "honypot" field that is invisible to humans but not to most spam boots. If that field is filled in the mail will not be sent.
Form validation is handled by HTML5 and there is some CSS to make it look nice.
Javascript is used for spam protection and to display error/success messages.
## Dates
If "lastmod" is set in the frontmatter on a post that value will be used in the "submitted" section. If not, "date" is used.
With "lastmod" set a date section will also appear at the bottom of post telling the reader the created and modification dates.
## Podcast
The Zen theme supports podcasting.
* RSS feed with all the needed iTunes tags.
* Single and full layouts with HTML 5 audio player.
* Archetype with required parameters.
Here follow all the possible podcast frontmatter parameters. Only the first two is mandatory and are in the podcast archetype.
```
podcast:
mp3: # * The path to the mp3 file,
duration: # * Episode duration, e.g 1:04:02 (iTunes).
image:
src: # Episode image src, place inside the assets directory (iTunes).
alt: # Alt text for the image, explain what is on the image.
width: # Image width in the article, defaults to 250px.
class: # Image wrapper class.
explicit: true/false # Episode explicit setting, default to false (iTunes).
episode: # Episode number (iTunes).
episodeType: full/trailer/bonus # Episode type, defaults to full (iTunes).
season: # Episode season (iTunes).
block: # Block the episode from iTunes, default to no (iTunes).
```
* [Apple Podcasts categories](https://help.apple.com/itc/podcasts_connect/#/itc9267a2f12)
* [Apple - A podcasters guide to RSS](https://help.apple.com/itc/podcasts_connect/#/itcb54353390)
## Shortcodes
### Contact
Insert a html5 contact form, see more above.
```
{{< contact >}}
```
### Figure
Zen comes with a improved version of the built in "figure" shortcut.
* You can set a max width for images with parameter "imageMaxWidth".
* If width and height is not set the real dimensions of the image will be used.
* If only width or height is set the other value will be proportionally calculated.
### Clear
Break float.
```
{{< figure src="/images/image.jpg" class="right" >}}
blablabla # Displayed left of the image.
{{< clear >}}
blablabla # Displayed below of the image.
```
### Audio and Video
```
{{< audio src="/audio/audio.mp3" class="something" >}}
{{< video src="/video/video.mp4" class="something" >}}
```
Possible parameters are:
* src
* class
* preload (none/metadata/auto, default metadata)
* width (only video)
The audio and video tags will be wrapped with a figure tag.
### Wrapper
A simple, but useful, shortcode to wrap content in a div with a class. The content will be run through "markdownify".
```
{{< wrapper class-name-you-want markdown >}}
The **content** that should be wrapped.
Some more content.
{{< /wrapper >}}
```
This will produce:
```
<div class="class-name-you-want">
<p>The <strong>content</strong> that should be wrapped.</p>
<p>Some more content.</p>
</div>
```
If the content should be left untouched add "nomarkdown" after the class name.
```
{{< wrapper class-name-you-want nomarkdown >}}
The **content** that should be wrapped.
Some more content.
{{< /wrapper >}}
```
This will produce:
```
<div class="class-name-you-want">
The **content** that should be wrapped. Some more content.
</div>
```
## Choose between using jQuery or Umbrella JS
[Umbrella JS](https://umbrellajs.com/) (a tiny jQuery replacement) is always added and it's used for all theme JavaScript. To add jQuery, set the related parameter to true in the configuration file or in the front matter of specific pages. No problem having both libraries loaded on the same page.
This is the way I construct my JavaScript files.
**Umbrella JS:**
```
(function ($) {
'use strict';
// Add your code here.
$('html').removeClass('nojs').addClass('js');
})(u);
```
**jQuery:**
```
(function ($) {
'use strict';
// Add your code here.
$('html').removeClass('nojs').addClass('js');
})(jQuery);
```
## Use Gulp to lint Sass and JavaScript
* Lint your Sass using sass-lint.
* Lint your JavaScript using eslint.
* Will lint files in the theme as well as the root assets directory.
* Watch all of your files as you develop and re-build everything on the fly.
Set up your front-end development build tools:
1. Install Node.js and npm, the Node.js package manager.
Detailed instructions are available on the "npm quick start guide":
https://github.com/kss-node/kss-node/wiki/npm-quick-start-guide
2. The package.json file in your new sub-theme contains the versions of all the
Node.js software you need. To install them run:
npm install
3. Install the gulp-cli tool globally. Normally, installing a Node.js globally
is not recommended, which is why both Gulp and Grunt have created wrapper
commands that will allow you to run "gulp" or "grunt" from anywhere, while
using the local version of gulp or grunt that is installed in your project.
To install gulp's global wrapper, run:
npm install -g gulp-cli
5. The default gulp task will lint your Sass and JavaScript.
To run the default gulp task, type:
gulp
To watch all your files as you develop, type:
gulp watch
## Getting help
If you run into an issue that isn't answered by this documentation or the [`exampleSite`](https://github.com/frjo/hugo-theme-zen/tree/master/exampleSite), then visit the [Hugo forum](https://discourse.gohugo.io/). The folks there are helpful and friendly. **Before** asking your question, be sure to read the [requesting help guidelines](https://discourse.gohugo.io/t/requesting-help/9132). Feel free to tag me in your question, my forum username is [@frjo](https://discourse.gohugo.io/u/frjo/summary).
## Credits
This is originally a port of the [Zen](https://www.drupal.org/project/zen) theme by [JohnAlbin](https://www.drupal.org/u/johnalbin), a very popular base theme for Drupal.
Thanks to the [Cupper Hugo theme](https://github.com/zwbetz-gh/cupper-hugo-theme/) for a really good Readme, have copied a lot from it.

View File

@ -0,0 +1,6 @@
---
title: "{{ replace .TranslationBaseName "-" " " | humanize }}"
date: {{ .Date }}
lastmod: {{ .Date }}
---

View File

@ -0,0 +1,5 @@
---
title: "{{ replace .TranslationBaseName "-" " " | humanize }}"
date: {{ .Date }}
---

View File

@ -0,0 +1,8 @@
---
title: "{{ replace .TranslationBaseName "-" " " | humanize }}"
date: {{ .Date }}
podcast:
mp3:
duration:
---

View File

@ -0,0 +1,61 @@
/**
* @file
* A JavaScript file for the contact form.
*/
(function ($) {
'use strict';
// Contact form.
$('.contact-form').each(function (e) {
var $contact_form = $(e);
var $contact_button = $contact_form.find('.form-submit');
var contact_action = '/php/contact.php';
// Display the hidden form.
$contact_form.removeClass('hidden');
// Wait for a mouse to move, indicating they are human.
$('body').on('mousemove', function () {
// Unlock the form.
$contact_form.attr('action', contact_action);
$contact_button.first().removeAttribute('disabled');
});
// Wait for a touch move event, indicating that they are human.
$('body').on('touchmove', function () {
// Unlock the form.
$contact_form.attr('action', contact_action);
$contact_button.first().removeAttribute('disabled');
});
// A tab or enter key pressed can also indicate they are human.
$('body').on('keydown', function (e) {
if ((e.keyCode === 9) || (e.keyCode === 13)) {
// Unlock the form.
$contact_form.attr('action', contact_action);
$contact_button.first().removeAttribute('disabled');
}
});
// Mark the form as submitted.
$contact_button.on('click', function () {
$contact_form.addClass('js-submitted');
});
// Display messages.
if (location.search.substring(1) !== '') {
switch (location.search.substring(1)) {
case 'submitted':
$('.contact-submitted').removeClass('hidden');
break;
case 'error':
$('.contact-error').removeClass('hidden');
break;
}
}
});
})(u);

View File

@ -0,0 +1,61 @@
/**
* @file
* A JavaScript file for the contact form.
*/
(function ($) {
'use strict';
// Contact form.
$('.contact-form').each(function () {
var $contact_form = $(this);
var $contact_button = $contact_form.find('.form-submit');
var contact_action = '/php/contact.php';
// Display the hidden form.
$contact_form.removeClass('hidden');
// Wait for a mouse to move, indicating they are human.
$('body').mousemove(function () {
// Unlock the form.
$contact_form.attr('action', contact_action);
$contact_button.attr('disabled', false);
});
// Wait for a touch move event, indicating that they are human.
$('body').on('touchmove', function () {
// Unlock the form.
$contact_form.attr('action', contact_action);
$contact_button.attr('disabled', false);
});
// A tab or enter key pressed can also indicate they are human.
$('body').keydown(function (e) {
if ((e.keyCode === 9) || (e.keyCode === 13)) {
// Unlock the form.
$contact_form.attr('action', contact_action);
$contact_button.attr('disabled', false);
}
});
// Mark the form as submitted.
$contact_button.click(function () {
$contact_form.addClass('js-submitted');
});
// Display messages.
if (location.search.substring(1) !== '') {
switch (location.search.substring(1)) {
case 'submitted':
$('.contact-submitted').removeClass('hidden');
break;
case 'error':
$('.contact-error').removeClass('hidden');
break;
}
}
});
})(jQuery);

View File

@ -0,0 +1,27 @@
/**
* @file
* A JavaScript file for the mobile menu.
*/
(function ($) {
'use strict';
// Activate the mobil menu for small screens.
if (window.matchMedia && $('.mobile-nav').length) {
var mq = window.matchMedia('(max-width: 999px)');
if (mq.matches) {
// Toggle the mobile nav sheet.
$('.mobile-nav__cover, .mobile-nav__toggle').click(function (e) {
e.preventDefault();
$('body').scrollTop(0).toggleClass('js-nav-open');
});
// Close the nav sheet after click (needed for anchor links).
$('.mobile-nav__sheet').find('a').click(function () {
$('body').removeClass('js-nav-open');
});
}
}
})(jQuery);

View File

@ -0,0 +1,13 @@
/**
* @file
* A JavaScript file for the theme.
*/
(function ($) {
'use strict';
// Add a js class to the html-tag when JavsScript is active.
$('html').removeClass('nojs').addClass('js');
})(jQuery);

View File

@ -0,0 +1,42 @@
/*
FlexSearch v0.6.30
Copyright 2019 Nextapps GmbH
Author: Thomas Wilkerling
Released under the Apache 2.0 Licence
https://github.com/nextapps-de/flexsearch
*/
'use strict';(function(K,R,w){let L;(L=w.define)&&L.amd?L([],function(){return R}):(L=w.modules)?L[K.toLowerCase()]=R:"object"===typeof exports?module.exports=R:w[K]=R})("FlexSearch",function ma(K){function w(a,c){const b=c?c.id:a&&a.id;this.id=b||0===b?b:na++;this.init(a,c);fa(this,"index",function(){return this.a?Object.keys(this.a.index[this.a.keys[0]].c):Object.keys(this.c)});fa(this,"length",function(){return this.index.length})}function L(a,c,b,d){this.u!==this.g&&(this.o=this.o.concat(b),this.u++,
d&&this.o.length>=d&&(this.u=this.g),this.u===this.g&&(this.cache&&this.j.set(c,this.o),this.F&&this.F(this.o)));return this}function S(a){const c=B();for(const b in a)if(a.hasOwnProperty(b)){const d=a[b];F(d)?c[b]=d.slice(0):G(d)?c[b]=S(d):c[b]=d}return c}function W(a,c){const b=a.length,d=O(c),e=[];for(let f=0,h=0;f<b;f++){const g=a[f];if(d&&c(g)||!d&&!c[g])e[h++]=g}return e}function P(a,c,b,d,e,f,h,g,k,l){b=ha(b,h?0:e,g,f,c,k,l);let p;g&&(g=b.page,p=b.next,b=b.result);if(h)c=this.where(h,null,
e,b);else{c=b;b=this.l;e=c.length;f=Array(e);for(h=0;h<e;h++)f[h]=b[c[h]];c=f}b=c;d&&(O(d)||(M=d.split(":"),1<M.length?d=oa:(M=M[0],d=pa)),b.sort(d));b=T(g,p,b);this.cache&&this.j.set(a,b);return b}function fa(a,c,b){Object.defineProperty(a,c,{get:b})}function r(a){return new RegExp(a,"g")}function Q(a,c){for(let b=0;b<c.length;b+=2)a=a.replace(c[b],c[b+1]);return a}function V(a,c,b,d,e,f,h,g){if(c[b])return c[b];e=e?(g-(h||g/1.5))*f+(h||g/1.5)*e:f;c[b]=e;e>=h&&(a=a[g-(e+.5>>0)],a=a[b]||(a[b]=[]),
a[a.length]=d);return e}function ba(a,c){if(a){const b=Object.keys(a);for(let d=0,e=b.length;d<e;d++){const f=b[d],h=a[f];if(h)for(let g=0,k=h.length;g<k;g++)if(h[g]===c){1===k?delete a[f]:h.splice(g,1);break}else G(h[g])&&ba(h[g],c)}}}function ca(a){let c="",b="";var d="";for(let e=0;e<a.length;e++){const f=a[e];if(f!==b)if(e&&"h"===f){if(d="a"===d||"e"===d||"i"===d||"o"===d||"u"===d||"y"===d,("a"===b||"e"===b||"i"===b||"o"===b||"u"===b||"y"===b)&&d||" "===b)c+=f}else c+=f;d=e===a.length-1?"":a[e+
1];b=f}return c}function qa(a,c){a=a.length-c.length;return 0>a?1:a?-1:0}function pa(a,c){a=a[M];c=c[M];return a<c?-1:a>c?1:0}function oa(a,c){const b=M.length;for(let d=0;d<b;d++)a=a[M[d]],c=c[M[d]];return a<c?-1:a>c?1:0}function T(a,c,b){return a?{page:a,next:c?""+c:null,result:b}:b}function ha(a,c,b,d,e,f,h){let g,k=[];if(!0===b){b="0";var l=""}else l=b&&b.split(":");const p=a.length;if(1<p){const y=B(),t=[];let v,x;var n=0,m;let I;var u=!0;let D,E=0,N,da,X,ea;l&&(2===l.length?(X=l,l=!1):l=ea=
parseInt(l[0],10));if(h){for(v=B();n<p;n++)if("not"===e[n])for(x=a[n],I=x.length,m=0;m<I;m++)v["@"+x[m]]=1;else da=n+1;if(C(da))return T(b,g,k);n=0}else N=J(e)&&e;let Y;for(;n<p;n++){const ra=n===(da||p)-1;if(!N||!n)if((m=N||e&&e[n])&&"and"!==m)if("or"===m)Y=!1;else continue;else Y=f=!0;x=a[n];if(I=x.length){if(u)if(D){var q=D.length;for(m=0;m<q;m++){u=D[m];var A="@"+u;h&&v[A]||(y[A]=1,f||(k[E++]=u))}D=null;u=!1}else{D=x;continue}A=!1;for(m=0;m<I;m++){q=x[m];var z="@"+q;const Z=f?y[z]||0:n;if(!(!Z&&
!d||h&&v[z]||!f&&y[z]))if(Z===n){if(ra){if(!ea||--ea<E)if(k[E++]=q,c&&E===c)return T(b,E+(l||0),k)}else y[z]=n+1;A=!0}else d&&(z=t[Z]||(t[Z]=[]),z[z.length]=q)}if(Y&&!A&&!d)break}else if(Y&&!d)return T(b,g,x)}if(D)if(n=D.length,h)for(m=l?parseInt(l,10):0;m<n;m++)a=D[m],v["@"+a]||(k[E++]=a);else k=D;if(d)for(E=k.length,X?(n=parseInt(X[0],10)+1,m=parseInt(X[1],10)+1):(n=t.length,m=0);n--;)if(q=t[n]){for(I=q.length;m<I;m++)if(d=q[m],!h||!v["@"+d])if(k[E++]=d,c&&E===c)return T(b,n+":"+m,k);m=0}}else!p||
e&&"not"===e[0]||(k=a[0],l&&(l=parseInt(l[0],10)));c&&(h=k.length,l&&l>h&&(l=0),l=l||0,g=l+c,g<h?k=k.slice(l,g):(g=0,l&&(k=k.slice(l))));return T(b,g,k)}function J(a){return"string"===typeof a}function F(a){return a.constructor===Array}function O(a){return"function"===typeof a}function G(a){return"object"===typeof a}function C(a){return"undefined"===typeof a}function ia(a){const c=Array(a);for(let b=0;b<a;b++)c[b]=B();return c}function B(){return Object.create(null)}function sa(){let a,c;self.onmessage=
function(b){if(b=b.data)if(b.search){const d=c.search(b.content,b.threshold?{limit:b.limit,threshold:b.threshold,where:b.where}:b.limit);self.postMessage({id:a,content:b.content,limit:b.limit,result:d})}else b.add?c.add(b.id,b.content):b.update?c.update(b.id,b.content):b.remove?c.remove(b.id):b.clear?c.clear():b.info?(b=c.info(),b.worker=a,console.log(b)):b.register&&(a=b.id,b.options.cache=!1,b.options.async=!1,b.options.worker=!1,c=(new Function(b.register.substring(b.register.indexOf("{")+1,b.register.lastIndexOf("}"))))(),
c=new c(b.options))}}function ta(a,c,b,d){a=K("flexsearch","id"+a,sa,function(f){(f=f.data)&&f.result&&d(f.id,f.content,f.result,f.limit,f.where,f.cursor,f.suggest)},c);const e=ma.toString();b.id=c;a.postMessage({register:e,options:b,id:c});return a}const H={encode:"icase",f:"forward",split:/\W+/,cache:!1,async:!1,g:!1,D:!1,a:!1,b:9,threshold:0,depth:0},ja={memory:{encode:"extra",f:"strict",threshold:0,b:1},speed:{encode:"icase",f:"strict",threshold:1,b:3,depth:2},match:{encode:"extra",f:"full",threshold:1,
b:3},score:{encode:"extra",f:"strict",threshold:1,b:9,depth:4},balance:{encode:"balance",f:"strict",threshold:0,b:3,depth:3},fast:{encode:"icase",f:"strict",threshold:8,b:9,depth:1}},aa=[];let na=0;const ka={},la={};w.create=function(a,c){return new w(a,c)};w.registerMatcher=function(a){for(const c in a)a.hasOwnProperty(c)&&aa.push(r(c),a[c]);return this};w.registerEncoder=function(a,c){U[a]=c.bind(U);return this};w.registerLanguage=function(a,c){ka[a]=c.filter;la[a]=c.stemmer;return this};w.encode=
function(a,c){return U[a](c)};w.prototype.init=function(a,c){this.v=[];if(c){var b=c.preset;a=c}else a||(a=H),b=a.preset;c={};J(a)?(c=ja[a],a={}):b&&(c=ja[b]);if(b=a.worker)if("undefined"===typeof Worker)a.worker=!1,this.m=null;else{var d=parseInt(b,10)||4;this.C=-1;this.u=0;this.o=[];this.F=null;this.m=Array(d);for(var e=0;e<d;e++)this.m[e]=ta(this.id,e,a,L.bind(this))}this.f=a.tokenize||c.f||this.f||H.f;this.split=C(b=a.split)?this.split||H.split:J(b)?r(b):b;this.D=a.rtl||this.D||H.D;this.async=
"undefined"===typeof Promise||C(b=a.async)?this.async||H.async:b;this.g=C(b=a.worker)?this.g||H.g:b;this.threshold=C(b=a.threshold)?c.threshold||this.threshold||H.threshold:b;this.b=C(b=a.resolution)?b=c.b||this.b||H.b:b;b<=this.threshold&&(this.b=this.threshold+1);this.depth="strict"!==this.f||C(b=a.depth)?c.depth||this.depth||H.depth:b;this.w=(b=C(b=a.encode)?c.encode||H.encode:b)&&U[b]&&U[b].bind(U)||(O(b)?b:this.w||!1);(b=a.matcher)&&this.addMatcher(b);if(b=(c=a.lang)||a.filter){J(b)&&(b=ka[b]);
if(F(b)){d=this.w;e=B();for(var f=0;f<b.length;f++){var h=d?d(b[f]):b[f];e[h]=1}b=e}this.filter=b}if(b=c||a.stemmer){var g;c=J(b)?la[b]:b;d=this.w;e=[];for(g in c)c.hasOwnProperty(g)&&(f=d?d(g):g,e.push(r(f+"($|\\W)"),d?d(c[g]):c[g]));this.stemmer=g=e}this.a=e=(b=a.doc)?S(b):this.a||H.a;this.i=ia(this.b-(this.threshold||0));this.h=B();this.c=B();if(e){this.l=B();a.doc=null;g=e.index={};c=e.keys=[];d=e.field;f=e.tag;h=e.store;F(e.id)||(e.id=e.id.split(":"));if(h){var k=B();if(J(h))k[h]=1;else if(F(h))for(let l=
0;l<h.length;l++)k[h[l]]=1;else G(h)&&(k=h);e.store=k}if(f){this.G=B();h=B();if(d)if(J(d))h[d]=a;else if(F(d))for(k=0;k<d.length;k++)h[d[k]]=a;else G(d)&&(h=d);F(f)||(e.tag=f=[f]);for(d=0;d<f.length;d++)this.G[f[d]]=B();this.I=f;d=h}if(d){let l;F(d)||(G(d)?(l=d,e.field=d=Object.keys(d)):e.field=d=[d]);for(e=0;e<d.length;e++)f=d[e],F(f)||(l&&(a=l[f]),c[e]=f,d[e]=f.split(":")),g[f]=new w(a)}a.doc=b}this.B=!0;this.j=(this.cache=b=C(b=a.cache)?this.cache||H.cache:b)?new ua(b):!1;return this};w.prototype.encode=
function(a){a&&(aa.length&&(a=Q(a,aa)),this.v.length&&(a=Q(a,this.v)),this.w&&(a=this.w(a)),this.stemmer&&(a=Q(a,this.stemmer)));return a};w.prototype.addMatcher=function(a){const c=this.v;for(const b in a)a.hasOwnProperty(b)&&c.push(r(b),a[b]);return this};w.prototype.add=function(a,c,b,d,e){if(this.a&&G(a))return this.A("add",a,c);if(c&&J(c)&&(a||0===a)){var f="@"+a;if(this.c[f]&&!d)return this.update(a,c);if(this.g)return++this.C>=this.m.length&&(this.C=0),this.m[this.C].postMessage({add:!0,id:a,
content:c}),this.c[f]=""+this.C,b&&b(),this;if(!e){if(this.async&&"function"!==typeof importScripts){let t=this;f=new Promise(function(v){setTimeout(function(){t.add(a,c,null,d,!0);t=null;v()})});if(b)f.then(b);else return f;return this}if(b)return this.add(a,c,null,d,!0),b(),this}c=this.encode(c);if(!c.length)return this;b=this.f;e=O(b)?b(c):c.split(this.split);this.filter&&(e=W(e,this.filter));const n=B();n._ctx=B();const m=e.length,u=this.threshold,q=this.depth,A=this.b,z=this.i,y=this.D;for(let t=
0;t<m;t++){var h=e[t];if(h){var g=h.length,k=(y?t+1:m-t)/m,l="";switch(b){case "reverse":case "both":for(var p=g;--p;)l=h[p]+l,V(z,n,l,a,y?1:(g-p)/g,k,u,A-1);l="";case "forward":for(p=0;p<g;p++)l+=h[p],V(z,n,l,a,y?(p+1)/g:1,k,u,A-1);break;case "full":for(p=0;p<g;p++){const v=(y?p+1:g-p)/g;for(let x=g;x>p;x--)l=h.substring(p,x),V(z,n,l,a,v,k,u,A-1)}break;default:if(g=V(z,n,h,a,1,k,u,A-1),q&&1<m&&g>=u)for(g=n._ctx[h]||(n._ctx[h]=B()),h=this.h[h]||(this.h[h]=ia(A-(u||0))),k=t-q,l=t+q+1,0>k&&(k=0),l>
m&&(l=m);k<l;k++)k!==t&&V(h,g,e[k],a,0,A-(k<t?t-k:k-t),u,A-1)}}}this.c[f]=1;this.B=!1}return this};w.prototype.A=function(a,c,b){if(F(c)){var d=c.length;if(d--){for(var e=0;e<d;e++)this.A(a,c[e]);return this.A(a,c[d],b)}}else{var f=this.a.index,h=this.a.keys,g=this.a.tag;e=this.a.store;var k;var l=this.a.id;d=c;for(var p=0;p<l.length;p++)d=d[l[p]];if("remove"===a&&(delete this.l[d],l=h.length,l--)){for(c=0;c<l;c++)f[h[c]].remove(d);return f[h[l]].remove(d,b)}if(g){for(k=0;k<g.length;k++){var n=g[k];
var m=c;l=n.split(":");for(p=0;p<l.length;p++)m=m[l[p]];m="@"+m}k=this.G[n];k=k[m]||(k[m]=[])}l=this.a.field;for(let u=0,q=l.length;u<q;u++){n=l[u];g=c;for(m=0;m<n.length;m++)g=g[n[m]];n=f[h[u]];m="add"===a?n.add:n.update;u===q-1?m.call(n,d,g,b):m.call(n,d,g)}if(e){b=Object.keys(e);a=B();for(f=0;f<b.length;f++)if(h=b[f],e[h]){h=h.split(":");let u,q;for(l=0;l<h.length;l++)g=h[l],u=(u||c)[g],q=(q||a)[g]=u}c=a}k&&(k[k.length]=c);this.l[d]=c}return this};w.prototype.update=function(a,c,b){if(this.a&&
G(a))return this.A("update",a,c);this.c["@"+a]&&J(c)&&(this.remove(a),this.add(a,c,b,!0));return this};w.prototype.remove=function(a,c,b){if(this.a&&G(a))return this.A("remove",a,c);var d="@"+a;if(this.c[d]){if(this.g)return this.m[this.c[d]].postMessage({remove:!0,id:a}),delete this.c[d],c&&c(),this;if(!b){if(this.async&&"function"!==typeof importScripts){let e=this;d=new Promise(function(f){setTimeout(function(){e.remove(a,null,!0);e=null;f()})});if(c)d.then(c);else return d;return this}if(c)return this.remove(a,
null,!0),c(),this}for(c=0;c<this.b-(this.threshold||0);c++)ba(this.i[c],a);this.depth&&ba(this.h,a);delete this.c[d];this.B=!1}return this};let M;w.prototype.search=function(a,c,b,d){if(G(c)){if(F(c))for(var e=0;e<c.length;e++)c[e].query=a;else c.query=a;a=c;c=1E3}else c&&O(c)?(b=c,c=1E3):c||0===c||(c=1E3);if(this.g){this.F=b;this.u=0;this.o=[];for(var f=0;f<this.g;f++)this.m[f].postMessage({search:!0,limit:c,content:a})}else{var h=[],g=a;if(G(a)&&!F(a)){b||(b=a.callback)&&(g.callback=null);var k=
a.sort;var l=a.page;c=a.limit;f=a.threshold;var p=a.suggest;a=a.query}if(this.a){f=this.a.index;const y=g.where;var n=g.bool||"or",m=g.field;let t=n;let v,x;if(m)F(m)||(m=[m]);else if(F(g)){var u=g;m=[];t=[];for(var q=0;q<g.length;q++)d=g[q],e=d.bool||n,m[q]=d.field,t[q]=e,"not"===e?v=!0:"and"===e&&(x=!0)}else m=this.a.keys;n=m.length;for(q=0;q<n;q++)u&&(g=u[q]),l&&!J(g)&&(g.page=null,g.limit=0),h[q]=f[m[q]].search(g,0);if(b)return b(P.call(this,a,t,h,k,c,p,y,l,x,v));if(this.async){const I=this;return new Promise(function(D){Promise.all(h).then(function(E){D(P.call(I,
a,t,E,k,c,p,y,l,x,v))})})}return P.call(this,a,t,h,k,c,p,y,l,x,v)}f||(f=this.threshold||0);if(!d){if(this.async&&"function"!==typeof importScripts){let y=this;f=new Promise(function(t){setTimeout(function(){t(y.search(g,c,null,!0));y=null})});if(b)f.then(b);else return f;return this}if(b)return b(this.search(g,c,null,!0)),this}if(!a||!J(a))return h;g=a;if(this.cache)if(this.B){if(b=this.j.get(a))return b}else this.j.clear(),this.B=!0;g=this.encode(g);if(!g.length)return h;b=this.f;b=O(b)?b(g):g.split(this.split);
this.filter&&(b=W(b,this.filter));u=b.length;d=!0;e=[];var A=B(),z=0;1<u&&(this.depth&&"strict"===this.f?n=!0:b.sort(qa));if(!n||(q=this.h)){const y=this.b;for(;z<u;z++){let t=b[z];if(t){if(n){if(!m)if(q[t])m=t,A[t]=1;else if(!p)return h;if(p&&z===u-1&&!e.length)n=!1,t=m||t,A[t]=0;else if(!m)continue}if(!A[t]){const v=[];let x=!1,I=0;const D=n?q[m]:this.i;if(D){let E;for(let N=0;N<y-f;N++)if(E=D[N]&&D[N][t])v[I++]=E,x=!0}if(x)m=t,e[e.length]=1<I?v.concat.apply([],v):v[0];else if(!p){d=!1;break}A[t]=
1}}}}else d=!1;d&&(h=ha(e,c,l,p));this.cache&&this.j.set(a,h);return h}};w.prototype.find=function(a,c){return this.where(a,c,1)[0]||null};w.prototype.where=function(a,c,b,d){const e=this.l,f=[];let h=0;let g;var k;let l;if(G(a)){b||(b=c);var p=Object.keys(a);var n=p.length;g=!1;if(1===n&&"id"===p[0])return[e[a.id]];if((k=this.I)&&!d)for(var m=0;m<k.length;m++){var u=k[m],q=a[u];if(!C(q)){l=this.G[u]["@"+q];if(0===--n)return l;p.splice(p.indexOf(u),1);delete a[u];break}}k=Array(n);for(m=0;m<n;m++)k[m]=
p[m].split(":")}else{if(O(a)){c=d||Object.keys(e);b=c.length;for(p=0;p<b;p++)n=e[c[p]],a(n)&&(f[h++]=n);return f}if(C(c))return[e[a]];if("id"===a)return[e[c]];p=[a];n=1;k=[a.split(":")];g=!0}d=l||d||Object.keys(e);m=d.length;for(u=0;u<m;u++){q=l?d[u]:e[d[u]];let A=!0;for(let z=0;z<n;z++){g||(c=a[p[z]]);const y=k[z],t=y.length;let v=q;if(1<t)for(let x=0;x<t;x++)v=v[y[x]];else v=v[y[0]];if(v!==c){A=!1;break}}if(A&&(f[h++]=q,b&&h===b))break}return f};w.prototype.info=function(){if(this.g)for(let a=0;a<
this.g;a++)this.m[a].postMessage({info:!0,id:this.id});else return{id:this.id,items:this.length,cache:this.cache&&this.cache.s?this.cache.s.length:!1,matcher:aa.length+(this.v?this.v.length:0),worker:this.g,threshold:this.threshold,depth:this.depth,resolution:this.b,contextual:this.depth&&"strict"===this.f}};w.prototype.clear=function(){return this.destroy().init()};w.prototype.destroy=function(){this.cache&&(this.j.clear(),this.j=null);this.i=this.h=this.c=null;if(this.a){const a=this.a.keys;for(let c=
0;c<a.length;c++)this.a.index[a[c]].destroy();this.a=this.l=null}return this};w.prototype.export=function(a){const c=!a||C(a.serialize)||a.serialize;if(this.a){const d=!a||C(a.doc)||a.doc;var b=!a||C(a.index)||a.index;a=[];let e=0;if(b)for(b=this.a.keys;e<b.length;e++){const f=this.a.index[b[e]];a[e]=[f.i,f.h,Object.keys(f.c)]}d&&(a[e]=this.l)}else a=[this.i,this.h,Object.keys(this.c)];c&&(a=JSON.stringify(a));return a};w.prototype.import=function(a,c){if(!c||C(c.serialize)||c.serialize)a=JSON.parse(a);
const b=B();if(this.a){var d=!c||C(c.doc)||c.doc,e=0;if(!c||C(c.index)||c.index){c=this.a.keys;const h=c.length;for(var f=a[0][2];e<f.length;e++)b[f[e]]=1;for(e=0;e<h;e++){f=this.a.index[c[e]];const g=a[e];g&&(f.i=g[0],f.h=g[1],f.c=b)}}d&&(this.l=G(d)?d:a[e])}else{d=a[2];for(e=0;e<d.length;e++)b[d[e]]=1;this.i=a[0];this.h=a[1];this.c=b}};const va=function(){const a=r("\\s+"),c=r("[^a-z0-9 ]"),b=[r("[-/]")," ",c,"",a," "];return function(d){return ca(Q(d.toLowerCase(),b))}}(),U={icase:function(a){return a.toLowerCase()},
simple:function(){const a=r("\\s+"),c=r("[^a-z0-9 ]"),b=r("[-/]"),d=r("[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5]"),e=r("[\u00e8\u00e9\u00ea\u00eb]"),f=r("[\u00ec\u00ed\u00ee\u00ef]"),h=r("[\u00f2\u00f3\u00f4\u00f5\u00f6\u0151]"),g=r("[\u00f9\u00fa\u00fb\u00fc\u0171]"),k=r("[\u00fd\u0177\u00ff]"),l=r("\u00f1"),p=r("[\u00e7c]"),n=r("\u00df"),m=r(" & "),u=[d,"a",e,"e",f,"i",h,"o",g,"u",k,"y",l,"n",p,"k",n,"s",m," and ",b," ",c,"",a," "];return function(q){q=Q(q.toLowerCase(),u);return" "===q?"":q}}(),advanced:function(){const a=
r("ae"),c=r("ai"),b=r("ay"),d=r("ey"),e=r("oe"),f=r("ue"),h=r("ie"),g=r("sz"),k=r("zs"),l=r("ck"),p=r("cc"),n=r("sh"),m=r("th"),u=r("dt"),q=r("ph"),A=r("pf"),z=r("ou"),y=r("uo"),t=[a,"a",c,"ei",b,"ei",d,"ei",e,"o",f,"u",h,"i",g,"s",k,"s",n,"s",l,"k",p,"k",m,"t",u,"t",q,"f",A,"f",z,"o",y,"u"];return function(v,x){if(!v)return v;v=this.simple(v);2<v.length&&(v=Q(v,t));x||1<v.length&&(v=ca(v));return v}}(),extra:function(){const a=r("p"),c=r("z"),b=r("[cgq]"),d=r("n"),e=r("d"),f=r("[vw]"),h=r("[aeiouy]"),
g=[a,"b",c,"s",b,"k",d,"m",e,"t",f,"f",h,""];return function(k){if(!k)return k;k=this.advanced(k,!0);if(1<k.length){k=k.split(" ");for(let l=0;l<k.length;l++){const p=k[l];1<p.length&&(k[l]=p[0]+Q(p.substring(1),g))}k=k.join(" ");k=ca(k)}return k}}(),balance:va},ua=function(){function a(c){this.clear();this.H=!0!==c&&c}a.prototype.clear=function(){this.cache=B();this.count=B();this.index=B();this.s=[]};a.prototype.set=function(c,b){if(this.H&&C(this.cache[c])){let d=this.s.length;if(d===this.H){d--;
const e=this.s[d];delete this.cache[e];delete this.count[e];delete this.index[e]}this.index[c]=d;this.s[d]=c;this.count[c]=-1;this.cache[c]=b;this.get(c)}else this.cache[c]=b};a.prototype.get=function(c){const b=this.cache[c];if(this.H&&b){var d=++this.count[c];const f=this.index;let h=f[c];if(0<h){const g=this.s;for(var e=h;this.count[g[--h]]<=d&&-1!==h;);h++;if(h!==e){for(d=e;d>h;d--)e=g[d-1],g[d]=e,f[e]=d;g[h]=c;f[c]=h}}}return b};return a}();return w}(function(){const K={},R="undefined"!==typeof Blob&&
"undefined"!==typeof URL&&URL.createObjectURL;return function(w,L,S,W,P){S=R?URL.createObjectURL(new Blob(["("+S.toString()+")()"],{type:"text/javascript"})):w+".min.js";w+="-"+L;K[w]||(K[w]=[]);K[w][P]=new Worker(S);K[w][P].onmessage=W;return K[w][P]}}()),this);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,761 @@
// Umbrella JS http://umbrellajs.com/
// -----------
// Small, lightweight jQuery alternative
// @author Francisco Presencia Fandos http://francisco.io/
// @inspiration http://youmightnotneedjquery.com/
// Initialize the library
var u = function (parameter, context) {
// Make it an instance of u() to avoid needing 'new' as in 'new u()' and just
// use 'u().bla();'.
// @reference http://stackoverflow.com/q/24019863
// @reference http://stackoverflow.com/q/8875878
if (!(this instanceof u)) {
return new u(parameter, context);
}
// No need to further processing it if it's already an instance
if (parameter instanceof u) {
return parameter;
}
// Parse it as a CSS selector if it's a string
if (typeof parameter === 'string') {
parameter = this.select(parameter, context);
}
// If we're referring a specific node as in on('click', function(){ u(this) })
// or the select() function returned a single node such as in '#id'
if (parameter && parameter.nodeName) {
parameter = [parameter];
}
// Convert to an array, since there are many 'array-like' stuff in js-land
this.nodes = this.slice(parameter);
};
// Map u(...).length to u(...).nodes.length
u.prototype = {
get length () {
return this.nodes.length;
}
};
// This made the code faster, read "Initializing instance variables" in
// https://developers.google.com/speed/articles/optimizing-javascript
u.prototype.nodes = [];
// Add class(es) to the matched nodes
u.prototype.addClass = function () {
return this.eacharg(arguments, function (el, name) {
el.classList.add(name);
});
};
// [INTERNAL USE ONLY]
// Add text in the specified position. It is used by other functions
u.prototype.adjacent = function (html, data, callback) {
if (typeof data === 'number') {
if (data === 0) {
data = [];
} else {
data = new Array(data).join().split(',').map(Number.call, Number);
}
}
// Loop through all the nodes. It cannot reuse the eacharg() since the data
// we want to do it once even if there's no "data" and we accept a selector
return this.each(function (node, j) {
var fragment = document.createDocumentFragment();
// Allow for data to be falsy and still loop once
u(data || {}).map(function (el, i) {
// Allow for callbacks that accept some data
var part = (typeof html === 'function') ? html.call(this, el, i, node, j) : html;
if (typeof part === 'string') {
return this.generate(part);
}
return u(part);
}).each(function (n) {
this.isInPage(n)
? fragment.appendChild(u(n).clone().first())
: fragment.appendChild(n);
});
callback.call(this, node, fragment);
});
};
// Add some html as a sibling after each of the matched elements.
u.prototype.after = function (html, data) {
return this.adjacent(html, data, function (node, fragment) {
node.parentNode.insertBefore(fragment, node.nextSibling);
});
};
// Add some html as a child at the end of each of the matched elements.
u.prototype.append = function (html, data) {
return this.adjacent(html, data, function (node, fragment) {
node.appendChild(fragment);
});
};
// [INTERNAL USE ONLY]
// Normalize the arguments to an array of strings
// Allow for several class names like "a b, c" and several parameters
u.prototype.args = function (args, node, i) {
if (typeof args === 'function') {
args = args(node, i);
}
// First flatten it all to a string http://stackoverflow.com/q/22920305
// If we try to slice a string bad things happen: ['n', 'a', 'm', 'e']
if (typeof args !== 'string') {
args = this.slice(args).map(this.str(node, i));
}
// Then convert that string to an array of not-null strings
return args.toString().split(/[\s,]+/).filter(function (e) {
return e.length;
});
};
// Merge all of the nodes that the callback return into a simple array
u.prototype.array = function (callback) {
callback = callback;
var self = this;
return this.nodes.reduce(function (list, node, i) {
var val;
if (callback) {
val = callback.call(self, node, i);
if (!val) val = false;
if (typeof val === 'string') val = u(val);
if (val instanceof u) val = val.nodes;
} else {
val = node.innerHTML;
}
return list.concat(val !== false ? val : []);
}, []);
};
// [INTERNAL USE ONLY]
// Handle attributes for the matched elements
u.prototype.attr = function (name, value, data) {
data = data ? 'data-' : '';
// This will handle those elements that can accept a pair with these footprints:
// .attr('a'), .attr('a', 'b'), .attr({ a: 'b' })
return this.pairs(name, value, function (node, name) {
return node.getAttribute(data + name);
}, function (node, name, value) {
node.setAttribute(data + name, value);
});
};
// Add some html before each of the matched elements.
u.prototype.before = function (html, data) {
return this.adjacent(html, data, function (node, fragment) {
node.parentNode.insertBefore(fragment, node);
});
};
// Get the direct children of all of the nodes with an optional filter
u.prototype.children = function (selector) {
return this.map(function (node) {
return this.slice(node.children);
}).filter(selector);
};
/**
* Deep clone a DOM node and its descendants.
* @return {[Object]} Returns an Umbrella.js instance.
*/
u.prototype.clone = function () {
return this.map(function (node, i) {
var clone = node.cloneNode(true);
var dest = this.getAll(clone);
this.getAll(node).each(function (src, i) {
for (var key in this.mirror) {
this.mirror[key](src, dest.nodes[i]);
}
});
return clone;
});
};
/**
* Return an array of DOM nodes of a source node and its children.
* @param {[Object]} context DOM node.
* @param {[String]} tag DOM node tagName.
* @return {[Array]} Array containing queried DOM nodes.
*/
u.prototype.getAll = function getAll (context) {
return u([context].concat(u('*', context).nodes));
};
// Store all of the operations to perform when cloning elements
u.prototype.mirror = {};
/**
* Copy all JavaScript events of source node to destination node.
* @param {[Object]} source DOM node
* @param {[Object]} destination DOM node
* @return {[undefined]]}
*/
u.prototype.mirror.events = function (src, dest) {
if (!src._e) return;
for (var type in src._e) {
src._e[type].forEach(function (event) {
u(dest).on(type, event);
});
}
};
/**
* Copy select input value to its clone.
* @param {[Object]} src DOM node
* @param {[Object]} dest DOM node
* @return {[undefined]}
*/
u.prototype.mirror.select = function (src, dest) {
if (u(src).is('select')) {
dest.value = src.value;
}
};
/**
* Copy textarea input value to its clone
* @param {[Object]} src DOM node
* @param {[Object]} dest DOM node
* @return {[undefined]}
*/
u.prototype.mirror.textarea = function (src, dest) {
if (u(src).is('textarea')) {
dest.value = src.value;
}
};
// Find the first ancestor that matches the selector for each node
u.prototype.closest = function (selector) {
return this.map(function (node) {
// Keep going up and up on the tree. First element is also checked
do {
if (u(node).is(selector)) {
return node;
}
} while ((node = node.parentNode) && node !== document);
});
};
// Handle data-* attributes for the matched elements
u.prototype.data = function (name, value) {
return this.attr(name, value, true);
};
// Loops through every node from the current call
u.prototype.each = function (callback) {
// By doing callback.call we allow "this" to be the context for
// the callback (see http://stackoverflow.com/q/4065353 precisely)
this.nodes.forEach(callback.bind(this));
return this;
};
// [INTERNAL USE ONLY]
// Loop through the combination of every node and every argument passed
u.prototype.eacharg = function (args, callback) {
return this.each(function (node, i) {
this.args(args, node, i).forEach(function (arg) {
// Perform the callback for this node
// By doing callback.call we allow "this" to be the context for
// the callback (see http://stackoverflow.com/q/4065353 precisely)
callback.call(this, node, arg);
}, this);
});
};
// Remove all children of the matched nodes from the DOM.
u.prototype.empty = function () {
return this.each(function (node) {
while (node.firstChild) {
node.removeChild(node.firstChild);
}
});
};
// .filter(selector)
// Delete all of the nodes that don't pass the selector
u.prototype.filter = function (selector) {
// The default function if it's a css selector
// Cannot change name to 'selector' since it'd mess with it inside this fn
var callback = function (node) {
// Make it compatible with some other browsers
node.matches = node.matches || node.msMatchesSelector || node.webkitMatchesSelector;
// Check if it's the same element (or any element if no selector was passed)
return node.matches(selector || '*');
};
// filter() receives a function as in .filter(e => u(e).children().length)
if (typeof selector === 'function') callback = selector;
// filter() receives an instance of Umbrella as in .filter(u('a'))
if (selector instanceof u) {
callback = function (node) {
return (selector.nodes).indexOf(node) !== -1;
};
}
// Just a native filtering function for ultra-speed
return u(this.nodes.filter(callback));
};
// Find all the nodes children of the current ones matched by a selector
u.prototype.find = function (selector) {
return this.map(function (node) {
return u(selector || '*', node);
});
};
// Get the first of the nodes
u.prototype.first = function () {
return this.nodes[0] || false;
};
// [INTERNAL USE ONLY]
// Generate a fragment of HTML. This irons out the inconsistences
u.prototype.generate = function (html) {
// Table elements need to be child of <table> for some f***ed up reason
if (/^\s*<tr[> ]/.test(html)) {
return u(document.createElement('table')).html(html).children().children().nodes;
} else if (/^\s*<t(h|d)[> ]/.test(html)) {
return u(document.createElement('table')).html(html).children().children().children().nodes;
} else if (/^\s*</.test(html)) {
return u(document.createElement('div')).html(html).children().nodes;
} else {
return document.createTextNode(html);
}
};
// Change the default event for the callback. Simple decorator to preventDefault
u.prototype.handle = function () {
var args = this.slice(arguments).map(function (arg) {
if (typeof arg === 'function') {
return function (e) {
e.preventDefault();
arg.apply(this, arguments);
};
}
return arg;
}, this);
return this.on.apply(this, args);
};
// Find out whether the matched elements have a class or not
u.prototype.hasClass = function () {
// Check if any of them has all of the classes
return this.is('.' + this.args(arguments).join('.'));
};
// Set or retrieve the html from the matched node(s)
u.prototype.html = function (text) {
// Needs to check undefined as it might be ""
if (text === undefined) {
return this.first().innerHTML || '';
}
// If we're attempting to set some text
// Loop through all the nodes
return this.each(function (node) {
// Set the inner html to the node
node.innerHTML = text;
});
};
// Check whether any of the nodes matches the selector
u.prototype.is = function (selector) {
return this.filter(selector).length > 0;
};
/**
* Internal use only. This function checks to see if an element is in the page's body. As contains is inclusive and determining if the body contains itself isn't the intention of isInPage this case explicitly returns false.
https://developer.mozilla.org/en-US/docs/Web/API/Node/contains
* @param {[Object]} node DOM node
* @return {Boolean} The Node.contains() method returns a Boolean value indicating whether a node is a descendant of a given node or not.
*/
u.prototype.isInPage = function isInPage (node) {
return (node === document.body) ? false : document.body.contains(node);
};
// Get the last of the nodes
u.prototype.last = function () {
return this.nodes[this.length - 1] || false;
};
// Merge all of the nodes that the callback returns
u.prototype.map = function (callback) {
return callback ? u(this.array(callback)).unique() : this;
};
// Delete all of the nodes that equals the filter
u.prototype.not = function (filter) {
return this.filter(function (node) {
return !u(node).is(filter || true);
});
};
// Removes the callback to the event listener for each node
u.prototype.off = function (events) {
return this.eacharg(events, function (node, event) {
u(node._e ? node._e[event] : []).each(function (cb) {
node.removeEventListener(event, cb);
});
});
};
// Attach a callback to the specified events
u.prototype.on = function (events, cb, cb2) {
if (typeof cb === 'string') {
var sel = cb;
cb = function (e) {
var args = arguments;
u(e.currentTarget).find(sel).each(function (target) {
if (target === e.target || target.contains(e.target)) {
try {
Object.defineProperty(e, 'currentTarget', {
get: function () {
return target;
}
});
} catch (err) {}
cb2.apply(target, args);
}
});
};
}
// Add the custom data as arguments to the callback
var callback = function (e) {
return cb.apply(this, [e].concat(e.detail || []));
};
return this.eacharg(events, function (node, event) {
node.addEventListener(event, callback);
// Store it so we can dereference it with `.off()` later on
node._e = node._e || {};
node._e[event] = node._e[event] || [];
node._e[event].push(callback);
});
};
// [INTERNAL USE ONLY]
// Take the arguments and a couple of callback to handle the getter/setter pairs
// such as: .css('a'), .css('a', 'b'), .css({ a: 'b' })
u.prototype.pairs = function (name, value, get, set) {
// Convert it into a plain object if it is not
if (typeof value !== 'undefined') {
var nm = name;
name = {};
name[nm] = value;
}
if (typeof name === 'object') {
// Set the value of each one, for each of the { prop: value } pairs
return this.each(function (node) {
for (var key in name) {
set(node, key, name[key]);
}
});
}
// Return the style of the first one
return this.length ? get(this.first(), name) : '';
};
// [INTERNAL USE ONLY]
// Parametize an object: { a: 'b', c: 'd' } => 'a=b&c=d'
u.prototype.param = function (obj) {
return Object.keys(obj).map(function (key) {
return this.uri(key) + '=' + this.uri(obj[key]);
}.bind(this)).join('&');
};
// Travel the matched elements one node up
u.prototype.parent = function (selector) {
return this.map(function (node) {
return node.parentNode;
}).filter(selector);
};
// Add nodes at the beginning of each node
u.prototype.prepend = function (html, data) {
return this.adjacent(html, data, function (node, fragment) {
node.insertBefore(fragment, node.firstChild);
});
};
// Delete the matched nodes from the DOM
u.prototype.remove = function () {
// Loop through all the nodes
return this.each(function (node) {
// Perform the removal only if the node has a parent
if (node.parentNode) {
node.parentNode.removeChild(node);
}
});
};
// Removes a class from all of the matched nodes
u.prototype.removeClass = function () {
// Loop the combination of each node with each argument
return this.eacharg(arguments, function (el, name) {
// Remove the class using the native method
el.classList.remove(name);
});
};
// Replace the matched elements with the passed argument.
u.prototype.replace = function (html, data) {
var nodes = [];
this.adjacent(html, data, function (node, fragment) {
nodes = nodes.concat(this.slice(fragment.children));
node.parentNode.replaceChild(fragment, node);
});
return u(nodes);
};
// Scroll to the first matched element
u.prototype.scroll = function () {
this.first().scrollIntoView({ behavior: 'smooth' });
return this;
};
// [INTERNAL USE ONLY]
// Select the adecuate part from the context
u.prototype.select = function (parameter, context) {
// Allow for spaces before or after
parameter = parameter.replace(/^\s*/, '').replace(/\s*$/, '');
if (/^</.test(parameter)) {
return u().generate(parameter);
}
return (context || document).querySelectorAll(parameter);
};
// Convert forms into a string able to be submitted
// Original source: http://stackoverflow.com/q/11661187
u.prototype.serialize = function () {
var self = this;
// Store the class in a variable for manipulation
return this.slice(this.first().elements).reduce(function (query, el) {
// We only want to match enabled elements with names, but not files
if (!el.name || el.disabled || el.type === 'file') return query;
// Ignore the checkboxes that are not checked
if (/(checkbox|radio)/.test(el.type) && !el.checked) return query;
// Handle multiple selects
if (el.type === 'select-multiple') {
u(el.options).each(function (opt) {
if (opt.selected) {
query += '&' + self.uri(el.name) + '=' + self.uri(opt.value);
}
});
return query;
}
// Add the element to the object
return query + '&' + self.uri(el.name) + '=' + self.uri(el.value);
}, '').slice(1);
};
// Travel the matched elements at the same level
u.prototype.siblings = function (selector) {
return this.parent().children(selector).not(this);
};
// Find the size of the first matched element
u.prototype.size = function () {
return this.first().getBoundingClientRect();
};
// [INTERNAL USE ONLY]
// Force it to be an array AND also it clones them
// http://toddmotto.com/a-comprehensive-dive-into-nodelists-arrays-converting-nodelists-and-understanding-the-dom/
u.prototype.slice = function (pseudo) {
// Check that it's not a valid object
if (!pseudo ||
pseudo.length === 0 ||
typeof pseudo === 'string' ||
pseudo.toString() === '[object Function]') return [];
// Accept also a u() object (that has .nodes)
return pseudo.length ? [].slice.call(pseudo.nodes || pseudo) : [pseudo];
};
// [INTERNAL USE ONLY]
// Create a string from different things
u.prototype.str = function (node, i) {
return function (arg) {
// Call the function with the corresponding nodes
if (typeof arg === 'function') {
return arg.call(this, node, i);
}
// From an array or other 'weird' things
return arg.toString();
};
};
// Set or retrieve the text content from the matched node(s)
u.prototype.text = function (text) {
// Needs to check undefined as it might be ""
if (text === undefined) {
return this.first().textContent || '';
}
// If we're attempting to set some text
// Loop through all the nodes
return this.each(function (node) {
// Set the text content to the node
node.textContent = text;
});
};
// Activate/deactivate classes in the elements
u.prototype.toggleClass = function (classes, addOrRemove) {
/* jshint -W018 */
// Check if addOrRemove was passed as a boolean
if (!!addOrRemove === addOrRemove) {
return this[addOrRemove ? 'addClass' : 'removeClass'](classes);
}
/* jshint +W018 */
// Loop through all the nodes and classes combinations
return this.eacharg(classes, function (el, name) {
el.classList.toggle(name);
});
};
// Call an event manually on all the nodes
u.prototype.trigger = function (events) {
var data = this.slice(arguments).slice(1);
return this.eacharg(events, function (node, event) {
var ev;
// Allow the event to bubble up and to be cancelable (as default)
var opts = { bubbles: true, cancelable: true, detail: data };
try {
// Accept different types of event names or an event itself
ev = new window.CustomEvent(event, opts);
} catch (e) {
ev = document.createEvent('CustomEvent');
ev.initCustomEvent(event, true, true, data);
}
node.dispatchEvent(ev);
});
};
// [INTERNAL USE ONLY]
// Removed duplicated nodes, used for some specific methods
u.prototype.unique = function () {
return u(this.nodes.reduce(function (clean, node) {
var istruthy = node !== null && node !== undefined && node !== false;
return (istruthy && clean.indexOf(node) === -1) ? clean.concat(node) : clean;
}, []));
};
// [INTERNAL USE ONLY]
// Encode the different strings https://gist.github.com/brettz9/7147458
u.prototype.uri = function (str) {
return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
};
u.prototype.wrap = function (selector) {
function findDeepestNode (node) {
while (node.firstElementChild) {
node = node.firstElementChild;
}
return u(node);
}
// 1) Construct dom node e.g. u('<a>'),
// 2) clone the currently matched node
// 3) append cloned dom node to constructed node based on selector
return this.map(function (node) {
return u(selector).each(function (n) {
findDeepestNode(n)
.append(node.cloneNode(true));
node
.parentNode
.replaceChild(n, node);
});
});
};
// Export it for webpack
if (typeof module === 'object' && module.exports) {
module.exports = { u: u };
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,27 @@
/**
* @file
* A JavaScript file for the mobile menu.
*/
(function ($) {
'use strict';
// Activate the mobil menu for small screens.
if (window.matchMedia && $('.mobile-nav').length) {
var mq = window.matchMedia('(max-width: 999px)');
if (mq.matches) {
// Toggle the mobile nav sheet.
$('.mobile-nav__cover, .mobile-nav__toggle').handle('click', function () {
$('body').scroll().toggleClass('js-nav-open');
});
// Close the nav sheet after click (needed for anchor links).
$('.mobile-nav__sheet').find('a').on('click', function () {
$('body').removeClass('js-nav-open');
});
}
}
})(u);

View File

@ -0,0 +1,13 @@
/**
* @file
* A JavaScript file for the theme. Runs first, before jQuery etc. have loaded.
*/
(function () {
'use strict';
// Add a js class to the html-tag when JavsScript is active.
document.querySelector('html').classList.replace('nojs', 'js');
})();

View File

@ -0,0 +1,12 @@
/**
* @file
* A JavaScript file for the theme.
*/
(function ($) {
'use strict';
// Place your code here.
})(u);

View File

@ -0,0 +1,75 @@
/**
* @file
* A JavaScript file for flexsearch.
*/
(function () {
'use strict';
const flexSearch = new FlexSearch({
doc: {
id: 'id',
field: ['title','tags','content','date'],
store: ['title','summary','date','permalink']
}
});
function showResults(items) {
const template = document.querySelector('template').content;
const fragment = document.createDocumentFragment();
const results = document.querySelector('.search-results');
results.textContent = '';
for (const item of items) {
const result = template.cloneNode(true);
const a = result.querySelector('a');
const time = result.querySelector('time');
const content = result.querySelector('.content');
a.innerHTML = item.title;
a.href = item.permalink;
time.innerText = item.date;
content.innerHTML = item.summary;
fragment.appendChild(result);
}
results.appendChild(fragment);
}
function doSearch () {
const query = document.querySelector('.search-text').value.trim();
const results = flexSearch.search({
query: query,
limit: {{ .Site.Params.searchLimit | default 20 }}
});
showResults(results);
}
function enableUI () {
const searchform = document.querySelector('.search-form');
searchform.addEventListener('submit', function (e) {
e.preventDefault();
doSearch();
})
searchform.addEventListener('keyup', function () {
doSearch();
})
document.querySelector('.search-loading').classList.add('hidden');
document.querySelector('.search-input').classList.remove('hidden');
document.querySelector('.search-text').focus();
}
function buildIndex () {
document.querySelector('.search-loading').classList.remove('hidden');
fetch('/searchindex.json')
.then(function (response) {
return response.json();
})
.then(function (data) {
flexSearch.add(data);
});
}
buildIndex();
enableUI();
})();

View File

@ -0,0 +1,19 @@
/**
* @file
* A JavaScript file for analytic tracking.
*/
var idSite = '{{ .Site.Params.piwikSiteID }}';
var matomoTrackingApiUrl = 'https://{{ .Site.Params.piwikTrackerUrl }}/matomo.php';
var _paq = window._paq || [];
_paq.push(['setTrackerUrl', matomoTrackingApiUrl]);
_paq.push(['setSiteId', idSite]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
var googleAnalytics = '{{ .Site.GoogleAnalytics }}';
var _gaq = window._gaq || [];
_gaq.push(['_setAccount', googleAnalytics]);
_gaq.push(['_trackPageView']);

Some files were not shown because too many files have changed in this diff Show More