about summary refs log tree commit diff stats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/404.html8
-rw-r--r--templates/atom.xml48
-rw-r--r--templates/base.html29
-rw-r--r--templates/favicon.html3
-rw-r--r--templates/feed-styles.html79
-rw-r--r--templates/footer.html6
-rw-r--r--templates/header.html8
-rw-r--r--templates/index.html38
-rw-r--r--templates/nav.html10
-rw-r--r--templates/page.html31
-rw-r--r--templates/section.html38
-rw-r--r--templates/security_tags.html2
-rw-r--r--templates/seo_tags.html2
-rw-r--r--templates/style.css.html169
-rw-r--r--templates/taxonomy_list.html14
-rw-r--r--templates/taxonomy_single.html30
16 files changed, 163 insertions, 352 deletions
diff --git a/templates/404.html b/templates/404.html
deleted file mode 100644
index 15fd75c..0000000
--- a/templates/404.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}404{% endblock %}
-
-{% block main %}
-  <h1>404</h1>
-  <h2>ʕノ•ᴥ•ʔノ ︵ ┻━┻</h2>
-{% endblock %}
diff --git a/templates/atom.xml b/templates/atom.xml
new file mode 100644
index 0000000..3fd5dee
--- /dev/null
+++ b/templates/atom.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="/feed-styles/" type="text/xsl"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
+    <title>{{ config.title }}
+    {%- if term %} - {{ term.name }}
+    {%- elif section.title %} - {{ section.title }}
+    {%- endif -%}
+    </title>
+    {%- if config.description %}
+    <subtitle>{{ config.description }}</subtitle>
+    {%- endif %}
+    <link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
+    <link href="
+      {%- if section -%}
+        {{ section.permalink | escape_xml | safe }}
+      {%- else -%}
+        {{ config.base_url | escape_xml | safe }}
+      {%- endif -%}
+    "/>
+    <generator uri="https://www.getzola.org/">Zola</generator>
+    <updated>{{ last_updated | date(format="%+") }}</updated>
+    <id>{{ feed_url | safe }}</id>
+    {%- for page in pages %}
+    <entry xml:lang="{{ page.lang }}">
+        <title>{{ page.title }}</title>
+        <published>{{ page.date | date(format="%+") }}</published>
+        <updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
+        <author>
+          <name>
+            {%- if page.authors -%}
+              {{ page.authors[0] }}
+            {%- elif config.author -%}
+              {{ config.author }}
+            {%- else -%}
+              Unknown
+            {%- endif -%}
+          </name>
+        </author>
+        <link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/>
+        <id>{{ page.permalink | safe }}</id>
+        {% if page.summary %}
+        <summary type="html">{{ page.summary }}</summary>
+        {% else %}
+        <content type="html">{{ page.content }}</content>
+        {% endif %}
+    </entry>
+    {%- endfor %}
+</feed>
diff --git a/templates/base.html b/templates/base.html
deleted file mode 100644
index ee206b3..0000000
--- a/templates/base.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html lang="{{ lang | default(value="en-US" ) }}">
-<head>
-  {%- if config.webserver_sends_csp_headers %}
-  {%- include "security_tags.html" ignore missing %}
-  {%- endif %}
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  {% include "favicon.html" ignore missing -%}
-  <title>{%- block title %}{{ config.title }}{%- endblock %}</title>
-  {% include "seo_tags.html" ignore missing %}
-  <meta name="referrer" content="no-referrer-when-downgrade">
-  {%- if config.generate_feed %}
-  {% block rss -%}
-  <link rel="alternate" type={% if config.feed_filename == "atom.xml" %}"application/atom+xml"{% else %}"application/rss+xml"{% endif %} title="{{ config.title }}" href="{{ get_url(path=config.feed_filename) | safe }}">
-  {%- endblock -%}
-  {%- endif %}
-  <style>
-  {%- include "style.css.html" ignore missing -%}
-  </style>
-  {% include "custom_head.html" ignore missing -%}
-</head>
-<body>
-  {% include "header.html" ignore missing -%}
-  {% block main %}{%- endblock -%}
-  {% include "footer.html" ignore missing -%}
-  {% include "custom_body.html" ignore missing -%}
-</body>
-</html>
diff --git a/templates/favicon.html b/templates/favicon.html
deleted file mode 100644
index 28b504d..0000000
--- a/templates/favicon.html
+++ /dev/null
@@ -1,3 +0,0 @@
-{% if config.extra.favicon %}
-  <link rel="shortcut icon" href="{{ config.extra.favicon }}">
-{%- endif -%}
diff --git a/templates/feed-styles.html b/templates/feed-styles.html
new file mode 100644
index 0000000..66dac33
--- /dev/null
+++ b/templates/feed-styles.html
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:atom="http://www.w3.org/2005/Atom">
+  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
+  <xsl:template match="/">
+    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+      <head>
+        <title>
+          RSS Feed |
+          <xsl:value-of select="/atom:feed/atom:title"/>
+        </title>
+        <meta charset="utf-8"/>
+        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+        <meta name="viewport" content="width=device-width, initial-scale=1"/>
+        <style>
+        {% include "style.html" ignore missing -%}
+        </style>
+      </head>
+      <body>
+        <main>
+          <div class="helptext">
+            <strong>This is an RSS feed</strong>. Subscribe by copying
+            the URL from the address bar into your newsreader. Visit
+            <a href="https://aboutfeeds.com">About Feeds</a>
+            to learn more and get started. It's free.
+          </div>
+          <div>
+            <h1>
+              <!-- https://commons.wikimedia.org/wiki/File:Feed-icon.svg -->
+              <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
+                   style="width: 1.5ex; height: 1.5ex"
+                   viewBox="0 0 256 256">
+                <rect width="256" height="256" x="0" y="0" fill="#7F7F7F"/>
+                <rect width="246" height="246" x="5" y="5" fill="#A0A0A0"/>
+                <rect width="236" height="236" x="10" y="10" fill="#A6A6A6"/>
+                <circle cx="68" cy="189" r="24" fill="#FFF"/>
+                <path
+                  d="M160 213h-34a82 82 0 0 0 -82 -82v-34a116 116 0 0 1 116 116z"
+                  fill="#FFF"/>
+                <path
+                  d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z"
+                  fill="#FFF"/>
+              </svg>
+              RSS Feed Preview |
+              <span>
+                <xsl:value-of select="/atom:feed/atom:title"/>
+              </span>
+            </h1>
+            <nav>
+              <a>
+                <xsl:attribute name="href">
+                  <xsl:value-of select="/atom:feed/atom:link[2]/@href"/>
+                </xsl:attribute>
+                Visit Website
+              </a>
+            </nav>
+            <ul class="blog-posts">
+              <xsl:for-each select="/atom:feed/atom:entry">
+                <li>
+                  <span>
+                    <xsl:value-of select="substring(atom:updated, 0, 11)" />
+                  </span>
+                  <div>
+                    <a>
+                      <xsl:attribute name="href">
+                        <xsl:value-of select="atom:link/@href"/>
+                      </xsl:attribute>
+                      <xsl:value-of select="atom:title"/>
+                    </a>
+                  </div>
+                </li>
+              </xsl:for-each>
+            </ul>
+          </div>
+        </main>
+      </body>
+    </html>
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/templates/footer.html b/templates/footer.html
index c952a93..422c90c 100644
--- a/templates/footer.html
+++ b/templates/footer.html
@@ -1,5 +1 @@
-<footer>
-  {%- if not config.extra.hide_made_with_line %}
-    Made with <a href="https://codeberg.org/alanpearce/zola-bearblog">Zola ʕ•ᴥ•ʔ Bear</a>
-  {%- endif %}
-</footer>
+<footer>Licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</footer>
diff --git a/templates/header.html b/templates/header.html
deleted file mode 100644
index c1d3c3e..0000000
--- a/templates/header.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<header>
-  <a href="{{ config.base_url }}" class="title">
-    <h2>{{ config.title }}</h2>
-  </a>
-  <nav>
-    {% include "nav.html" %}
-  </nav>
-</header>
diff --git a/templates/index.html b/templates/index.html
index 6caf1d5..a79b1c8 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -1,7 +1,39 @@
 {% extends "base.html" %}
 
