jlelse
/
Indieroad
Archived
1
Fork 0

Initial commit

This commit is contained in:
Jan-Lukas Else 2019-09-03 17:50:00 +02:00
commit 708b8f2898
34 changed files with 1347 additions and 0 deletions

24
LICENSE.md Normal file
View File

@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# Indieroad
This is the Hugo theme I developed for my blogs and websites. It originally derived from the [Mainroad theme](https://github.com/Vimux/Mainroad), but since then, no line of code is like it was before.
A lot of things are customized to [my own needs](https://jlelse.dev), but I wanted to open source the code, because it might be helpful to others to see how I implemented things.
This theme is released to the public domain, so you can do whatever you want with it. But of course it would be nice, if you give attributions and contribute improvements. Thanks!

7
archetypes/default.md Normal file
View File

@ -0,0 +1,7 @@
---
title: "Title"
date: {{ .Date }}
lastmod:
tags:
- Tag
---

6
archetypes/link.md Normal file
View File

@ -0,0 +1,6 @@
---
title: "Title"
date: {{ .Date }}
lastmod:
externalURL: "https://link.tld/"
---

1
assets/css/custom.scss Normal file
View File

@ -0,0 +1 @@
$mainColor: #1976d2;

828
assets/css/style.scss Normal file
View File

@ -0,0 +1,828 @@
@import 'custom.scss';
/* Themes */
$colors: (
body-background: #f7f7f7,
container-background: #fff,
contrast-text: #fff,
contrast-background: #263238,
headline: #000,
strong-text: #000,
light-background: #f5f5f5,
border: #ebebeb,
border-hover: #aaa,
meta: #666,
hr: #dadada,
body-background-dark: #263238,
container-background-dark:#000a12,
contrast-text-dark:#fff,
contrast-background-dark:#4f5b62,
headline-dark:#fff,
strong-text-dark:#000,
light-background-dark:#4f5b62,
border-dark:#ebebeb,
border-hover-dark:#aaa,
meta-dark:#666,
hr-dark:#dadada,
main-color: $mainColor
);
@mixin color($property, $varName) {
#{$property}: map-get($colors, $varName);
#{$property}: var(--#{$varName}, map-get($colors, $varName));
}
@mixin color-border($property, $val1, $val2, $varName) {
#{$property}: #{$val1} #{$val2} map-get($colors, $varName);
#{$property}: #{$val1} #{$val2} var(--#{$varName}, map-get($colors, $varName));
}
@mixin lightmode {
--body-background: #{map-get($colors, body-background)};
--container-background: #{map-get($colors, container-background)};
--contrast-text: #{map-get($colors, contrast-text)};
--contrast-background: #{map-get($colors, contrast-background)};
--headline: #{map-get($colors, headline)};
--strong-text: #{map-get($colors, strong-text)};
--light-background: #{map-get($colors, light-background)};
--border: #{map-get($colors, border)};
--border-hover: #{map-get($colors, border-hover)};
--meta: #{map-get($colors, meta)};
--hr: #{map-get($colors, hr)};
--main-color: #{map-get($colors, main-color)};
color: #000;
}
@mixin darkmode {
--body-background: #{map-get($colors, body-background-dark)};
--container-background: #{map-get($colors, container-background-dark)};
--contrast-text: #{map-get($colors, contrast-text-dark)};
--contrast-background: #{map-get($colors, contrast-background-dark)};
--headline: #{map-get($colors, headline-dark)};
--strong-text: #{map-get($colors, strong-text-dark)};
--light-background: #{map-get($colors, light-background-dark)};
--border: #{map-get($colors, border-dark)};
--border-hover: #{map-get($colors, border-hover-dark)};
--meta: #{map-get($colors, meta-dark)};
--hr: #{map-get($colors, hr-dark)};
--main-color: #{map-get($colors, main-color)};
color: #fff;
}
* {
@include lightmode;
@media (prefers-color-scheme: light) {
@include lightmode;
}
@media (prefers-color-scheme: dark) {
@include darkmode;
}
}
.dark, .dark * {
@include darkmode;
}
/* Structure */
$break1: 620px;
$break2: 767px;
$break3: 900px;
$break4: 1475px;
*,
*::before,
*::after {
box-sizing: border-box;
}
article,
aside,
dialog,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section {
display: block;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-size: 1rem;
line-height: 1.5;
word-wrap: break-word;
@include color(background, body-background);
}
.container {
position: relative;
width: 100%;
max-width: 1080px;
margin: 0 auto;
}
.body-container {
@extend .container;
margin: 25px auto;
@media screen and (max-width: $break4) {
width: 95%;
}
@media screen and (max-width: $break3) {
width: 100%;
margin: 0 auto;
}
}
.wrapper {
padding: 25px;
@include color(background, container-background);
@media screen and (max-width: $break3) {
padding: 20px;
}
@media screen and (max-width: $break2) {
display: block;
}
}
.flex {
display: flex;
}
.primary {
flex: 1 0 65.83%;
order: 1;
min-width: 0;
}
.clearfix {
display: block;
&::after {
display: block;
height: 0;
padding: 0;
margin: 0;
clear: both;
line-height: 0;
visibility: hidden;
content: "";
}
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
/* Button */
.btn {
padding: 5px 10px;
font-weight: 700;
white-space: pre-line;
@include color(color, contrast-text);
@include color(background, contrast-background);
&:hover {
@include color(color, contrast-text);
@include color(background, main-color);
}
}
/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0 0 20px;
font-weight: 700;
line-height: 1.3;
@include color(color, headline);
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.25rem;
}
h4 {
font-size: 1.125rem;
}
h5,
h6 {
font-size: 1rem;
}
a {
text-decoration: none;
&:hover {
@include color(color, main-color);
}
}
hr {
margin: 0 0 20px;
border: 0;
@include color-border(border-top, 1px, solid, hr);
}
p {
margin: 0 0 20px;
}
b,
strong {
font: inherit;
font-weight: 700;
}
i,
em {
font: inherit;
font-style: italic;
}
ol,
ul {
padding: 0;
margin: 0;
}
small {
font-size: .75rem;
}
figure {
margin: 0 0 20px;
}
figcaption {
margin-top: 4px;
@include color(color, meta);
h4 {
margin: 0;
color: inherit;
}
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: inherit;
}
pre,
code {
@include color(background, light-background);
@include color-border(border, 1px, solid, border);
}
code {
padding: 0 5px;
white-space: nowrap;
}
pre {
display: block;
padding: 20px;
margin-bottom: 20px;
@include color(color, strong-text);
white-space: pre-wrap;
code {
padding: 0;
color: inherit;
white-space: inherit;
background: inherit;
border: 0;
}
}
blockquote {
display: block;
padding: 5px 0 5px 15px;
margin: 0 0 20px;
line-height: 1.6;
@include color-border(border-left, 5px, solid, main-color);
p:last-child {
margin: 0;
}
footer {
text-align: right;
}
}
sup,
sub {
font-size: .625rem;
font-style: normal;
}
sup {
vertical-align: super;
}
sub {
vertical-align: sub;
}
abbr[title] {
text-decoration: none;
cursor: help;
border-bottom: 1px dotted;
}
q {
font-style: italic;
}
dl {
margin: 0 0 10px 20px;
}
dt,
dd {
display: list-item;
}
dt {
font-weight: bold;
list-style-type: square;
}
dd {
margin-left: 20px;
list-style-type: circle;
}
select {
max-width: 100%;
}
.warning {
padding: 20px 10px;
text-align: center;
}
/* Header */
.header {
@include color(background, container-background);
.logo {
padding: 25px;
@media screen and (max-width: $break3) {
padding: 20px;
}
@media screen and (max-width: $break2) {
text-align: center;
}
.link {
display: inline-block;
line-height: 1;
font-weight: 700;
.title {
font-size: 2rem;
@include color(color, headline);
}
.tagline {
padding-top: 10px;
margin-top: 10px;
font-size: .875rem;
@include color(color, main-color);
@include color-border(border-top, 1px, solid, border);
}
}
}
}
/* Main menu */
.menu {
.expand {
display: block;
width: 100%;
@include color(background, contrast-background);
border: 0;
cursor: pointer;
@media screen and (min-width: $break2) {
display: none;
}
.title {
font-size: .9375rem;
@include color(color, contrast-text);
display: block;
padding: 10px 15px;
font-weight: 700;
text-align: right;
text-transform: uppercase;
}
}
#menu-toggle {
display: none;
}
#menu-list {
list-style: none;
@include color(background, contrast-background);
position: absolute;
width: 100%;
visibility: hidden;
transform: scaleY(0);
transform-origin: top;
@media screen and (min-width: $break2) {
position: relative;
display: flex;
flex-wrap: wrap;
visibility: visible;
transform: none;
}
.item {
.link {
display: block;
padding: 10px 15px;
font-weight: 700;
font-size: .9375rem;
@include color(color, contrast-text);
text-transform: uppercase;
&:hover {
@include color(color, contrast-text);
@include color(background, main-color);
}
}
}
}
#menu-toggle:checked + #menu-list {
visibility: visible;
transform: scaleY(1);
}
}
.divider {
height: 5px;
margin: 0;
@include color(background, main-color);
border: 0;
}
/* Posts/Pages */
.main-header {
margin-bottom: 20px;
.main-title {
font-size: 1.75rem;
}
.post-title {
margin: 0;
}
.post-meta {
@extend .meta;
padding: 5px 0;
margin-top: 10px;
@include color-border(border-top, 1px, dotted, border);
@include color-border(border-bottom, 1px, dotted, border);
}
}
.main-content {
@extend .content;
@extend .clearfix;
margin-bottom: 20px;
}
.meta {
font-size: .8125rem;
vertical-align: baseline;
@include color(color, meta);
.item {
display: inline;
margin-left: 15px;
@media screen and (max-width: $break1) {
display: block;
margin-left: 0;
}
&:first-child {
margin-left: 0;
}
.text {
vertical-align: middle;
}
}
}
.content {
a {
font-weight: 700;
&:hover {
@include color(color, main-color);
text-decoration: underline;
}
}
ul {
list-style: square;
}
ol {
list-style: decimal;
}
ul, ol {
margin: 0 0 20px 40px;
@media screen and (max-width: $break1) {
margin: 0 0 20px 20px;
}
}
ul ul, ol ol, ol ul, ul ol {
margin: 0 0 0 40px;
@media screen and (max-width: $break1) {
margin: 0 0 0 20px;
}
}
li {
margin-bottom: 5px;
}
}
.tags {
@extend .clearfix;
margin-bottom: 20px;
font-size: .75rem;
line-height: 1;
@include color(color, contrast-text);
.tags-list {
list-style: none;
.tag-item {
float: left;
margin: 0 6px 6px 0;
text-transform: uppercase;
@include color(background, contrast-background);
&:hover {
@include color(background, main-color);
}
.tag-link {
@extend .btn;
display: block;
padding: 10px 15px;
}
}
}
}
/* Authorbox */
.authorbox {
padding: 25px 0;
margin-bottom: 25px;
line-height: 1.5;
@include color-border(border-top, 1px, solid, border);
@include color-border(border-bottom, 1px, solid, border);
display: block;
@media screen and (max-width: $break1) {
text-align: center;
}
.author-header {
margin-bottom: 10px;
}
.author-name {
font-size: 1rem;
font-weight: 700;
}
}
/* Webmentionform */
.wm-form {
margin-bottom: 25px;
line-height: 1.5;
display: block;
#wm-source {
width: 100%;
margin-bottom: 10px;
}
.description {
margin-bottom: 10px;
}
}
/* List content */
.list {
.list-item {
padding-bottom: 20px;
margin-bottom: 20px;
@include color-border(border-bottom, 1px, solid, border);
.list-header {
margin-bottom: 10px;
.list-title {
margin: 0;
&:hover {
@include color(color, main-color);
}
}
.list-meta {
@extend .meta;
margin-top: 5px;
}
}
.list-excerpt {
@extend .content;
@extend .clearfix;
}
.list-footer {
@extend .clearfix;
.read-more {
@extend .btn;
float: right;
margin-top: 10px;
}
}
}
}
/* Pagination */
.pagination {
margin-top: 20px;
.item {
display: inline-block;
padding: 10px 15px;
font-weight: 700;
@include color(color, strong-text);
@include color(background, light-background);
&:hover, &--current {
@include color(color, contrast-text);
@include color(background, main-color);
}
}
}
/* Post Navigation */
.post-nav {
justify-content: space-between;
padding-top: 25px;
padding-bottom: 25px;
margin-bottom: 25px;
@include color-border(border-bottom, 1px, solid, border);
display: flex;
@media screen and (max-width: $break1) {
display: block;
}
.item {
flex: 1 1 50%;
max-width: 48%;
@media screen and (max-width: $break1) {
max-width: 100%;
}
&--prev {
margin-right: auto;
text-align: left;
@media screen and (max-width: $break1) {
padding-bottom: 25px;
min-width: 100%;
text-align: center;
}
}
&--next {
margin-left: auto;
text-align: right;
@media screen and (max-width: $break1) {
min-width: 100%;
text-align: center;
}
}
.link {
display: block;
.post-title {
margin-bottom: 0;
overflow: hidden;
font-size: .8125rem;
}
.caption {
display: block;
margin-bottom: 5px;
font-weight: 700;
line-height: 1;
text-transform: uppercase;
}
}
}
}
/* Images / Video */
img {
max-width: 100%;
height: auto;
vertical-align: bottom;
}
iframe,
embed,
object,
video {
max-width: 100%;
}
/* Table */
table {
width: 100%;
margin-bottom: 20px;
border-spacing: 0;
border-collapse: collapse;
@include color-border(border-top, 1px, solid, border);
@include color-border(border-left, 1px, solid, border);
}
td,
th {
padding: 5px 10px;
@include color-border(border-right, 1px, solid, border);
@include color-border(border-bottom, 1px, solid, border);
}
th {
font-weight: 700;
}
/* Forms */
input {
padding: 5px;
vertical-align: middle;
@include color(background, light-background);
@include color-border(border, 1px, solid, border);
&[type=text], &[type=email], &[type=tel], &[type=url] {
width: 100%;
}
&[type=submit], &[type=reset] {
@extend .btn;
min-width: 100px;
border: 0;
text-transform: uppercase;
cursor: pointer;
}
}
textarea {
width: 100%;
padding: 5px;
overflow: auto;
line-height: 1.5;
resize: vertical;
@include color(background, light-background);
@include color-border(border, 1px, solid, border);
}
/* Footer */
.footer {
padding: 10px 25px;
font-size: .75rem;
@include color(background, contrast-background);
*, *:hover {
@include color(color, contrast-text);
}
.container {
@extend .flex;
flex-flow: row wrap;
justify-content: space-between;
@media screen and (max-width: $break3) {
display: block;
}
}
.copyright {
order: 1;
@media screen and (max-width: $break3) {
padding-bottom: 8px;
text-align: center;
}
}
.toggle {
order: 2;
&:hover {
cursor: pointer;
}
@media screen and (max-width: $break3) {
padding-bottom: 8px;
text-align: center;
}
.no-js & {
display: none;
}
}
.links {
order: 3;
a:hover {
cursor: pointer;
}
@media screen and (max-width: $break3) {
padding-bottom: 8px;
text-align: center;
}
}
}

