Initial AD port

This commit is contained in:
2021-04-26 18:26:42 +01:00
parent 6911ce346b
commit 7e7773258a
408 changed files with 17799 additions and 172 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,88 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<!doctype html>
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ partial "meta/content-security-policy.html" . }}
<meta name="generator" content="After Dark Hugo">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ block "title" . }}{{ .Title }} | {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
<meta name="keywords" content="{{ if .Keywords }}{{ delimit .Keywords ", " }}{{ else if and .IsPage .Params.tags }}{{ delimit .Params.tags ", " }}{{ else }}{{ range $term, $val := .Site.Taxonomies.categories }}{{ lower (humanize $term) }}, {{ end }}{{ end }}">
{{ $default_noindex_kinds := slice "section" "taxonomy" "taxonomyTerm" }}
{{ $noindex_kinds := .Site.Params.noindex_kinds | default $default_noindex_kinds }}
{{ $is_noindex_true := and (isset .Params "noindex") .Params.noindex }}
{{ if or (in $noindex_kinds .Kind) ($is_noindex_true) }}
<meta name="robots" content="noindex">
{{ end }}
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ partial "meta/ogimage-maybe.html" . }}
{{ partial "meta/telegram-channel-maybe.html" . }}
{{ if eq .Kind "home" }}
{{ partial "meta/verifications.html" . }}
{{ end }}
{{ partial "meta/http-referrer.html" . }}
{{ $import := resources.Get "/js/vendor/fetch-inject.min.js" }}
{{ $baseof := resources.Get "/js/baseof.js" | resources.ExecuteAsTemplate "baseof.js" . }}
<script integrity="{{ ($import | resources.Fingerprint "sha512").Data.Integrity }}">
{{- $import.Content | safeJS -}}
</script>
<script integrity="{{ ($baseof | resources.Fingerprint "sha512").Data.Integrity }}">
{{- $baseof.Content | safeJS -}}
</script>
{{ partial "head/modules.html" . }}
{{ with .OutputFormats.Get "rss" }}
{{ printf "<link rel=\"%s\" type=\"%s\" href=\"%s\" title=\"%s\">" .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end }}
<link rel="canonical" href="{{ .Permalink }}">
{{ if (isset .Params "prev") }}
<link rel="prev" href="{{ .Params.prev }}">
{{ end }}
{{ if (isset .Params "next") }}
<link rel="next" href="{{ .Params.next }}">
{{ end }}
{{ partial "head/favicon.html" . }}
{{ partial "global-styles.html" . }}
{{ $highlights := findRE "class\\s*?=\\s*?\".*?\\bhighlight\\b.*?\"|class\\s*?=\\s*?highlight\\b" .Content }}
{{ if ge (len $highlights) 1 }}
<script integrity="sha512-ISTAV0GadOIz/NXXHOS+eCM0ysXVVHhQTlvA6LJxz/DeA5yIxm0Vqf5IE+WH0yuuXkayAKtoZkQ326nch5f/fg==">fetchInject([{{ "/css/syntax.css" | relURL }}]);</script>
<noscript>
<link href="{{ "/css/syntax.css" | relURL }}" rel="stylesheet">
</noscript>
{{ end }}
</head>
{{ $hackcss_disabled := .Site.Params.hackcss.disabled | default false }}
{{ $hackcss_mode := .Site.Params.hackcss.mode | default "hack" }}
{{ $hackcss_palette := .Site.Params.hackcss.palette | default "dark" }}
<body class="{{ if ne $hackcss_disabled true }}{{ $hackcss_mode }} {{ $hackcss_palette }} main container{{ end }}">
<header>{{ block "header" . }}{{ end }}</header>
<main>{{ block "main" . }}{{ end }}</main>
<footer>{{ block "footer" . }}{{ end }}</footer>
{{ $defaults := .Site.Params.defaults.modules }}
{{ $modules := .Site.Params.modules }}
{{ if (or $modules $defaults) }}
{{ with (default $defaults.toxic_swamp $modules.toxic_swamp) }}
{{ partial "modules/toxic-swamp/toolbar.html" dict }}
{{ end }}
{{ end }}
</body>
</html>

View File

@@ -0,0 +1,77 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "title" -}}
{{ .Site.Title }}
{{- end }}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1 itemprop="name">{{ .Title }}</h1>
</header>
{{ with .Site.Params.layout.home.section }}
{{ if ne $.Site.Params.hackcss.disabled true }}
{{ with resources.Get "css/conditional/layouts/partials/page-thumbs.css" | minify }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
{{ end }}
{{ range sort . "weight" "asc" }}
<section>
{{ $index := site.GetPage "section" .type }}
{{ $pages := where site.RegularPages "Type" .type }}
{{ $page_count := (default 1 (len $pages)) }}
{{ if eq $page_count 1 }}
{{ partial "page-summary.html" $index }}
{{ else if gt $page_count 1 }}
<header>
<h1 itemprop="name">
<a href="{{ $index.RelPermalink }}">Recent {{ $index.Title }}</a>
</h1>
<blockquote itemprop="description">{{ $index.Description }}</blockquote>
</header>
{{ partial "page-thumbs.html" (dict "thumbnail_options" .thumbs "page_count" $page_count "limit" .limit "pages" $pages) }}
{{ end }}
{{ if and (lt .limit $page_count) (ne 1 $page_count) }}
<nav class="readmore">
<a itemprop="url" href="{{ $index.RelPermalink }}">
View more {{ $index.Title }}
</a>
</nav>
{{ end }}
</section>
{{ end }}
{{ end }}
{{ if not .Site.Params.layout.home.hide_blog }}
<section itemscope itemtype="https://schema.org/Blog">
{{ range (.Paginate (where .Site.RegularPages "Type" "in" (site.Params.layout.homepage.sections | default (slice "post")))).Pages }}
{{ partial "page-summary.html" . }}
{{ end }}
</section>
{{ end }}
{{ end }}
{{ define "footer" }}
{{ if not .Site.Params.layout.home.hide_blog }}
<p>{{ partial "pagination.html" . }}</p>
{{ end }}
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}

View File

@@ -0,0 +1,27 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{- $scratch := newScratch -}}
{{- $scratch.Add "index" slice -}}
{{- range .Site.RegularPages -}}
{{- if ne .Params.noindex true -}}
{{- $scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "url" .RelPermalink "summary" .Summary) -}}
{{- end -}}
{{- end -}}
{{- $scratch.Get "index" | jsonify -}}

View File

@@ -0,0 +1,36 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
</header>
{{ range .Paginator.Pages }}
{{ partial "page-summary.html" . }}
{{ end }}
{{ end }}
{{ define "footer" }}
<p>{{ partial "pagination.html" . }}</p>
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}

View File

@@ -0,0 +1,53 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<docs>https://blogs.law.harvard.edu/tech/rss</docs>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description>{{ range first 1 (default slice .Site.Params.images) }}
<image>
<title>{{ if eq $.Title $.Site.Title }}{{ $.Site.Title }}{{ else }}{{ with $.Title }}{{ . }} on {{ end }}{{ $.Site.Title }}{{ end }}</title>
<link>{{ $.Permalink }}</link>
<url>{{ . }}</url>
</image>{{ end }}
<ttl>1440</ttl>
<generator>{{ with .Site.Data.npm.latest }}{{ .name | humanize | title }} {{ .version }} (Hugo {{ hugo.Version }}){{ else }}Hugo {{ hugo.Version }}{{ end }}</generator>{{ with .Site.LanguageCode }}
<language>{{ . }}</language>{{ end }}{{ with .Site.Author }}
<managingEditor>{{ .email }}{{ with .name }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with .Site.Author }}
<webMaster>{{ .email }}{{ with .name }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }}
<copyright>{{ . | plainify }}</copyright>{{ end }}{{ if not now.IsZero }}
<lastBuildDate>{{ dateFormat "Mon, 02 Jan 2006 15:04:05" now.UTC | safeHTML }} UT</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>{{ if not .PublishDate.IsZero }}
<pubDate>{{ dateFormat "Mon, 02 Jan 2006 15:04:05" .Date.UTC | safeHTML }} UT</pubDate>{{ end }}{{ if ne .Site.Params.hide_author true }}{{ if or (.Param "author") .Site.Author.email }}
<dc:creator>{{ default .Site.Author.email (.Param "author") }}{{ if and (not (.Param "author")) .Site.Author.name }} ({{ default (.Param "author") .Site.Author.name }}){{ end }}</dc:creator>{{ end }}{{ end }}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | plainify }}</description>{{ range .Params.categories }}
<category domain="{{ printf "%s%s" ("/categories/" | absURL) (. | urlize ) }}">{{ . | title }}</category>{{ end }}{{ with .Resources.GetMatch "enclosure" }}{{ if .Params.length }}
<enclosure url="{{ .Permalink }}" length="{{ .Params.length }}" type="{{ .MediaType }}" />{{ end }}{{ end }}
<content:encoded>{{ "<![CDATA[" | safeHTML }}{{ .Content | plainify }}{{ "]]>" | safeHTML }}</content:encoded>
</item>{{ end }}
</channel>
</rss>

