diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/404.html | 33 | ||||
-rw-r--r-- | templates/base.html | 25 | ||||
-rw-r--r-- | templates/index.html | 14 | ||||
-rw-r--r-- | templates/macros/posts.html | 61 | ||||
-rw-r--r-- | templates/page.html | 44 | ||||
-rw-r--r-- | templates/parts/head.html | 11 | ||||
-rw-r--r-- | templates/parts/nav.html | 8 | ||||
-rw-r--r-- | templates/posts.html | 15 | ||||
-rw-r--r-- | templates/taxonomy_list.html | 23 | ||||
-rw-r--r-- | templates/taxonomy_single.html | 11 |
10 files changed, 245 insertions, 0 deletions
diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..9ea1de3 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,33 @@ +{% extends "base.html" %} + +{% block html_title %} 404 Not Found | {{ config.title }}{% endblock html_title %} + +{% block content %} + <article lang="en"> + <header> + <h1 class="title">404 Not Found</h1> + <p class="post-meta">Published on 1970-01-01</p> + </header> + <p>In a world where technology reigns supreme, there was a digital kingdom called the World Wide Web. It was a vast expanse of information, a realm where people could connect, communicate, and collaborate with one another in ways that were previously unimaginable.</p> + + <p>In the midst of this virtual kingdom, there was a curious creature called the 404 error. It was a mysterious entity, shrouded in darkness and enigma. Its origins were unknown, and its motives were unclear. Some whispered that it was a curse, others believed it to be a supernatural force that was beyond human comprehension.</p> + + <p>Regardless of its true nature, the 404 error was feared by all who roamed the World Wide Web. It would often appear when a user clicked on a broken link or attempted to access a page that no longer existed. In such instances, the user would be greeted with an ominous message that read "404 Error: Page Not Found."</p> + + <p>The message was chilling, and it was accompanied by an image of a dark abyss, which seemed to swallow all who dared to venture too close. It was a warning, a reminder that the digital realm was not without its dangers, and that the 404 error was one of its most potent threats.</p> + + <p>Despite its fearsome reputation, the 404 error was not invincible. There were those who had managed to vanquish it, to restore broken links, and resurrect lost pages. These brave souls were known as web developers, and they possessed a unique set of skills that allowed them to navigate the complex landscape of the World Wide Web.</p> + + <p>To the web developer, the 404 error was a challenge, a puzzle that needed to be solved. They would delve deep into the code of the website, analyzing every line, every character, and every symbol. They would search for clues, follow breadcrumbs, and piece together the fragments of information that lay scattered across the digital landscape.</p> + + <p>It was a difficult task, one that required patience, persistence, and an unrelenting desire to succeed. But for the web developer, the rewards were great. They would emerge from the depths of the digital abyss victorious, having defeated the 404 error and restored order to the World Wide Web.</p> + + <p>And so, the legend of the 404 error lived on, a reminder of the dangers that lurked in the digital realm, and the courage and skill of those who dared to face them. It was a tale that would be told for generations, a testament to the power of technology, and the human spirit that drove it forward.</p> + + <p>Also, this page isn't real.</p> + + <p class="muted">Generated using ChatGPT</p> + <a href="/">Go to site root</a><br> + <a href="javascript:history.back()">Go back to previous page [JS]</a> +</article> +{% endblock content %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..33f4fd5 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,25 @@ +{% import "macros/posts.html" as posts %} + +<!DOCTYPE html> +<html lang="{{ config.default_language }}"> + <head> + {% include "parts/head.html" %} + <title>{% block html_title %}{% endblock html_title %}</title> + </head> + <body> + <div id="main"> + <header class="top-header"> + <b><a class="header-title" href="/">{{ config.title }}</a></b> + <p class="header-description"><span class="split-horizontal">Fixing nonexistent problems</span></p> + </header> + {% include "parts/nav.html" %} + <main> + {% block content %}{% endblock %} + </main> + <footer> + © 2023 sefidel + <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png" /></a><br />This work is licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>. + </footer> + </div> + </body> +</html> diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..7e3b531 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> + <head> + {% include "parts/head.html" %} + <title>{{ section.title }} | {{ config.title }}</title> + </head> + <body> + <main id="intro"> + <h1>{{ config.title }}</h1> + {% set isHome = true %} + {% include "parts/nav.html" %} + </main> + </body> +</html> diff --git a/templates/macros/posts.html b/templates/macros/posts.html new file mode 100644 index 0000000..506adff --- /dev/null +++ b/templates/macros/posts.html @@ -0,0 +1,61 @@ +{% macro display(pages) %} + <div class="article-list"> + <!-- If you are using pagination, section.pages will be empty. You need to use the paginator object --> + {% for page in pages %} + <article> + <header lang="{{ page.lang }}"> + <time datetime="{{ page.date }}">{{ page.date }}</time> + <h3>{{ posts::link(page=page) }}</h3> + <p class="post-meta">{{ posts::taxonomies(taxonomies=page.taxonomies) }}</p> + </header> + </article> + {% endfor %} +</div> +{% endmacro display %} + +{% macro link(page) %} + <a href="{{ page.permalink | safe }}">{{ page.title }}</a> +{% endmacro link %} + +{% macro meta(page) %} + {% if page.date %} + Published on {{ page.date }} + {% endif %} + {% if page.updated %} + | Edited on {{ page.updated }} + {% endif %} + {% if page.taxonomies %} + :: {{ posts::taxonomies(taxonomies=page.taxonomies) }} + {% endif %} +{% endmacro meta %} + +{% macro taxonomies(taxonomies) %} + {% if taxonomies.categories %} + {{ posts::categories(categories=taxonomies.categories) }} + {% endif %} + {% if taxonomies.tags %} + {{ posts::tags(tags=taxonomies.tags) }} + {% endif %} +{% endmacro taxonomies %} + +{% macro categories(categories) %} + [ + {% for category in categories %} + {% if loop.last %} + <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a> + {% else %} + <a href="{{ get_taxonomy_url(kind="categories", name=category) }}">{{ category }}</a>, + {% endif %} + {% endfor %} + ] +{% endmacro categories %} + +{% macro tags(tags) %} + {% for tag in tags %} + {% if loop.last %} + #<a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a> + {% else %} + #<a href="{{ get_taxonomy_url(kind="tags", name=tag) }}">{{ tag }}</a>, + {% endif %} + {% endfor %} +{% endmacro tags %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..cef35d9 --- /dev/null +++ b/templates/page.html @@ -0,0 +1,44 @@ +{% extends "base.html" %} + +{% block html_title %}{{ page.title }} | {{ config.title }}{% endblock html_title %} + +{% block content %} + <article lang="{{ lang }}"> + <header> + <h1 class="title"> + <a href="{{ page.permalink }}">{{ page.title }}</a> + </h1> + {% if not page.extra.raw %} + <p class="post-meta">{{ posts::meta(page=page) }}</p> + {% endif %} + </header> + {% if page.toc and not page.extra.no_toc %} + <h3>Table of Contents</h3> + <ul> + {% for h1 in page.toc %} + <li> + <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a> + {% if h1.children %} + <ul> + {% for h2 in h1.children %} + <li> + <a href="{{ h2.permalink | safe }}">{{ h2.title }}</a> + </li> + {% endfor %} + </ul> + {% endif %} + </li> + {% endfor %} + </ul> + {% endif %} + {{ page.content | safe }} + {% if not page.extra.raw %} + <footer> + <hr> + <p class="muted"> + Should you have any questions or comments, please reach out to me by sending <a href="mailto:contact@sefidel.net">an email</a> or <a href="https://matrix.to/#/@sef:exotic.sh">via Matrix</a>. + </p> + </footer> + {% endif %} + </article> +{% endblock content %} diff --git a/templates/parts/head.html b/templates/parts/head.html new file mode 100644 index 0000000..1336ec0 --- /dev/null +++ b/templates/parts/head.html @@ -0,0 +1,11 @@ +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +{% block rss %} +<link rel="alternate" type="application/atom+xml" title="RSS" href="{{ get_url(path="atom.xml", trailing_slash=false) }}"> +{% endblock %} +{% if current_url %} +<link rel="canonical" href="{{ current_url | safe }}"> +{% endif %} +<link rel="stylesheet" href="{{ get_url(path="normalize.css") }}"> +<link rel="stylesheet" href="{{ get_url(path="style.css") }}"> +<link rel="stylesheet" href="{{ get_url(path="sarasa-gothic.css") }}"> diff --git a/templates/parts/nav.html b/templates/parts/nav.html new file mode 100644 index 0000000..4d47ce0 --- /dev/null +++ b/templates/parts/nav.html @@ -0,0 +1,8 @@ +<nav> + {% if not isHome %} + <a href="/">Home</a> · + {% endif %} + <a href="/posts">Posts</a> · + <a href="/projects">Projects</a> · + <a rel="me" href="/about">About</a> +</nav> diff --git a/templates/posts.html b/templates/posts.html new file mode 100644 index 0000000..f2ccc74 --- /dev/null +++ b/templates/posts.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block html_title %}{{ section.title }} | {{ config.title }}{% endblock html_title %} + +{% block content %} + <div class="alt-links"> + [<a href="{{ get_url(path="atom.xml", trailing_slash=false) }}">feed</a>] + [<a href="{{ get_url(path="categories") }}">cat</a>] + [<a href="{{ get_url(path="tags") }}">tag</a>] + </div> + <h1 class="title"> + Posts + </h1> + {{ posts::display(pages=section.pages) }} + {% endblock content %} diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html new file mode 100644 index 0000000..0c4a579 --- /dev/null +++ b/templates/taxonomy_list.html @@ -0,0 +1,23 @@ +{% extends "base.html" %} + +{% block html_title %}{{ taxonomy.name | capitalize }} | {{ config.title }}{% endblock html_title %} + +{% block content %} + <h1 class="title"> + {{ taxonomy.name | capitalize }} + </h1> + <h3>{{ terms | length }} term{{ terms | length | pluralize }}</h3> + <table class="terms"> + <tbody> + {% for term in terms %} + <tr> + <td> + <b><span class="prefix">|</span></b> + <a href="{{ term.permalink }}">{{ term.name }}</a> + ({{ term.pages | length }} post{{ term.pages | length | pluralize }}) + </td> + </tr> + {% endfor %} + </tbody> + </table> +{% endblock content %} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html new file mode 100644 index 0000000..e13f439 --- /dev/null +++ b/templates/taxonomy_single.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block html_title %}{{ term.name | capitalize}} | {{ config.title }}{% endblock html_title %} + +{% block content %} + <h1 class="title"> + {{ taxonomy.name | capitalize }} -> {{ term.name | capitalize }} + </h1> + <h3>{{ term.pages | length }} post{{ term.pages | length | pluralize }}</h3> + {{ posts::display(pages=term.pages) }} +{% endblock content %} |