28
assets/js/theme.js Normal file
View File

@ -0,0 +1,28 @@
'use strict';
function toggleTheme(){
if (localStorage && localStorage.getItem("theme") === "dark"){
localStorage.setItem("theme", "default");
} else if (localStorage){
localStorage.setItem("theme", "dark");
}
checkTheme();
}
function checkTheme(){
if (localStorage && localStorage.getItem("theme") === "dark"){
document.body.className = "body dark";
} else if (localStorage){
document.body.className = "body";
}
}
function checkToggleAllowed(){
if(window.matchMedia("(prefers-color-scheme: dark)").matches || window.matchMedia("(prefers-color-scheme: light)").matches){
document.getElementById("theme-toggle").remove();
} else {
checkTheme();
}
}
checkToggleAllowed();

4
config.yaml Normal file
View File

@ -0,0 +1,4 @@
module:
hugoVersion:
extended: true
min: "0.57.2"

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module codeberg.org/jlelse/Indieroad
go 1.12

42
i18n/de.yaml Normal file
View File

@ -0,0 +1,42 @@
# General
- id: read_more
translation: Weiterlesen
- id: permalink
translation: Permalink
- id: menu_label
translation: Menü
# Post meta
- id: meta_lastmod
translation: Zuletzt geändert
# Post nav
- id: post_nav_prev
translation: Zurück
- id: post_nav_next
translation: Weiter
# Authorbox
- id: authorbox_name
translation: Über
# 404
- id: 404_title
translation: Seite nicht gefunden
- id: 404_text
translation: "Die gesuchte Seite existiert nicht, wurde verschoben oder gelöscht."
# Toggle theme
- id: toggle_theme
translation: Theme umschalten
# Webmention Form
- id: wmform_label
translation: "Hast du eine Antwort hierzu veröffentlicht? Lass mich den Link wissen:"
- id: wmform_btn
translation: "Senden"