View File

@@ -0,0 +1,70 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "title" -}}
{{ .Title }} | {{ .Site.Title }}
{{- end }}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
</header>
<div id="search-app" v-cloak>
{{ with resources.Get "css/conditional/layouts/search.css" | minify }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
<section>
<form v-on:submit.prevent role="search" class="form" action="{{ "search" | absURL }}">
<fieldset class="form-group">
<input v-model="query" id="query" name="s" type="search" class="form-control" maxlength="32" autocomplete="off"{{ with .Params.form.input.placeholder }} placeholder="{{ . }}"{{ end }}{{ if eq .Params.form.input.disabled true }} disabled{{ end }}>
{{ with .Params.form.helpblock }}
<div class="help-block js-cloaked">{{ . | safeHTML }}</div>
{{ end }}
<div class="help-block js-initializing">{{/* placeholder */}}</div>
</fieldset>
</form>
</section>
<noscript>
<p>Cannot initialize. Search requires JavaScript to function.</p>
</noscript>
<section v-if="results.length" class="js-cloaked">
<p><i>Showing results for “{ resultsForSearch }”.</i></p>
<div id="search-results">
<article v-for="result in results" itemscope itemtype="https://schema.org/CreativeWork">
<header itemprop="name">
<h2 itemprop="name"><a :href="result.item.url">{ result.item.title }</a></h2>
</header>
<div v-html=result.item.summary itemprop="description"></div>
<nav class="readmore"><p><a itemprop="url" :href="result.item.url">Read More&nbsp;&raquo;</a></p></nav>
</article>
</div>
</section>
</div>
{{ end }}
{{ define "footer" }}
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ $script := resources.Get "/js/search.js" | resources.ExecuteAsTemplate "search.js" . }}
<script integrity="{{ printf "%s" ($script | resources.Fingerprint "sha512").Data.Integrity | safeHTML }}">
{{- $script.Content | safeJS -}}
</script>
{{ end }}

View File

@@ -0,0 +1,36 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "title" -}}
{{ .Title }} | {{ .Site.Title }}
{{- end }}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
</header>
{{ .Content }}
{{ end }}
{{ define "footer" }}
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}

View File

@@ -0,0 +1,36 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
</header>
{{ range .Paginator.Pages }}
{{ partial "page-summary.html" . }}
{{ end }}
{{ end }}
{{ define "footer" }}
<p>{{ partial "pagination.html" . }}</p>
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}

View File

@@ -0,0 +1,35 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1>{{ .Title }}</h1>
</header>
<ul>
{{ range $key, $value := .Data.Terms }}
<li><a href="{{ $key | urlize }}">{{ $key }}</a> ({{ len $value }})
{{ end }}
</ul>
{{ end }}
{{ define "footer" }}
{{ partial "copyright-notice.html" . }}
{{ end }}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="alert {{ with .type }}alert-{{ . }}{{ end }}{{ with .class }} {{ . }}{{ end }}">
{{ .body }}
</div>

View File

@@ -0,0 +1,34 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<button
{{ with .id }}id="{{ . | urlize }}" {{ end }}
{{ with .name }}name="{{ . | safeURL }}" {{ end }}
{{ with .action }}formaction="{{ . | safeURL }}" {{ end }}
{{ with .form }}form="{{ . }}" {{ end }}
{{ with .value }}value="{{ . | safeHTMLAttr }}" {{ end }}
{{ with .target }}formtarget="{{ . }}" {{ end }}
{{ with .tabindex }}tabindex="{{ . }}" {{ end }}
{{ with .onclick }}onclick={{ . | safeJS }} {{ end }}
{{ if in (slice "true" "disabled") .disabled }}disabled {{ end }}
{{ if in (slice "get" "post") .method }}formmethod="{{ .method }}" {{ end }}
class="btn btn-{{ .type | default "default" }}{{ if eq .isghost "true" }} btn-ghost{{ end }}
{{- if eq .isblock "true" }} btn-block{{ end }}
{{- with .class }} {{ . }}{{ end }}"
>{{ .body }}</button>

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="btn-group{{ if eq .formactions "true" }} form-actions{{ end }}{{ with .class }} {{ . }}{{ end }}">
{{ .body }}
</div>

View File

@@ -0,0 +1,25 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="card">
<header class="card-header">{{ .header }}</header>
<div class="card-content">
<div class="inner">{{ .body }}</div>
</div>
</div>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="cell{{ with .class }} {{ . }}{{ end }}">{{ .body }}</div>

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{- /**/ -}}
<a {{ with .itemtype }} itemprop itemtype="https://schema.org/{{ . }}"{{ end }} target="{{ .target | default "_blank" }}"{{ with .type }} type="{{ . }}"{{ end }}{{ with .title }} title="{{ . }}"{{ end }}{{ with .rel }} rel="{{ . }}"{{ else }} rel="{{ if ne .supress_external true }}external{{ end }} noopener"{{ end }}{{ if eq .trusted "true" }} href="{{ .href | safeURL }}"{{ else }} href="{{ .href }}"{{ end }}{{ with .referrerpolicy }} referrerpolicy="{{ . }}"{{ end }}{{ with .class }} class="{{ . }}"{{ end }}>{{ .body | default (replaceRE "^https?://(.*)" "$1" .href) }}</a>
{{- /**/ -}}

View File

@@ -0,0 +1,53 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<figure{{ with .class }} class="{{ . }}"{{ end }}>
{{ if .link }}
<a href="{{ .link }}"{{ if .linktarget }} target="{{ .linktarget }}"{{ end }}{{ if eq .linktarget "_blank" }} rel="external noopener noreferrer"{{ end }} itemprop="url">
{{- if .lqipsrc -}}
<img class="lazyload blur-up" src="{{ .lqipsrc }}" data-src="{{ .src }}" {{ if or .alt .caption }}alt="{{ with .alt }}{{ . }}{{ else }}{{ .caption }}{{ end }}"{{ end }} itemprop="image">
{{- else -}}
<img class="lazyload" data-src="{{ .src }}" {{ if or .alt .caption }}alt="{{ if .alt }}{{ .alt }}{{ else }}{{ .caption }}{{ end }}"{{ end }} itemprop="image">
{{- end -}}
</a>
{{ else }}
{{- if .lqipsrc -}}
<img class="lazyload blur-up" src="{{ .lqipsrc }}" data-src="{{ .src }}" {{ if or .alt .caption }}alt="{{ with .alt }}{{ . }}{{ else }}{{ .caption }}{{ end }}"{{ end }} itemprop="image">
{{- else -}}
<img class="lazyload" data-src="{{ .src }}" {{ if or .alt .caption }}alt="{{ if .alt }}{{ .alt }}{{ else }}{{ .caption }}{{ end }}"{{ end }} itemprop="image">
{{- end -}}
{{ end }}
{{ if or (or .title .caption) .attr }}
<figcaption>
{{ with .title }}
<header itemprop="name"><b>{{ . }}</b></header>
{{ end }}
{{ if or .caption .attr }}
<small>
<span itemprop="description">{{ .caption }}</span>
{{ if .attrlink }}
<a href="{{ .attrlink }}">
{{ .attr }}
</a>
{{ end }}
</small>
{{ end }}
</figcaption>
{{ end }}
</figure>

