aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/article.html35
-rw-r--r--templates/base.html130
-rw-r--r--templates/blocks/article-list.html34
-rw-r--r--templates/category.html5
-rw-r--r--templates/index.html5
-rw-r--r--templates/page.html13
-rw-r--r--templates/tag.html5
7 files changed, 227 insertions, 0 deletions
diff --git a/templates/article.html b/templates/article.html
new file mode 100644
index 0000000..27f23e9
--- /dev/null
+++ b/templates/article.html
@@ -0,0 +1,35 @@
+{% extends "base.html" %}
+
+{% block content %}
+<div class="article post" role="article" lang="{{ article.lang }}">
+ <article>
+ <h1 class="topmost">{{ article.title }}</h1>
+
+ {# Article meta information #}
+ <p class="article-meta">
+ <time datetime="{{ article.date }}">
+ {{ article.date | strftime("%B %d, %Y") }}
+ </time>
+ in
+ <a href="{{ SITEURL }}/{{ article.category.url }}">
+ {{ article.category.name }}
+ </a>
+ </p>
+
+
+ <div class="tags">
+ <ul class="tags">
+ {% for tag in article.tags %}
+ <li>
+ <a href="{{ SITEURL }}/ {{ tag.url }}">{{ tag.name }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+
+ <div class="content">
+ {{ article.content | safe }}
+ </div>
+ </article>
+</div>
+{% endblock %}
diff --git a/templates/base.html b/templates/base.html
new file mode 100644
index 0000000..c759e7a
--- /dev/null
+++ b/templates/base.html
@@ -0,0 +1,130 @@
+{% macro feed(path, feed_name, type) %}
+{% if path %}
+<link href="{{ SITEURL }}/{{ path }}" type="application/{{ type }}+xml" rel="alternate" title="{{ SITENAME }} {{feed_name }}">
+{% endif %}
+{% endmacro -%}
+
+{%- macro logo(name) -%}
+<div class="social-icon">
+ <img class="social-icon" src="{{ SITEURL }}/theme/images/logos/{{ name }}" alt="Logo {{ name }}">
+</div>
+{%- endmacro -%}
+
+<!DOCTYPE html>
+<html lang="{{ DEFAULT_LANG }}">
+{#
+ # Moeka Pelican Theme
+ # Copyright (C) 2023 Daniel Schadt
+ #
+ # This program is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+ # the Free Software Foundation, either version 3 of the License, or
+ # (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU General Public License for more details.
+ #
+ # You should have received a copy of the GNU General Public License
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
+ #}
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>{% block title %}{{ SITENAME }}{% endblock %}</title>
+
+ {# Feeds! #}
+ {{ feed(FEED_ALL_ATOM, "Full Atom Feed", "atom") }}
+ {{ feed(FEED_ALL_RSS, "Full RSS Feed", "rss") }}
+
+ {% if FAVICON %}
+ <link rel="icon" href="{{ SITEURL }}/{{ FAVICON }}">
+ {% endif %}
+
+ <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/main.css">
+ <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/monokai.css">
+ </head>
+ <body>
+ {# The site/side menu #}
+ <div id="openSideBanner">
+ <a id="hamburgerMenu" href="#sideBanner"><img src="{{ SITEURL }}/theme/images/hamburger.svg"></a>
+ </div>
+ <div role="banner" id="sideBanner">
+ <a id="hideMenu" href="#"><img src="{{ SITEURL }}/theme/images/hamburger.svg"></a>
+ <header>
+ <div id="mainTitle">
+ <a href="{{ SITEURL }}">{{ SITENAME }}</a>
+ </div>
+
+ <nav id="menu">
+ <ul>
+ {% if DISPLAY_PAGES_ON_MENU %}
+ {% for p in pages %}
+ <li {% if p == page -%} class="active" {%- endif %}>
+ <a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a>
+ </li>
+ {% endfor %}
+ {% endif %}
+
+ {% for link_title, link in MENUITEMS %}
+ <li>
+ <a href="{{ link }}">{{ link_title }}</a>
+ </li>
+ {% endfor %}
+
+ {% if DISPLAY_CATEGORIES_ON_MENU %}
+ {% for cat, _ in categories %}
+ <li {% if cat == category -%} class="active" {%-endif%}>
+ <a href="{{ SITEURL }}/{{ cat.url }}">{{ cat.name }}</a>
+ </li>
+ {% endfor %}
+ {% endif %}
+ </ul>
+ </nav>
+ </header>
+ </div>
+
+ {# Main content #}
+ <div id="mainArea" role="main">
+ {% block content %}
+ {% endblock %}
+ </div>
+
+ {# Footer #}
+ <footer>
+ <div class="icons">
+ {% if GITHUB %}
+ <a href="{{ GITHUB }}" target="_blank">{{ logo("GitHub.svg") }}</a>
+ {% endif %}
+
+ {% if GITLAB %}
+ <a href="{{ GITLAB }}" target="_blank">{{ logo("GitLab.svg") }}</a>
+ {% endif %}
+
+ {% if CODEBERG %}
+ <a href="{{ CODEBERG }}" target="_blank">{{ logo("Codeberg.svg") }}</a>
+ {% endif %}
+
+ {% if MASTODON %}
+ <a href="{{ MASTODON }}" target="_blank">{{ logo("Mastodon.svg") }}</a>
+ {% endif %}
+ </div>
+
+ <p>&copy; {{ AUTHOR }}</p>
+ {% if CONTENT_LICENCE %}
+ <p id="licenceLine">
+ {% if CONTENT_LICENCE.startswith("CC-BY-SA") %}
+ <img src="{{ SITEURL }}/theme/images/cc/cc.svg" class="cc-icon" alt="CC">
+ <img src="{{ SITEURL }}/theme/images/cc/by.svg" class="cc-icon" alt="BY">
+ <img src="{{ SITEURL }}/theme/images/cc/sa.svg" class="cc-icon" alt="SA">
+ {% endif %}
+ The text of this website is licensed under {{ CONTENT_LICENCE }}.
+ </p>
+ {% endif %}
+ {% if ATTRIBUTION %}
+ <p>Pelican Theme <a href="https://codeberg.org/dunj3/moeka">moeka</a>, available under the GPL.</p>
+ {% endif %}
+ </footer>
+ </body>
+</html>
diff --git a/templates/blocks/article-list.html b/templates/blocks/article-list.html
new file mode 100644
index 0000000..a31836f
--- /dev/null
+++ b/templates/blocks/article-list.html
@@ -0,0 +1,34 @@
+<div class="article-list">
+ {% for article in articles_page.object_list %}
+ <article>
+ {# Article meta information #}
+ <p class="article-meta">
+ <time datetime="{{ article.date }}">
+ {{ article.date | strftime("%B %d, %Y") }}
+ </time>
+ in
+ <a href="{{ SITEURL }}/{{ article.category.url }}">
+ {{ article.category.name }}
+ </a>
+ </p>
+
+ <h1>
+ <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
+ </h1>
+
+ <div class="tags">
+ <ul class="tags">
+ {% for tag in article.tags %}
+ <li>
+ <a href="{{ SITEURL }}/{{ tag.url }}">{{ tag.name }}</a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+
+ <p>{{ article.description }}</p>
+
+ <a class="read-more-link" href="{{ SITEURL }}/{{ article.url }}">Read more &hellip;</a>
+ </article>
+ {% endfor %}
+</div>
diff --git a/templates/category.html b/templates/category.html
new file mode 100644
index 0000000..794d56f
--- /dev/null
+++ b/templates/category.html
@@ -0,0 +1,5 @@
+{% extends "base.html" %}
+{% block content %}
+<h1 class="topmost">Category {{ category }}</h1>
+{% include "blocks/article-list.html" %}
+{% endblock %}
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..751304f
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,5 @@
+{% extends "base.html" %}
+{% block content %}
+<h1 class="topmost">Posts</h1>
+{% include "blocks/article-list.html" %}
+{% endblock %}
diff --git a/templates/page.html b/templates/page.html
new file mode 100644
index 0000000..bd8fd58
--- /dev/null
+++ b/templates/page.html
@@ -0,0 +1,13 @@
+{% extends "base.html" %}
+
+{% block content %}
+<div class="article page" role="article" lang="{{ page.lang }}">
+ <article>
+ <h1>{{ page.title }}</h1>
+
+ <div class="content">
+ {{ page.content | safe }}
+ </div>
+ </article>
+</div>
+{% endblock %}
diff --git a/templates/tag.html b/templates/tag.html
new file mode 100644
index 0000000..52fd1e8
--- /dev/null
+++ b/templates/tag.html
@@ -0,0 +1,5 @@
+{% extends "base.html" %}
+{% block content %}
+<h1 class="topmost">Tag <q>{{ tag }}</q></h1>
+{% include "blocks/article-list.html" %}
+{% endblock %}