42
i18n/en.yaml Normal file
View File

@ -0,0 +1,42 @@
# General
- id: read_more
translation: Read more
- id: permalink
translation: Permalink
- id: menu_label
translation: Menu
# Post meta
- id: meta_lastmod
translation: Last Modified
# Post nav
- id: post_nav_prev
translation: Previous
- id: post_nav_next
translation: Next
# Authorbox
- id: authorbox_name
translation: About
# 404
- id: 404_title
translation: Page not found
- id: 404_text
translation: "The page you were looking for appears to have been moved, deleted or does not exist."
# Toggle theme
- id: toggle_theme
translation: Toggle theme
# Webmention Form
- id: wmform_label
translation: "Have you published a response to this? Let me know the link:"
- id: wmform_btn
translation: "Send"

8
layouts/404.html Normal file
View File

@ -0,0 +1,8 @@
{{ define "main" }}
<main class="main">
<div class="warning">
<h1>{{ T "404_title" }}</h1>
<p>{{ T "404_text" }}</p>
</div>
</main>
{{ end }}

View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html class="no-js" lang="{{ .Site.LanguageCode | default "en-us" }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ block "title" . }}{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}{{ end }}</title>
<script>(function(d,e){d[e]=d[e].replace("no-js","js");})(document.documentElement,"className");</script>
<meta name="theme-color" content="{{ .Param "colors.main" | default "#0275D8" }}">
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{else}}{{ .Params.Description }}{{end}}">
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}
<style>
{{ with resources.Get "css/style.scss" | resources.ToCSS | minify }}{{ .Content | safeCSS }}{{ end }}
</style>
<link rel="shortcut icon" href="{{ .Site.Params.favicon }}">
{{ range .AlternativeOutputFormats }}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
{{ end }}
{{ if .Param "original" }}
<link rel="canonical" href="{{ .Param "original" }}">
{{ else }}
<link rel="canonical" href="{{ .Permalink }}">
{{ end }}
{{- if .Param "indieweb.enabled" }}
{{- with .Param "indieweb.endpoints.webmention" }}
<link rel="webmention" href="{{ . }}" />
{{- end }}
{{- with .Param "indieweb.endpoints.pingback" }}
<link rel="pingback" href="{{ . }}" />
{{- end }}
{{- end }}
{{ partial "customhead" . }}
</head>
<body class="body">
<div class="body-container">
{{ partial "header" . }}
<div class="wrapper flex">
<div class="primary">
{{ block "main" . }}
{{ with .Content }}
<div class="main-content">
{{ . }}
</div>
{{ end }}
{{ end }}
</div>
</div>
{{ partial "footer" . }}
</div>
{{ with resources.Get "js/theme.js" | minify }}<script>{{ .Content | safeJS }}</script>{{ end }}
{{ partial "custombodyend" . }}
</body>
</html>