View File

@@ -0,0 +1,32 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<form
{{ with .id }}id="{{ . }}" {{ end }}
{{ with .name }}name="{{ . }}" {{ end }}
{{ with .action }}action="{{ . | safeURL }}" {{ end }}
{{ with .enctype }}enctype="{{ . }}" {{ end }}
{{ with .target }}target="{{ . }}" {{ end }}
{{ with .accept_charset }}accept-charset="{{ . }}" {{ end }}
{{ if eq .novalidate "true" }}novalidate {{ end }}
{{ if in (slice "on" "off") .autocomplete }}autocomplete="{{ .autocomplete }}" {{ end }}
{{ if in (slice "get" "post") .method }}method="{{ .method }}" {{ end }}
class="form{{ with .class }} {{ . }}{{ end }}">
{{- .body -}}
</form>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="form-actions">{{ .body }}</div>

View File

@@ -0,0 +1,27 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<fieldset
{{ with .form }}form="{{ . }}" {{ end }}
{{ with .name }}name="{{ . }}" {{ end }}
{{ if eq .disabled "true" }}disabled {{ end }}
class="form-group{{ if eq .hastextarea "true" }} form-textarea{{ end }}{{ if in (slice "success" "error" "warning") .state }} form-{{ .state }}{{ end }}{{ with .class }} {{ . }}{{ end }}">
{{ with .legend }}<legend>{{ . }}</legend>{{ end }}
{{ .body }}
</fieldset>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="grid{{ with .class }} {{ . }}{{ end }}">{{ .body }}</div>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<div class="help-block{{ with .class }} {{ . }}{{ end }}">{{ .body }}</div>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<label{{ with .for }} for="{{ . }}"{{ end }}{{ with .form }} form="{{ . }}"{{ end }}>{{ .body }}</label>

View File

@@ -0,0 +1,30 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ if not (eq .settings.hidden true) }}
<nav itemscope itemtype="https://schema.org/SiteNavigationElement">
<meta itemprop="name" content="{{ .name | humanize }} Menu">
{{ range .entries }}
{{ $is_active := or ($.page.IsMenuCurrent $.name .) ($.page.HasMenuCurrent $.name .) }}
{{ if (not (in $.settings.exclude .Identifier)) }}
<a itemprop="url"{{ if $is_active }} class="active"{{ end }}{{ if eq .Identifier "search" }} rel="search"{{ end }} href="{{ .URL }}">{{ if .Pre }}{{ .Pre | safeHTML }} {{ end }}{{ .Name }}{{ if .Post }} {{ .Post | safeHTML }}{{ end }}</a>
{{ end }}
{{ end }}
</nav>
{{ end }}

View File

@@ -0,0 +1,30 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ if eq .show_percent "true" }}
<div class="progress-bar progress-bar-show-percent">
{{ with .value }}
<div class="progress-bar-filled" style="width:{{ . }}%" data-filled="{{ $.fill_text }} {{ . }}%"></div>
{{ end }}
</div>
{{ else }}
<div class="progress-bar">
<div class="progress-bar-filled" style="width: {{ .value }}%"></div>
</div>
{{ end }}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<select{{ with .id }} id="{{ . | urlize }}"{{ end }}{{ with .name }} name="{{ . }}"{{ end }} {{ with .disabled }} disabled{{ end }}{{ with .form }} form="{{ . }}"{{ end }} class="form-control{{ with .class }} {{ . }}{{ end }}">
{{ with .body }}{{ . }}{{ end }}
</select>

View File

@@ -0,0 +1,42 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $permitted_attrs := .permitted_attrs }}
{{ $boolean_attrs := .boolean_attrs }}
{{ $validations := .validations }}
{{ range $name, $value := .attrs }}
{{ if and (ne $value nil) (in $permitted_attrs $name) }}
{{ if ne "class" $name }}
{{ if in $boolean_attrs $name }}
{{ if eq $value "true" }}{{ $name }}{{ end }}
{{ else if index $validations $name }}
{{ if in (index $validations $name) $value }}
{{ $name }}="{{ $value }}"
{{ end }}
{{ else }}
{{ if eq $name "id" }}
{{ $name }}="{{- $value | urlize -}}"
{{ else }}
{{ $name }}="{{ $value }}"
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
class="form-control{{ with .attrs.class }} {{ . }}{{ end }}"

View File

@@ -0,0 +1,25 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $permitted_attrs := .permitted_attrs | default (slice "id" "name" "class" "autocomplete" "autofocus" "cols" "disabled" "form" "maxlength" "minlength" "name" "placeholder" "readonly" "required" "rows" "spellcheck" "wrap" "tabindex") }}
{{ $boolean_attrs := .boolean_attrs | default (slice "autofocus" "disabled" "readonly" "required") }}
{{ $validations := .validations | default (dict "spellcheck" (slice "true" "default" "false") "autocomplete" (slice "on" "off") "wrap" (slice "hard" "soft" "off")) }}
<textarea {{ partial "components/snippets/textattrs.html" (dict "attrs" .attrs "permitted_attrs" $permitted_attrs "boolean_attrs" $boolean_attrs "validations" $validations) | safeHTMLAttr }}>
{{- with .body }}{{ . }}{{ end -}}
</textarea>

View File

@@ -0,0 +1,23 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $permitted_attrs := .permitted_attrs | default (slice "id" "name" "class" "autocomplete" "autofocus" "disabled" "form" "formaction" "formmethod" "formnovalidate" "formtarget" "height" "max" "maxlength" "min" "minlength" "multiple" "pattern" "placeholder" "readonly" "required" "size" "spellcheck" "step" "tabindex" "type" "value" "width") }}
{{ $boolean_attrs := .boolean_attrs | default (slice "autofocus" "disabled" "readonly" "required") }}
{{ $validations := .validations | default (dict "type" (slice "email" "hidden" "number" "password" "search" "tel" "text" "url") "spellcheck" (slice "true" "default" "false") "autocomplete" (slice "off" "on" "name" "honorific-prefix" "given-name" "additional-name" "family-name" "honorific-suffix" "nickname" "email" "username" "new-password" "current-password" "organization-title" "organization" "street-address" "address-line1" "address-line2" "address-line3" "address-level4" "address-level3" "address-level2" "address-level1" "country" "country-name" "postal-code" "cc-name" "cc-given-name" "cc-additional-name" "cc-family-name" "cc-number" "cc-exp" "cc-exp-month" "cc-exp-year" "cc-csc" "cc-type" "transaction-currency" "transaction-amount" "language" "bday" "bday-day" "bday-month" "bday-year" "sex" "tel" "tel-country-code" "tel-national" "tel-area-code" "tel-local" "tel-extension" "email" "impp" "url" "photo")) }}
<input {{ partial "components/snippets/textattrs.html" (dict "attrs" .attrs "permitted_attrs" $permitted_attrs "boolean_attrs" $boolean_attrs "validations" $validations) | safeHTMLAttr }}>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<span class="loading"></span>

View File