-{% block main %}
-  <main>
-    {{ section.content | safe }}
+{% block body_attrs %} class="h-card vcard"{% endblock %}
+
+{% block title_class %} p-name fn{% endblock %}
+
+{% block main -%}
+  <main id="content">
+    <div>
+      {{ section.content | safe -}}
+    </div>
+    <section>
+      <h2>Latest Posts</h2>
+      <ul class="h-feed">
+        {%- set section = get_section(path="post/_index.md") %}
+        {%- for page in section.pages | slice(end=3) %}
+          <li class="h-entry">
+            <time class="dt-published" datetime="{{ page.date | date(format="%+") }}">{{ page.date | date(format=config.extra.date_format) }}</time>
+            <a class="u-url p-name" href="{{ page.path | safe }}">{{ page.title }}</a>
+          </li>
+        {%- endfor %}
+      </ul>
+    </section>
+    <section>
+      <h2>Elsewhere on the Internet</h2>
+      <ul>
+        {%- for item in config.extra.contact_menu %}
+          <li>
+            {%- if item.url is starting_with("mailto:") -%}
+              <a href="{{ item.url | safe }}" class="u-email email" rel="me">{{ item.name }}</a>
+            {%- else -%}
+              <a href="{{ item.url | safe }}" class="u-url url" rel="me">{{ item.name }}</a>
+            {%- endif -%}
+          </li>
+        {%- endfor %}
+      </ul>
+    </section>
   </main>
 {% endblock %}