View File

@ -0,0 +1,18 @@
{{ define "main" }}
<main class="main list">
{{- with .Title }}
<header class="main-header">
<h1 class="main-title">{{ . }}</h1>
</header>
{{- end }}
{{- with .Content }}
<div class="main-content">
{{ . }}
</div>
{{- end }}
{{- range .Paginator.Pages }}
{{- .Render "summary" }}
{{- end }}
</main>
{{ partial "pagination.html" . }}
{{ end }}

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

@ -0,0 +1,30 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} 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>
{{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
{{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range $pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

View File

@ -0,0 +1,22 @@
{{ define "main" }}
<main class="main">
<article class="h-entry post">
<header class="main-header">
<h1 class="p-name post-title">{{ .Title }}</h1>
{{ with partial "post_meta.html" . -}}
<div class="post-meta">{{ . }}</div>
{{- end }}
</header>
<div class="e-content content clearfix">
{{ with .Params.audio }}
<p><audio controls preload="metadata" style="width: 100%;"><source src="{{ . }}"/></audio></p>
{{ end }}
{{ .Content }}
</div>
{{ partial "post_tags.html" . }}
</article>
</main>
{{ partial "webmentionform" . }}
{{ partial "authorbox.html" . }}
{{ partial "post_nav.html" . }}
{{ end }}

View File

@ -0,0 +1,22 @@
{{ printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{ range .Site.RegularPages }}{{ if not .Params.robotsdisallow }}
<url>
<loc>{{ .Permalink }}</loc>{{ if not .Lastmod.IsZero }}
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>{{ end }}{{ with .Sitemap.ChangeFreq }}
<changefreq>{{ . }}</changefreq>{{ end }}{{ if ge .Sitemap.Priority 0.0 }}
<priority>{{ .Sitemap.Priority }}</priority>{{ end }}{{ if .IsTranslated }}{{ range .Translations }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
<xhtml:link
rel="alternate"
hreflang="{{ .Language.Lang }}"
href="{{ .Permalink }}"
/>{{ end }}
</url>
{{ end }}{{ end }}
</urlset>

View File

@ -0,0 +1,20 @@
<article class="list-item h-entry">
<a class="u-url" href="{{ .RelPermalink }}">
<div class="list-header">
<h2 class="list-title p-name">{{ .Title }}</h2>
{{ with partial "post_meta.html" . -}}
<div class="list-meta">{{ . }}</div>
{{- end }}
</div>
<div class="list-excerpt p-summary">
{{ .Summary }}
</div>
{{- if .Site.Params.readmore }}
{{- if .Truncated }}
<div class="list-footer">
<div class="read-more">{{ T "read_more" }}</div>
</div>
{{- end }}
{{- end }}
</a>
</article>

15
layouts/index.html Normal file
View File

@ -0,0 +1,15 @@
{{ define "main" }}
<main class="main list">
{{- with .Content }}
<div class="main-content">
{{ . }}
</div>
{{- end }}
{{- $postSections := ($.Param "postSections" | default (slice "posts")) }}
{{- $paginator := .Paginate ( where .Site.RegularPages "Section" "in" $postSections ) }}
{{- range $paginator.Pages }}
{{- .Render "summary" }}
{{- end }}
</main>
{{ partial "pagination.html" . }}
{{ end }}

20
layouts/links/single.html Normal file
View File

@ -0,0 +1,20 @@
{{ define "main" }}
<main class="main">
<article class="h-entry post">
<header class="main-header">
<h1 class="p-name post-title">{{ .Title }}</h1>
{{ with partial "post_meta.html" . -}}
<div class="post-meta">{{ . }}</div>
{{- end }}
</header>
<div class="e-content content clearfix">
{{ .Content }}
<p>{{ .Params.externalUrl | markdownify }}</p>
</div>
{{ partial "post_tags.html" . }}
</article>
</main>
{{ partial "webmentionform" . }}
{{ partial "authorbox.html" . }}
{{ partial "post_nav.html" . }}
{{ end }}

View File

@ -0,0 +1,18 @@
<article class="list-item h-entry">
<a href="{{ .Params.externalURL }}">
<div class="list-header">
<h2 class="list-title p-name">{{ .Title }}</h2>
{{ with partial "post_meta.html" . -}}
<div class="list-meta">{{ . }}</div>
{{- end }}
</div>
</a>
<div class="list-excerpt e-content">
{{ .Content }}
</div>
<div class="list-footer">
<a class="u-url" href="{{ .RelPermalink }}">
<div class="read-more">{{ T "permalink" }}</div>
</a>
</div>
</article>

View File

@ -0,0 +1,16 @@
{{- if .Param "authorbox" }}
{{- with .Site.Author }}
<div class="authorbox p-author h-card">
{{- if .name }}
<div class="author-header">
<span class="author-name">{{ T "authorbox_name" }} {{ if .link }}<a href="{{ .link }}" class="p-name u-url" rel="me">{{ .name }}</a>{{ else }}<span class="p-name">{{ .name }}</span>{{ end }}</span>
</div>
{{- end }}
{{- with .bio }}
<div class="p-note">
{{ . }}
</div>
{{- end }}
</div>
{{- end }}
{{- end }}

View File

View File

View File

@ -0,0 +1,17 @@
<footer class="footer">
<div class="container">
{{ with .Site.Menus.footer -}}
<div class="links">
{{ range $key, $value := . }}
<a href="{{ $value.URL }}">{{ $value.Name }}</a>
{{- end }}
</div>
{{- end }}
<div class="toggle" id="theme-toggle">
<a onclick="toggleTheme();">{{ T "toggle_theme" }}</a>
</div>
<div class="copyright">
&copy; {{ now.Format "2006" }} {{ .Site.Params.copyright | default .Site.Title }}
</div>
</div>
</footer>

View File

@ -0,0 +1,9 @@
<header class="header container">
<div class="logo">
<a class="link" href="{{ "" | relLangURL }}" title="{{ .Site.Title }}" rel="home">
<div class="title">{{ .Site.Title }}</div>
{{ with .Site.Params.subtitle }}<div class="tagline">{{ . }}</div>{{ end }}
</a>
</div>
{{ partial "menu.html" . }}
</header>

View File

@ -0,0 +1,20 @@
{{- if .Site.Menus.main }}
<nav class="menu">
<label for="menu-toggle" class="expand">
<span class="title">{{ T "menu_label" }}</span>
</label>
<input type="checkbox" id="menu-toggle"/>
<ul id="menu-list">
{{- $currentNode := . }}
{{- range sort .Site.Menus.main }}
{{- if .Name}}
<li class="item">
<a class="link" href="{{ .URL }}">{{ .Name }}</a>
</li>
{{- end }}
{{- end }}
</ul>
</nav>
{{- else -}}
<div class="divider"></div>
{{- end }}

View File

@ -0,0 +1,11 @@
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
<div class="pagination">
{{- with .Paginator.Prev }}
<a class="item btn" href="{{ .URL }}">{{ .PageNumber }}</a>
{{- end }}
<span class="item item--current">{{ .Paginator.PageNumber }}/{{ .Paginator.TotalPages }}</span>
{{- with .Paginator.Next }}
<a class="item btn" href="{{ .URL }}">{{ .PageNumber }}</a>
{{- end }}
</div>
{{ end }}

View File

@ -0,0 +1,10 @@
{{- if not .Params.nometa }}
{{- if not .Date.IsZero }}
<div class="item">
<time class="dt-published text" datetime="{{.Date.Format "2006-01-02 15:04"}}">{{.Date.Format ( .Site.Params.dateformat | default "January 02, 2006")}}</time>
{{- if ne .Date .Lastmod }}
<time class="dt-updated text" datetime="{{.Lastmod.Format "2006-01-02 15:04"}}"> ({{ T "meta_lastmod" }}: {{.Lastmod.Format ( .Site.Params.dateformat | default "January 02, 2006")}})</time>
{{- end }}
</div>
{{ end -}}
{{ end -}}

View File

@ -0,0 +1,16 @@
{{- if .Site.Params.post_navigation }}
{{- if or (.PrevInSection) (.NextInSection) }}
<nav class="post-nav">
{{- if .PrevInSection }}
<div class="item item--prev">
<a class="link" href="{{.PrevInSection.RelPermalink}}" rel="prev"><span class="caption">{{ T "post_nav_prev" }}</span><p class="post-title">{{.PrevInSection.Title}}</p></a>
</div>
{{- end }}
{{- if .NextInSection }}
<div class="item item--next">
<a class="link" href="{{.NextInSection.RelPermalink}}" rel="next"><span class="caption">{{ T "post_nav_next" }}</span><p class="post-title">{{.NextInSection.Title}}</p></a>
</div>
{{- end }}
</nav>
{{- end }}
{{- end }}

View File

@ -0,0 +1,9 @@
{{- if .Params.tags }}
<div class="tags">
<ul class="tags-list">
{{- range .Params.tags }}
<li class="tag-item"><a class="tag-link p-category" href="{{ "tags/" | relLangURL }}{{ . | urlize }}/" rel="tag">{{ . }}</a></li>
{{- end }}
</ul>
</div>
{{- end }}

View File

@ -0,0 +1,14 @@
{{- if .Param "indieweb.enabled" }}
{{- if not (.Param "indieweb.hidewmform") }}
{{- if .Param "indieweb.endpoints.webmention" }}
<div class="wm-form">
<form method="post" action="{{ .Param "indieweb.endpoints.webmention" }}">
<p class="description"><label for="wm-source">{{ T "wmform_label" }}</label></p>
<input type="url" name="source" id="wm-source">
<input type="hidden" name="target" value="{{ .Permalink }}">
<input class="btn" type="submit" value="{{ T "wmform_btn" }}">
</form>
</div>
{{- end }}
{{- end }}
{{- end }}

4
layouts/robots.txt Normal file
View File

@ -0,0 +1,4 @@
User-agent: *
{{- range where .Site.RegularPages "Params.robotsdisallow" true }}
Disallow: {{ .RelPermalink }}{{end}}
Sitemap: {{ "sitemap.xml" | absLangURL }}

View File

@ -0,0 +1 @@
<div style="overflow-x:auto;">{{ .Inner | markdownify }}</div>