@@ -0,0 +1,52 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $path := (path.Base .node.RelPermalink) }}
{{ $is_src_relative := not (urls.Parse .src).Host }}
{{ $has_poster := ne .poster nil }}
{{ $is_poster_relative := not (urls.Parse .poster).Host }}
<video
class="lazyload{{ with .class }} {{ . }}{{ end }}"
{{ with .autoplay }} autoplay{{ end }}
{{ with .controls }} controls{{ end }}
{{ with .crossorigin }}crossorigin="{{ . }}"{{ end }}
{{ with .height }} height="{{ . }}"{{ end }}
{{ with .loop }} loop{{ end }}
{{ with .muted }} muted{{ end }}
{{ with .playsinline }} {{ . }}{{ end }}
{{ with .preload }} preload="{{ . }}"{{ end }}
{{ with .intrinsicsize }} intrinsicsize="{{ . }}"{{ end }}
{{ if $has_poster }}
{{ if $is_poster_relative -}}
poster="{{ relref .node $path }}{{ .poster }}"
{{- else }}
poster="{{ .poster }}"
{{ end }}
{{ end }}
{{ with .poster }} poster="{{ . }}"{{ end }}
{{ if $is_src_relative -}}
src="{{ relref .node $path }}{{ .src }}"
{{- else -}}
src="{{ .src }}"
{{- end }}
{{ with .width }} width="{{ . }}"{{ end }}
>
Your browser doesn't support HTML5 video. <a href="{{ if .is_src_relative }}{{ relref .node $path }}{{ .src }}{{ else }}{{ .src }}{{ end }}">Download video</a> instead.
</video>

View File

@@ -0,0 +1,33 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ if .Site.Copyright }}
{{ with (index .Params "copyright") }}
{{ range . }}
Copyright &copy; {{ .date }} {{ .owner }}.
{{ with (index $.Site.Data.licenses .license) }}
Licensed under {{ partial "components/external.html" (dict "href" .link "body" .shorthand "rel" "external noopener license") }}.
{{ else }}
Copyright &copy; {{ .date }} {{ .owner }}.
{{ end }}
{{ end }}
{{ else }}
{{ .Site.Copyright | safeHTML }}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,72 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $custom := resources.Get "css/custom.css" }}
{{ if eq .Site.Params.hackcss.disabled true }}
{{ with (slice $custom | resources.Concat "styles.css").Content }}
{{ if gt (len .) 0 }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ end }}
{{ else }}
{{ $hack := resources.Get "css/vendor/hack/hack.css" }}
{{ $standard := resources.Get "css/vendor/hack/standard.css" }}
{{ $dark := resources.Get "css/vendor/hack/dark.css" }}
{{ $darkgrey := resources.Get "css/vendor/hack/dark-grey.css" }}
{{ $solarizeddark := resources.Get "css/vendor/hack/solarized-dark.css" }}
{{ $theme := resources.Get "css/theme.css" | minify }}
{{ if eq .Site.Params.hackcss.palette "dark-grey" }}
{{ if eq .Site.Params.hackcss.mode "standard" }}
{{ with (slice $hack $standard $darkgrey $theme $custom | resources.Concat "styles.css").Content }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ else }}
{{ with (slice $hack $darkgrey $theme $custom | resources.Concat "styles.css").Content }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ end }}
{{ else if eq .Site.Params.hackcss.palette "solarized-dark" }}
{{ if eq .Site.Params.hackcss.mode "standard" }}
{{ with (slice $hack $standard $solarizeddark $theme $custom | resources.Concat "styles.css").Content }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ else }}
{{ with (slice $hack $solarizeddark $theme $custom | resources.Concat "styles.css").Content }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ end }}
{{ else }}
{{ if eq .Site.Params.hackcss.mode "standard" }}
{{ with (slice $hack $standard $dark $theme $custom | resources.Concat "styles.css").Content }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ else }}
{{ with (slice $hack $dark $theme $custom | resources.Concat "styles.css").Content }}
<style>{{ . | safeCSS }}</style>
{{ partial "meta/theme-color.html" . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<link rel="icon" sizes="any" href="data:image/svg+xml,%3Csvg%20viewBox='0%200%2046%2045'%20xmlns='http://www.w3.org/2000/svg'%3E%3Ctitle%3EAfter%20Dark%3C/title%3E%3Cpath%20d='M.708%2045L23%20.416%2045.292%2045H.708zM35%2038L23%2019%2011%2038h24z'%20fill='%23000'/%3E%3C/svg%3E">

View File

@@ -0,0 +1,35 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $defaults := .Site.Params.defaults.modules }}
{{ $modules := .Site.Params.modules }}
{{ if (or $modules $defaults) }}
{{ with $modules.fractal_forest }}
{{ partial "modules/fractal-forest/index.html" . }}
{{ end }}
{{ with $modules.hall_of_mirrors }}
{{ partial "modules/hall-of-mirrors/index.html" (dict "settings" . "page" $.Page) }}
{{ end }}
{{ with (default $defaults.toxic_swamp $modules.toxic_swamp) }}
{{ partial "modules/toxic-swamp/index.html" (dict "settings" . "data" $.Site.Data) }}
{{ end }}
{{ with $modules.voyeur }}
{{ partial "modules/voyeur/index.html" . }}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,81 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ with $.Resources.GetMatch "*header*" }}
{{ $meta_sameas := .Params.meta.sameas }}
{{ $meta_license := .Params.meta.license }}
{{ $meta_creator := .Params.meta.creator }}
{{ $meta_description := .Params.meta.description }}
{{ $meta_keywords := .Params.meta.keywords }}
{{ $meta_contentlocation := .Params.meta.contentlocation }}
{{ $image300 := .Fill "300x169 q20 Center" }}
{{ $image600 := .Fill "600x338 q60 Center" }}
{{ $image900 := .Fill "900x506 q70 Center" }}
{{ $image1200 := .Fill "1200x675 q80 Center" }}
{{ $image1600 := .Fill "1600x900 q90 Center" }}
<figure class="ratio-container" aria-hidden="true" itemscope itemtype="https://schema.org/ImageObject">
<link itemprop="contentUrl" href="{{ .RelPermalink }}">
<meta itemprop="encodingFormat" content="{{ .MediaType }}">
<meta itemprop="name" content="{{ .Name | plainify }}">
{{ if (urls.Parse $meta_sameas).Host }}
<link itemprop="sameAs" href="{{ $meta_sameas }}">
{{ end }}
{{ if (urls.Parse $meta_license).Host }}
<link itemprop="license" href="{{ $meta_license }}">
{{ end }}
{{ with $meta_keywords }}
<meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ end }}
{{ with $meta_contentlocation }}
<meta itemprop="contentLocation" content="{{ . | plainify }}">
{{ end }}
{{ with $meta_description }}
<meta itemprop="description" content="{{ . | plainify }}">
{{ end }}
<img
itemprop="thumbnailUrl"
alt="{{ with $meta_description }}{{ . }}{{ else }}{{ .Name | plainify }}{{ end }}"
class="lazyload blur-up"
src="{{ $image600.RelPermalink }}"
srcset="{{ $image300.RelPermalink }}"
data-srcset="{{ $image300.RelPermalink }} 300w, {{ $image600.RelPermalink }} 600w, {{ $image900.RelPermalink }} 900w, {{ $image1200.RelPermalink }} 1200w, {{ $image1600.RelPermalink }} 1600w"
data-sizes="auto"
>
{{ if or (not (path.Ext .Title)) (or $meta_creator $meta_sameas) }}
<figcaption itemprop="caption">
{{ if not (path.Ext .Title) }}
<span itemprop="headline">{{ .Title | plainify }}</span>.
{{ end }}
{{ if or $meta_creator $meta_sameas }}
Photo
{{ if $meta_creator }}
by
<span itemprop="creator">
{{ $meta_creator | plainify -}}
</span>
{{- end }}
{{- with (urls.Parse $meta_sameas).Host }}
on
{{ (strings.TrimSuffix (path.Ext .) .) | title }}
{{- end }}.
{{ end }}
</figcaption>
{{ end }}
</figure>
{{ end }}

View File