diff --git a/templates/nav.html b/templates/nav.html
deleted file mode 100644
index e006ab1..0000000
--- a/templates/nav.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<a href="{{ config.base_url }}">Home</a>
-{%- if config.extra.main_menu %}
-  {%- for item in config.extra.main_menu %}
-    {%- if item.url is matching("https?://") %}
-      <a href="{{ item.url }}">{{ item.name }}</a>
-    {%- else %}
-      <a href="{{ get_url(path=item.url )}}">{{ item.name }}</a>
-    {%- endif %}
-  {%- endfor %}
-{%- endif -%}
diff --git a/templates/page.html b/templates/page.html
deleted file mode 100644
index 89de955..0000000
--- a/templates/page.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{% extends "base.html" %}
-
-{% block title %}{{ page.title }} | {{ super() }}{% endblock %}
-
-{% block main %}
-  {%- if not page.extra.menu %}
-    <h1>{{ page.title }}</h1>
-    {%- if page.date %}
-      <p>
-        <i>
-          <time datetime='{{ page.date | date(format='%+') }}' pubdate>
-            {{- page.date | date(format=config.extra.date_format) -}}
-          </time>
-        </i>
-      </p>
-    {%- endif %}
-  {%- endif %}
-  <main>
-    {{ page.content | safe }}
-  </main>
-  <p>
-    {%- if page.taxonomies %}
-      {%- for name, taxon in page.taxonomies %}
-        {{ name | capitalize }}:
-        {%- for item in taxon %}
-          <a href="{{ get_taxonomy_url(kind=name, name=item) }}">#{{ item }}</a>
-        {%- endfor %}
-      {%- endfor %}
-    {%- endif %}
-  </p>
-{% endblock %}
diff --git a/templates/section.html b/templates/section.html
deleted file mode 100644
index e596ffb..0000000
--- a/templates/section.html
+++ /dev/null
@@ -1,38 +0,0 @@
-{% extends "base.html" %}
-
-{% block main %}
-  <main>
-    {%- if taxonomy.term %}
-      <h3 style="margin-bottom:0">Filtering for "{{ section.title }}"</h3>
-      <small>
-        <a href="{{ get_url(path="@/blog/_index.md") }}">Remove filter</a>
-      </small>
-    {%- endif %}
-    <ul class="blog-posts">
-      {% for page in section.pages %}
-        <li>
-          <span>
-            <i>
-              <time datetime='{{ page.date | date(format='%+') }}' pubdate>
-                {{ page.date | date(format=config.extra.date_format) }}
-              </time>
-            </i>
-          </span>
-          <a href="{{ page.permalink }}">{{ page.title }}</a>
-        </li>
-        {% else %}
-        <li>
-          No posts yet
-        </li>
-      {% endfor %}
-    </ul>
-    <small>
-      <div>
-        {% set tags = get_taxonomy(kind="tags") %}
-        {% for post in tags.items %}
-          <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
-        {% endfor %}
-      </div>
-    </small>
-  </main>
-{% endblock %}
diff --git a/templates/security_tags.html b/templates/security_tags.html
deleted file mode 100644
index 0f922ea..0000000
--- a/templates/security_tags.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!-- These tags are here for demostration. It's recommended to send them via HTTP headers instead. -->
-<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self'; object-src 'none'; script-src 'none'; style-src 'unsafe-inline'">
diff --git a/templates/seo_tags.html b/templates/seo_tags.html
deleted file mode 100644
index 4eb2bc8..0000000
--- a/templates/seo_tags.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<meta name="title" content="{% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %}">
-<meta name="description" content="{{ config.description }}" />
diff --git a/templates/style.css.html b/templates/style.css.html
deleted file mode 100644
index 00b4131..0000000
--- a/templates/style.css.html
+++ /dev/null
@@ -1,169 +0,0 @@
-  body {
-    font-family: Verdana, sans-serif;
-    margin: auto;
-    padding: 20px;
-    max-width: 720px;
-    text-align: left;
-    background-color: #fff;
-    word-wrap: break-word;
-    overflow-wrap: break-word;
-    line-height: 1.5;
-    color: #444;
-  }
-
-  h1,
-  h2,
-  h3,
-  h4,
-  h5,
-  h6,
-  strong,
-  b {
-    color: #222;
-  }
-
-  a {
-    color: #3273dc;
-  }
-
-  .title {
-    text-decoration: none;
-    border: 0;
-  }
-
-  .title span {
-    font-weight: 400;
-  }
-
-  nav a {
-    margin-right: 10px;
-  }
-
-  textarea {
-    width: 100%;
-    font-size: 1rem;
-  }
-
-  input {
-    font-size: 1rem;
-  }
-
-  main,article {
-    line-height: 1.6;
-  }
-
-  table {
-    width: 100%;
-  }
-
-  img {
-    max-width: 100%;
-  }
-
-  code {
-    padding: 2px 5px;
-    background-color: #f2f2f2;
-  }
-
-  pre code {
-    color: #222;
-    display: block;
-    padding: 20px;
-    white-space: pre-wrap;
-    font-size: 0.875rem;
-    overflow-x: auto;
-  }
-
-  div.highlight pre {
-    background-color: initial;
-    color: initial;
-  }
-
-  div.highlight code {
-    background-color: unset;
-    color: unset;
-  }
-
-  blockquote {
-    border-left: 1px solid #999;
-    color: #222;
-    padding-left: 20px;
-    font-style: italic;
-  }
-
-  footer {
-    padding: 25px;
-    text-align: center;
-  }
-
-  .helptext {
-    color: #777;
-    font-size: small;
-  }
-
-  .errorlist {
-    color: #eba613;
-    font-size: small;
-  }
-
-  /* blog posts */
-  ul.blog-posts {
-    list-style-type: none;
-    padding: unset;
-  }
-
-  ul.blog-posts li {
-    display: flex;
-  }
-
-  ul.blog-posts li span {
-    flex: 0 0 130px;
-  }
-
-  ul.blog-posts li a:visited {
-    color: #8b6fcb;
-  }
-
-  @media (prefers-color-scheme: dark) {
-    body {
-      background-color: #333;
-      color: #ddd;
-    }
-
-    h1,
-    h2,
-    h3,
-    h4,
-    h5,
-    h6,
-    strong,
-    b {
-      color: #eee;
-    }
-
-    a {
-      color: #8cc2dd;
-    }
-
-    code {
-      background-color: #777;
-    }
-
-    pre code {
-      color: #ddd;
-    }
-
-    blockquote {
-      color: #ccc;
-    }
-
-    textarea,
-    input {
-      background-color: #252525;
-      color: #ddd;
-    }
-
-    .helptext {
-      color: #aaa;
-    }
-  }
diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html
deleted file mode 100644
index 69d9fa2..0000000
--- a/templates/taxonomy_list.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends "base.html" %}
-
-{% block main %}
-  <main>
-    <small>
-      <div>
-        {% set tags = get_taxonomy(kind="tags") %}
-        {% for post in tags.items %}
-          <a href="{{ post.permalink }}">#{{ post.name }}</a>&nbsp;
-        {% endfor %}
-      </div>
-    </small>
-  </main>
-{% endblock %}
diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html
deleted file mode 100644
index d5712b0..0000000
--- a/templates/taxonomy_single.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{% extends "base.html" %}
-
-{% block main %}
-  <main>
-    {%- if taxonomy.term %}
-      <h3 style="margin-bottom:0">Filtering for "{{ term.name }}"</h3>
-      <small>
-        <a href="{{ get_url(path="@/blog/_index.md") }}">Remove filter</a>
-      </small>
-    {%- endif %}
-    <ul class="blog-posts">
-      {% for page in term.pages %}
-        <li>
-          <span>
-            <i>
-              <time datetime='{{ page.date | date(format='%+') }}' pubdate>
-                {{ page.date | date(format=config.extra.date_format) }}
-              </time>
-            </i>
-          </span>
-          <a href="{{ page.permalink }}">{{ page.title }}</a>
-        </li>
-      {% else %}
-        <li>
-          No posts yet
-        </li>
-      {% endfor %}
-    </ul>
-  </main>
-{% endblock %}