@@ -0,0 +1,79 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ $valid_processing_methods := (slice "resize" "fit" "fill") }}
{{ $options := .options | default slice }}
{{ $image_processing_method := default "fill" (index $options 0) }}
{{ $image_processing_options := index $options 1 }}
{{ if not (in $valid_processing_methods $image_processing_method) }}
{{ errorf "Invalid thumbnail processing method: Must be one of 'fit', 'fill' or 'resize'." }}
{{ else }}
{{ $scratch := newScratch }}
{{ with .node.Resources.GetMatch "*thumbnail*" }}
{{ $meta_sameas := .Params.meta.sameas }}
{{ $meta_license := .Params.meta.license }}
{{ $meta_creator := .Params.meta.creator }}
{{ $meta_description := .Params.meta.description }}
{{ $meta_keywords := .Params.meta.keywords }}
{{ $meta_contentlocation := .Params.meta.contentlocation }}
{{ if (eq $image_processing_method "resize") }}
{{ $scratch.Set "lodpi" (.Resize (default "400x300 q60 Gaussian" $image_processing_options)) }}
{{ $scratch.Set "hidpi" (.Resize (printf "%dx%d q90 Gaussian" (mul ($scratch.Get "lodpi").Width 2) (mul ($scratch.Get "lodpi").Height 2))) }}
{{ else if (eq $image_processing_method "fit") }}
{{ $scratch.Set "lodpi" (.Fit (default "400x300" $image_processing_options)) }}
{{ $scratch.Set "hidpi" (.Fit (printf "%dx%d" (mul ($scratch.Get "lodpi").Width 2) (mul ($scratch.Get "lodpi").Height 2))) }}
{{ else }}
{{ $scratch.Set "lodpi" (.Fill (default "400x300 Center" $image_processing_options)) }}
{{ $scratch.Set "hidpi" (.Fill (printf "%dx%d Center" (mul ($scratch.Get "lodpi").Width 2) (mul ($scratch.Get "lodpi").Height 2))) }}
{{ end }}
<figure aria-hidden="true" itemscope itemtype="https://schema.org/ImageObject">
<link itemprop="contentUrl" href="{{ .RelPermalink }}">
<meta itemprop="encodingFormat" content="{{ .MediaType }}">
<meta itemprop="name" content="{{ .Name | plainify }}">
{{ with .Title }}
<meta itemprop="headline" content="{{ . }}">
{{ end }}
{{ with $meta_creator }}
<meta itemprop="creator" content="{{ . | plainify -}}">
{{ end }}
{{ if (urls.Parse $meta_sameas).Host }}
<link itemprop="sameAs" href="{{ $meta_sameas }}">
{{ end }}
{{ if (urls.Parse $meta_license).Host }}
<link itemprop="license" href="{{ $meta_license }}">
{{ end }}
{{ with $meta_keywords }}
<meta itemprop="keywords" content="{{ delimit . ", " }}">
{{ end }}
{{ with $meta_contentlocation }}
<meta itemprop="contentLocation" content="{{ . | plainify }}">
{{ end }}
{{ with $meta_description }}
<meta itemprop="description" content="{{ . | plainify }}">
{{ end }}
<img
itemprop="thumbnailUrl"
alt="{{ with $meta_description }}{{ . }}{{ else }}{{ .Name | plainify }}{{ end }}"
class="lazyload blur-up"
src="{{ ($scratch.Get "lodpi").RelPermalink }}"
data-src="{{ ($scratch.Get "hidpi").RelPermalink }}"
>
</figure>
{{ end }}
{{ end }}

View File

@@ -0,0 +1,30 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $is_section_menu_enabled := ne .Site.Params.show_menu false }}
{{ range $name, $entries := .Site.Menus }}
{{ if or (ne $name "main") (and (eq $name "main") $is_section_menu_enabled) }}
{{ with $.Site.Params.layout.menu }}
{{ $settings := (index . $name) | default dict }}
{{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" $settings "page" $)}}
{{ else }}
{{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" dict "page" $)}}
{{ end }}
{{ end }}
{{ end }}

View File

@@ -0,0 +1,60 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $is_disabled := .Param "disable_csp" }}
{{ $site_directives := .Site.Params.security.csp.directives }}
{{ if and $site_directives (ne $is_disabled true) }}
{{ if ge (len $site_directives) 1 }}
<meta
http-equiv="Content-Security-Policy"
content="default-src{{ if $site_directives.defaultsrc }}
{{- range $site_directives.defaultsrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.defaultsrc }} {{ . | safeHTML }}{{ end -}}
{{ else }} 'none'{{ end }};connect-src{{ if $site_directives.connectsrc }}
{{- range $site_directives.connectsrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.connectsrc }} {{ . | safeHTML }}{{ end -}}
{{ else }} 'self'{{ end }};worker-src{{ if $site_directives.workersrc }}
{{- range $site_directives.workersrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.workersrc }} {{ . | safeHTML }}{{ end -}}
{{ else }} 'self'{{ end }};font-src{{ if $site_directives.fontsrc }}
{{- range $site_directives.fontsrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.fontsrc }} {{ . | safeHTML }}{{ end -}}
{{ else }} 'self'{{ end }};media-src{{ if $site_directives.mediasrc }}
{{- range $site_directives.mediasrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.mediasrc }} {{ . | safeHTML }}{{ end -}}
{{ else }} 'self'{{ end }};img-src{{ if $site_directives.imgsrc }}
{{- range $site_directives.imgsrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.imgsrc }} {{ . | safeHTML }}{{ end -}}
{{ else }} 'self' data:{{ end }};script-src{{ if $site_directives.scriptsrc }}
{{- range $site_directives.scriptsrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.scriptsrc }} {{ . | safeHTML }} {{ end -}}
{{ else }} 'none'{{ end }};style-src{{ if $site_directives.stylesrc }}
{{- range $site_directives.stylesrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.stylesrc }} {{ . | safeHTML }} {{ end -}}
{{ else }} 'self' 'unsafe-inline'{{ end }};frame-src{{ if $site_directives.framesrc }}
{{- range $site_directives.framesrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.framesrc }} {{ . | safeHTML }} {{ end -}}
{{ else }} 'self'{{ end }};object-src{{ if $site_directives.objectsrc }}
{{- range $site_directives.objectsrc }} {{ . | safeHTML }}{{ end -}}
{{- range .Params.security.csp.directives.objectsrc }} {{ . | safeHTML }} {{ end -}}
{{ else }} 'none'{{ end }};">
{{ end }}
{{ else if not $is_disabled }}
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https: 'unsafe-inline' 'unsafe-eval'; worker-src 'self' blob:; connect-src 'self' wss: data:; font-src 'self' https: data:; img-src 'self' https: data:; object-src 'none'">
{{ end }}

View File

@@ -0,0 +1,24 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ with .Site.Params.seo.referrer }}
<meta name="referrer" content="{{ . }}">
{{ else }}
<meta name="referrer" content="same-origin">
{{ end }}

View File

@@ -0,0 +1,32 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{/*
Hack to allow generic site image for Nodes until supported
by the Hugo internal opengraph template.
*/}}
{{ if and (.IsNode) (.Site.Params.images) }}
<meta property="og:image" content="{{ index .Site.Params.images 0 }}">
{{ end }}
{{/*
If specified, fallback to site image if not overriden at Page level
*/}}
{{ if and (.IsPage) (not .Params.images) (.Site.Params.images) }}
<meta property="og:image" content="{{ index .Site.Params.images 0 }}">
{{ end }}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ with .Site.Params.seo.telegram_channel }}
<meta name="telegram:channel" content="@{{ . }}">
{{ end }}

View File

@@ -0,0 +1,28 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $cssvar := "--trim-color:\\s*([^!;}]*).*" }}
{{ $hackbg := "pre{background-color:([^!;}]*).*" }}
{{ with index (findRE $cssvar . 1) 0 }}
<meta name="theme-color" content={{ strings.TrimRight " " (. | replaceRE $cssvar "$1") }}>
{{ else }}
{{ with index (findRE $hackbg . 1) 0 }}
<meta name="theme-color" content={{ . | replaceRE $hackbg "$1" }}>
{{ end }}
{{ end }}

View File

@@ -0,0 +1,31 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ with .Site.Params.seo.webmaster_verifications.google }}
<meta name="google-site-verification" content="{{ . }}">
{{ end }}
{{ with .Site.Params.seo.webmaster_verifications.bing }}
<meta name="msvalidate.01" content="{{ . }}">
{{ end }}
{{ with .Site.Params.seo.webmaster_verifications.alexa }}
<meta name="alexaVerifyID" content="{{ . }}">
{{ end }}
{{ with .Site.Params.seo.webmaster_verifications.yandex }}
<meta name="yandex-verification" content="{{ . }}">
{{ end }}

View File

@@ -0,0 +1,51 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $page_schema := .Params.schema }}
{{ $section_schema := (.Site.GetPage "section" .Page.Type).Params.schema }}
{{ $schema_type := (default $section_schema.type $page_schema.type) | default "Thing" }}
{{ $article_types := .Site.Data.schema.article_types }}
{{ $is_typeof_article := in $article_types $schema_type }}
<article itemprop="citation{{ if eq $schema_type "BlogPosting" }} blogPost{{ end }}" itemscope itemtype="https://schema.org/{{ $schema_type }}" id="{{ .Title | anchorize }}">
<header>
<h1 itemprop="{{ if $is_typeof_article }}headline{{ else }}name{{ end }}">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h1>
{{ if eq .Type "post" }}
<p class="muted">{{ partial "post/meta.html" . }}</p>
{{ end }}
{{ if .Description }}
<blockquote itemprop="headline">{{ .Description }}</blockquote>
{{ end }}
</header>
<div itemprop="{{ if $is_typeof_article }}articleBody mainEntityOfPage{{ end }}">
{{- .Summary -}}
</div>
<meta itemprop="inLanguage" content="{{ .Site.LanguageCode }}">
<meta itemprop="datePublished" content="{{ dateFormat "2006-01-02T15:04:05-07:00" (default .Date (.PublishDate)) }}">
<meta itemprop="dateModified" content="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" }}">
{{ with .Params.images }}
<meta itemprop="image" content="{{ index . 0 }}">
{{ end }}
</article>
{{ if .Truncated }}
<nav class="readmore">
<a itemprop="url" href="{{ .RelPermalink }}">Read More&nbsp;&raquo;</a>
</nav>
{{ end }}

View File

@@ -0,0 +1,43 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<ul class="thumbnail grid" itemscope itemtype="https://schema.org/ItemList">
<meta itemprop="itemListOrder" content="Unordered">
<meta itemprop="name" content="{{ .index.Title }}">
<meta itemprop="numberOfItems" content="{{ (default .page_count .limit) }}">
{{ $thumbnail_options := .thumbnail_options }}
{{ $show_readingtime := .show_readingtime }}
{{ range first (default .page_count .limit) .pages }}
{{ $page_schema := .Params.schema }}
{{ $section_schema := (.Site.GetPage "section" .Page.Type).Params.schema }}
{{ $schema_type := (default $section_schema.type $page_schema.type) | default "Thing" }}
<li class="cell" itemprop="itemListElement" itemscope itemtype="https://schema.org/{{ $schema_type }}">
<a itemprop="url" href="{{ .RelPermalink }}">
{{ partial "image/thumbnail.html" (dict "node" . "options" $thumbnail_options) }}
<h2 itemprop="name">{{ .Title }}</h2>
</a>
<small itemprop="description">
{{ .Description }}
{{ if $show_readingtime }}
<time class="muted" datetime="{{ .ReadingTime }}M">{{ .ReadingTime }} minutes</time>
{{ end }}
</small>
</li>
{{ end }}
</ul>

View File

@@ -0,0 +1,32 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<nav>
{{ if .Paginator.HasPrev }}
<a href="{{ .Paginator.Prev.URL }}">&laquo;&nbsp;Previous</a> |
{{ end }}
{{ if eq .Paginator.TotalPages 0 }}
<span>OMG the nostalgia! Runs so smoothly too. If only there were published content.</span>
{{ else }}
<span>Page {{ .Paginator.PageNumber }} of {{ .Paginator.TotalPages }}</span>
{{ end }}
{{ if .Paginator.HasNext }}
| <a href="{{ .Paginator.Next.URL }}">Next&nbsp;&raquo;</a>
{{ end }}
</nav>

View File

@@ -0,0 +1,39 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<p>
Published
{{ if ne .Site.Params.hide_author true }}
{{ with .Params.author }}
by <span itemprop="author">{{ index . }}</span>
{{ else }}
by <span itemprop="author">{{ .Site.Params.author }}</span>
{{ end }}
{{ end }}
<time itemprop="datePublished" datetime="{{ dateFormat "2006-01-02T15:04:05-07:00" (default .Date (.PublishDate)) }}">
{{ dateFormat "2 Jan, 2006" (default .Date (.PublishDate)) }}
</time>
{{ with .Params.categories }}
in <span itemprop="articleSection">{{ delimit (apply (apply (sort .) "partial" "post/category-link.html" ".") "chomp" ".") ", " " and " }}</span>
{{ end }}
{{ with .Params.tags }}
and tagged {{ delimit (apply (apply (sort .) "partial" "post/tag-link.html" ".") "chomp" ".") ", " " and " }}
{{ end }}
using <span itemprop="wordCount">{{ .WordCount }}</span> words.
</p>

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<a href="{{ "/" | relURL }}categories/{{ . | urlize }}/">{{ . }}</a>

View File

@@ -0,0 +1,34 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<svg style="margin-bottom:-3px" class="i-clock" viewBox="0 0 32 32" width="16" height="16" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.25%">
<circle cx="16" cy="16" r="14" />
<path d="M16 8 L16 16 20 20" />
</svg>
<span>{{ .ReadingTime }} minute read</span>
<svg style="margin-bottom: -3px" class="i-edit" viewBox="0 0 32 32" width="16" height="16" fill="none" stroke="currentcolor" stroke-linecap="round" stroke-linejoin="round" stroke-width="6.25%">
<path d="M30 7 L25 2 5 22 3 29 10 27 Z M21 6 L26 11 Z M5 22 L10 27 Z" />
</svg>
{{ if .PublishDate.IsZero }}
Published: <time datetime="{{ .Date.Format "2006-01-02T15:04:05-07:00" }}">{{ .Date.Format "2 Jan, 2006" }}</time>
{{ else if lt .PublishDate .Lastmod }}
Modified: <time datetime="{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" }}">{{ .Lastmod.Format "2 Jan, 2006" }}</time>
{{ else }}
Published: <time datetime="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" }}">{{ .PublishDate.Format "2 Jan, 2006" }}</time>
{{ end }}

View File

@@ -0,0 +1,44 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $limit := (index .Site.Params.layout .Type).related.limit | default .Site.Params.related_content_limit }}
{{ $pages := .Site.RegularPages.Related . | first (default 7 $limit) }}
{{ $page_count := len $pages }}
{{ if and (gt $page_count 1) (ne $limit 0) }}
{{ with $pages }}
<aside>
<header>Related Content</header>
{{ with (index $.Site.Params.layout $.Type).related }}
{{ if ne $.Site.Params.hackcss.disabled true }}
{{ with resources.Get "css/conditional/layouts/partials/page-thumbs.css" | minify }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
{{ end }}
{{ partial "page-thumbs.html" (dict "thumbnail_options" .thumbs "page_count" $page_count "limit" $limit "pages" $pages "show_readingtime" true) }}
{{ else }}
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a>
<time class="muted" datetime="{{ .ReadingTime }}M">{{ .ReadingTime }} minutes</time>
{{ end }}
</ul>
{{ end }}
</aside>
{{ end }}
{{ end }}

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<a rel="tag" href="{{ "/" | relURL }}tags/{{ . | urlize }}/">{{ . }}</a>

View File

@@ -0,0 +1,25 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ if and (isset .Params "toc") .Params.toc }}
<details>
<summary>Table of Contents</summary>
{{ .TableOfContents }}
</details>
{{ end }}

View File

@@ -0,0 +1,66 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
<header>
<h1 itemprop="name">{{ .Title }}</h1>
</header>
{{ $scratch := newScratch }}
{{ with (index .Site.Params.layout .Type).featured }}
{{ $scratch.Add "featured" slice }}
{{ range first .limit .items }}
{{ $scratch.Add "featured" (site.GetPage .) }}
{{ end }}
{{ if ge (len ($scratch.Get "featured")) 1 }}
{{ if ne $.Site.Params.hackcss.disabled true }}
{{ with resources.Get "css/conditional/layouts/partials/page-thumbs.css" | minify }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
{{ end }}
<section>
{{ $index := site.GetPage "section" $.Type }}
{{ $pages := $scratch.Get "featured" }}
{{ $page_count := default 1 (len $pages) }}
{{ if eq $page_count 1 }}
{{ partial "page-summary.html" $index }}
{{ else if gt $page_count 1 }}
<header>
<h1 itemprop="name">
<a href="{{ $index.RelPermalink }}">Featured {{ $index.Title }}</a>
</h1>
<blockquote itemprop="description">{{ $index.Description }}</blockquote>
</header>
{{ partial "page-thumbs.html" (dict "thumbnail_options" .thumbs "page_count" $page_count "limit" .limit "pages" $pages) }}
{{ end }}
</section>
{{ end }}
{{ end }}
{{ range (.Paginate (collections.SymDiff .Pages (default slice ($scratch.Get "featured")))).Pages }}
{{ partial "page-summary.html" . }}
{{ end }}
{{ end }}
{{ define "footer" }}
<p>{{ partial "pagination.html" . }}</p>
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}

View File

@@ -0,0 +1,56 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ define "header" }}
{{ partial "masthead.html" . }}
{{ end }}
{{ define "main" }}
{{ if ne $.Site.Params.hackcss.disabled true }}
{{ with resources.Get "css/conditional/layouts/post/single.css" | minify }}
<style>{{ .Content | safeCSS }}</style>
{{ end }}
{{ end }}
<article itemscope itemtype="https://schema.org/BlogPosting">
{{ template "_internal/schema.html" . }}
<header>
<h1 itemprop="headline name">{{ .Title }}</h1>
<p class="muted">
{{ partial "post/meta.html" . }}
</p>
{{ if .Description }}
<blockquote itemprop="description">{{ .Description }}</blockquote>
{{ end }}
{{ partial "image/header.html" . }}
</header>
{{ partial "toc-maybe.html" . }}
<div itemprop="articleBody">
{{ .Content }}
</div>
<footer>
<hr>
{{ partial "post/byline.html" . }}
{{ partial "post/related-content.html" . }}
</footer>
</article>
{{ end }}
{{ define "footer" }}
<small class="muted">
{{ partial "copyright-notice.html" . }}
</small>
{{ end }}

View File

@@ -0,0 +1,34 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $_hugo_config := `{ "version": 1 }` }}
{{ $body := .Get "text" | default .Inner }}
{{ $class := .Get "class" }}
{{ $citelink := .Get "citelink" }}
{{ $cite := .Get "cite" }}
<blockquote{{ with $class }} class="{{ . }}"{{ end }}{{ with $citelink }} cite="{{ . }}"{{ end }}>
<p>{{- $body | plainify -}}</p>
{{ if $citelink }}
<cite>{{ partial "components/external.html" (dict "href" $citelink "body" $cite) }}</cite>
{{ else if $cite }}
<cite>{{ $cite }}</cite>
{{ else }}
<cite>N.N.</cite>
{{ end }}
</blockquote>

View File

@@ -0,0 +1,40 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $_hugo_config := `{ "version": 1 }` }}
{{ $href := .Get "href" | default nil -}}
{{ $body := .Get "text" | default .Inner -}}
{{ $class := .Get "class" -}}
{{ $referrerpolicy := .Get "referrerpolicy" -}}
{{ $target := .Get "target" -}}
{{ $title := .Get "title" -}}
{{ $type := .Get "type" -}}
{{ $rel := .Get "rel" -}}
{{ $itemtype := .Get "itemtype" -}}
{{ $trusted := .Get "trusted" -}}
{{- if .IsNamedParams -}}
{{ partial "components/external.html" (dict "href" $href "body" $body "class" $class "referrerpolicy" $referrerpolicy "target" $target "type" $type "title" $title "rel" $rel "itemtype" $itemtype "trusted" $trusted "suppress_external" (and .Inner (eq (len (findRE "external" $rel)) 0))) }}
{{- else if gt (len .Params) 1 -}}
{{ partial "components/external.html" (dict "href" (.Get 0) "body" (.Get 1)) }}
{{- else -}}
{{ partial "components/external.html" (dict "href" (.Get 0)) }}
{{- end -}}
{{- if or (and .IsNamedParams (eq $href nil)) (and (eq .IsNamedParams false) (eq (.Get 0) nil)) }}
<p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid use of external shortcode. Please provide a URL.")) }}</p>
{{ end -}}

View File

@@ -0,0 +1,30 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $src := .Get "src" }}
{{ $lqipsrc := .Get "lqipsrc" }}
{{ $caption := .Get "caption" }}
{{ $link := .Get "link" }}
{{ $linktarget := .Get "linktarget" }}
{{ $attr := .Get "attr" }}
{{ $attrlink := .Get "attrlink" }}
{{ $alt := .Get "alt" }}
{{ $title := .Get "title" }}
{{ $class := .Get "class" }}
{{ partial "components/figure.html" (dict "src" $src "lqipsrc" $lqipsrc "caption" $caption "link" $link "linktarget" $linktarget "attr" $attr "attrlink" $attrlink "alt" $alt "title" $title "class" $class) }}

View File

@@ -0,0 +1,24 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $_hugo_config := `{ "version": 1 }` }}
{{ $type := .Get "type" }}
{{ $class := .Get "class" }}
{{ $body := .Get "text" | default .Inner }}
{{ partial "components/alert.html" (dict "type" $type "class" $class "body" $body) }}

View File

@@ -0,0 +1,35 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $type := .Get "type" }}
{{ $body := .Get "text" | default .Inner }}
{{ $isghost := .Get "isghost" }}
{{ $isblock := .Get "isblock" }}
{{ $id := .Get "id" }}
{{ $name := .Get "name" }}
{{ $class := .Get "class" }}
{{ $action := .Get "action" }}
{{ $form := .Get "form" }}
{{ $value := .Get "value" }}
{{ $onclick := .Get "onclick" }}
{{ $disabled := .Get "disabled" }}
{{ $tabindex := .Get "tabindex" }}
{{ $target := .Get "target" }}
{{ $method := .Get "method" }}
{{ partial "components/button.html" (dict "type" $type "body" $body "isghost" $isghost "isblock" $isblock "action" $action "form" $form "value" $value "onclick" $onclick "id" $id "name" $name "class" $class "disabled" $disabled "tabindex" $tabindex "target" $target "method" $method) }}

View File

@@ -0,0 +1,23 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $formactions := .Get "formactions" }}
{{ $class := .Get "class" }}
{{ $body := .Inner }}
{{ partial "components/buttongroup.html" (dict "formactions" $formactions "class" $class "body" $body) }}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/}}
{{ $header := .Get "header" }}
{{ $body := .Get "text" | default .Inner }}
{{ partial "components/card.html" (dict "header" $header "body" $body) }}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $class := .Get "class" }}
{{ $body := .Get "text" | default .Inner }}
{{- partial "components/cell.html" (dict "class" $class "body" $body) -}}

View File

@@ -0,0 +1,34 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $accept_charset := .Get "acceptcharset" }}
{{ $id := .Get "id" }}
{{ $name := .Get "name" }}
{{ $action := .Get "action" }}
{{ $enctype := .Get "enctype" }}
{{ $target := .Get "target" }}
{{ $novalidate := .Get "novalidate" }}
{{ $autocomplete := .Get "autocomplete" }}
{{ $method := .Get "method" }}
{{ $class := .Get "class" }}
{{ $body := .Inner }}
{{ partial "components/form.html" (dict "id" $id "name" $name "accept_charset" $accept_charset "action" $action "enctype" $enctype "target" $target "novalidate" $novalidate "method" $method "class" $class "body" $body) }}
{{ if eq "false" $autocomplete }}
<p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid autocomplete value for form. Did you mean \"off\" instead of %q?" $autocomplete)) }}</p>
{{ end }}

View File

@@ -0,0 +1,28 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $hastextarea := .Get "hastextarea" }}
{{ $state := .Get "state" }}
{{ $disabled := .Get "disabled" }}
{{ $form := .Get "form" }}
{{ $name := .Get "name" }}
{{ $class := .Get "class" }}
{{ $legend := .Get "legend" }}
{{ $body := .Get "body" | default .Inner }}
{{ partial "components/formgroup.html" (dict "hastextarea" $hastextarea "state" $state "class" $class "disabled" $disabled "form" $form "name" $name "legend" $legend "body" $body) }}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $class := .Get "class" }}
{{ $body := .Inner }}
{{- partial "components/grid.html" (dict "class" $class "body" $body) -}}

View File

@@ -0,0 +1,22 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $class := .Get "class" }}
{{ $body := .Get "text" | default .Inner }}
{{ partial "components/helpblock.html" (dict "class" $class "body" $body) }}

View File

@@ -0,0 +1,23 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $for := .Get "for" }}
{{ $form := .Get "form" }}
{{ $body := .Get "text" | default .Inner }}
{{ partial "components/label.html" (dict "for" $for "form" $form "body" $body) }}

View File

@@ -0,0 +1,23 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $show_percent := .Get "showpercent" }}
{{ $fill_text := .Get "filltext" | default "Loading" }}
{{ $value := .Get "value" }}
{{ partial "components/progress.html" (dict "show_percent" $show_percent "fill_text" $fill_text "value" $value) }}

View File

@@ -0,0 +1,26 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $id := .Get "id" }}
{{ $name := .Get "name" }}
{{ $class := .Get "class" }}
{{ $disabled := .Get "disabled" }}
{{ $form := .Get "form" }}
{{ $body := .Get "body" | default .Inner }}
{{ partial "components/select.html" (dict "id" $id "name" $name "class" $class "disabled" $disabled "body" $body) }}

View File

@@ -0,0 +1,44 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $id := .Get "id" | default nil }}
{{ $name := .Get "name" | default nil }}
{{ $class := .Get "class" | default nil }}
{{ $autocomplete := .Get "autocomplete" | default nil }}
{{ $autofocus := .Get "autofocus" | default nil }}
{{ $cols := .Get "cols" | default nil }}
{{ $disabled := .Get "disabled" | default nil }}
{{ $form := .Get "form" | default nil }}
{{ $maxlength := .Get "maxlength" | default nil }}
{{ $minlength := .Get "minlength" | default nil }}
{{ $placeholder := .Get "placeholder" | default nil }}
{{ $readonly := .Get "readonly" | default nil }}
{{ $required := .Get "required" | default nil }}
{{ $rows := .Get "rows" | default nil }}
{{ $spellcheck := .Get "spellcheck" | default nil }}
{{ $wrap := .Get "wrap" | default nil }}
{{ $tabindex := .Get "tabindex" | default nil }}
{{ $body := .Get "text" | default nil }}
{{ partial "components/textarea.html" (dict "body" $body "attrs" (dict "id" $id "name" $name "class" $class "autocomplete" $autocomplete "autofocus" $autofocus "cols" $cols "disabled" $disabled "form" $form "maxlength" $maxlength "minlength" $minlength "placeholder" $placeholder "readonly" $readonly "required" $required "rows" $rows "spellcheck" $spellcheck "wrap" $wrap "tabindex" $tabindex)) }}
{{ if eq "false" $autocomplete }}
<p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid autocomplete value for textarea. Did you mean \"off\" instead of %q?" $autocomplete)) }}</p>
{{ end }}
{{ if eq "false" $wrap }}
<p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid wrap value for textarea. Did you mean \"off\" instead of %q?" $wrap)) }}</p>
{{ end }}

View File

@@ -0,0 +1,50 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $id := .Get "id" | default nil }}
{{ $name := .Get "name" | default nil }}
{{ $class := .Get "class" | default nil }}
{{ $autocomplete := .Get "autocomplete" | default nil }}
{{ $autofocus := .Get "autofocus" | default nil }}
{{ $disabled := .Get "disabled" | default nil }}
{{ $form := .Get "form" | default nil }}
{{ $formaction := .Get "formaction" | default nil }}
{{ $formmethod := .Get "formmethod" | default nil }}
{{ $formtarget := .Get "formtarget" | default nil }}
{{ $height := .Get "height" | default nil }}
{{ $max := .Get "max" | default nil }}
{{ $maxlength := .Get "maxlength" | default nil }}
{{ $min := .Get "min" | default nil }}
{{ $minlength := .Get "minlength" | default nil }}
{{ $multiple := .Get "multiple" | default nil }}
{{ $pattern := .Get "pattern" | default nil }}
{{ $placeholder := .Get "placeholder" | default nil }}
{{ $readonly := .Get "readonly" | default nil }}
{{ $required := .Get "required" | default nil }}
{{ $size := .Get "size" | default nil }}
{{ $spellcheck := .Get "spellcheck" | default nil }}
{{ $step := .Get "step" | default nil }}
{{ $tabindex := .Get "tabindex" | default nil }}
{{ $type := .Get "type" | default nil }}
{{ $value := .Get "value" | default nil }}
{{ $width := .Get "width" | default nil }}
{{ partial "components/textinput.html" (dict "attrs" (dict "id" $id "name" $name "class" $class "autocomplete" $autocomplete "autofocus" $autofocus "disabled" $disabled "form" $form "formaction" $formaction "formmethod" $formmethod "formtarget" $formtarget "height" $height "max" $max "maxlength" $maxlength "min" $min "minlength" $minlength "multiple" $multiple "pattern" $pattern "placeholder" $placeholder "readonly" $readonly "required" $required "size" $size "spellcheck" $spellcheck "step" $step "tabindex" $tabindex "type" $type "value" $value "width" $width)) }}
{{ if eq "false" $autocomplete }}
<p>{{ partial "components/alert.html" (dict "type" "error" "body" (errorf "Invalid autocomplete value for textinput. Did you mean \"off\" instead of %q?" $autocomplete)) }}</p>
{{ end }}

View File

@@ -0,0 +1,20 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ partial "components/throbber.html" . }}

View File

@@ -0,0 +1,39 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
<!-- {{/*
Attributes: name [default: "main"]
Display main navigation menu:
{{< navmenu >}}
Display custom navigation menu:
{{< navmenu "sidebar" >}}
*/}} -->
{{ $name := .Get 0 | default "main" }}
{{ $entries := index .Site.Menus $name }}
{{ $page := .Page.Page }}
{{ with $.Site.Params.layout.menu }}
{{ $settings := index . $name | default dict }}
{{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" $settings "page" $page)}}
{{ else }}
{{ partial "components/navmenu.html" (dict "name" $name "entries" $entries "settings" dict "page" $page)}}
{{ end }}

View File

@@ -0,0 +1,34 @@
{{/*
Copyright (C) 2019 Josh Habdas <jhabdas@protonmail.com>
This file is part of After Dark.
After Dark is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
After Dark 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ -}}
{{ $class := .Get "class" }}
{{ $autoplay := .Get "autoplay" }}
{{ $controls := .Get "controls" }}
{{ $crossorigin := .Get "crossorigin" }}
{{ $height := .Get "height" }}
{{ $loop := .Get "loop" }}
{{ $muted := .Get "muted" }}
{{ $preload := .Get "preload" }}
{{ $intrinsicsize := .Get "intrinsicsize" }}
{{ $poster := .Get "poster" }}
{{ $src := .Get "src" }}
{{ $width := .Get "width" }}
{{ $playsinline := .Get "playsinline" }}
{{ partial "components/video.html" (dict "class" $class "autoplay" $autoplay "controls" $controls "crossorigin" $crossorigin "height" $height "loop" $loop "muted" $muted "preload" $preload "intrinsicsize" $intrinsicsize "poster" $poster "src" $src "width" $width "playsinline" $playsinline "node" .Page) }}