diff options
author | Alan Pearce | 2020-11-14 21:17:02 +0100 |
---|---|---|
committer | Alan Pearce | 2020-11-14 21:52:50 +0100 |
commit | 5de7de4e64cb20183ebfe86e16578f4abd62a23e (patch) | |
tree | d3e24ee322d24c03a5e6563ace11c1c588881368 /templates | |
parent | d996657be5efda94f4a934d5d78c407ba47bf76c (diff) | |
download | website-5de7de4e64cb20183ebfe86e16578f4abd62a23e.tar.lz website-5de7de4e64cb20183ebfe86e16578f4abd62a23e.tar.zst website-5de7de4e64cb20183ebfe86e16578f4abd62a23e.zip |
Port theme to zola template
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 25 | ||||
l--------- | templates/categories/list.html | 1 | ||||
l--------- | templates/categories/single.html | 1 | ||||
-rw-r--r-- | templates/index.html | 36 | ||||
-rw-r--r-- | templates/page.html | 28 | ||||
-rw-r--r-- | templates/section.html | 18 | ||||
-rw-r--r-- | templates/tags/list.html | 18 | ||||
-rw-r--r-- | templates/tags/single.html | 25 |
8 files changed, 152 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..6b99609 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html lang="{{ config.default_language }}"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title {%- if current_path == '/' %} class="p-name"{% endif %}>{% block title %}{{ section.title }} | {{ config.title }}{% endblock %}</title> + <link rel="stylesheet" href="/css/style.css" /> + {%- 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="RSS" href="{{ get_url(path=config.feed_filename) | safe }}"> + {%- endblock %} + {%- endif %} + </head> + <body> + <nav> + <ul> + {%- for item in config.extra.menu.main %} + <li><a {%- if item.url == "/" %} class="author"{% endif %} href="{{ item.url | safe }}">{{ item.name }}</a></li> + {%- endfor %} + </ul> + </nav> + {% block main %}{% endblock %} + <footer>{{ config.extra.footer | safe }}</footer> + </body> +</html> diff --git a/templates/categories/list.html b/templates/categories/list.html new file mode 120000 index 0000000..e0e4e08 --- /dev/null +++ b/templates/categories/list.html @@ -0,0 +1 @@ +../tags/list.html \ No newline at end of file diff --git a/templates/categories/single.html b/templates/categories/single.html new file mode 120000 index 0000000..86f5e80 --- /dev/null +++ b/templates/categories/single.html @@ -0,0 +1 @@ +../tags/single.html \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..23ec4cd --- /dev/null +++ b/templates/index.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} + +{% block main %} +<main class="h-card"> + <h1 class="p-name">{{ config.title }}</h1> + {{ section.content | safe }} + <section> + <h2>Latest Posts</h2> + <ul class="h-feed"> + {%- 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="%F") }}</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.menu.contact %} + <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> + <footer> + GPG Key: <a href="{{ config.extra.gpg_url | safe }}" rel="u-key pgpkey">{{ config.extra.gpg_fingerprint }}</a> + </footer> +</main> +{% endblock %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..f32a6fc --- /dev/null +++ b/templates/page.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} + +{% block title %} +{{- page.title -}} +{% endblock %} + +{% block main %} +<article class="h-entry"> + <header> + <h1><span class="title p-name">{{ page.title }}</span></h1> + <time class="dt-published" datetime="{{ page.date | date(format='%+') }}">{{ page.date | date(format="%F") }}</time> + <p class="terms"> + {%- if page.taxonomies %} + {%- for name, taxon in page.taxonomies %} + {{ name | capitalize }}: + {%- for item in taxon %} + <a class="p-category" href="{{ get_taxonomy_url(kind=name, name=item) }}">{{ item }}</a> + {%- endfor %} + {%- endfor %} + {%- endif %} + </p> + </header> + + <main class="e-content"> + {{ page.content | safe }} + </main> +</article> +{% endblock %} diff --git a/templates/section.html b/templates/section.html new file mode 100644 index 0000000..e61566f --- /dev/null +++ b/templates/section.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block main %} +<main> + <h1>{{ section.title }}</h1> + {{ section.content }} + <section> + <ul> + {% for page in section.pages %} + <li class="h-entry"> + <time class="dt-published" datetime="{{ page.date | date(format="%+") }}">{{ page.date | date(format="%F") }}</time> + <a class="u-url p-name" href="{{ page.path | safe }}">{{ page.title }}</a> + </li> + {% endfor %} + </ul> + </section> +</main> +{% endblock %} diff --git a/templates/tags/list.html b/templates/tags/list.html new file mode 100644 index 0000000..ee60c39 --- /dev/null +++ b/templates/tags/list.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %}{{ taxonomy.name | capitalize }}{% endblock %} + +{% block main %} +<main> + <h1>{{ taxonomy.name | capitalize }}</h1> + <section> + <ul> + {%- for term in terms %} + <li> + <a href="{{ term.permalink }}">{{ term.name }}</a> + </li> + {%- endfor %} + </ul> + </section> +</main> +{% endblock %} diff --git a/templates/tags/single.html b/templates/tags/single.html new file mode 100644 index 0000000..25dde54 --- /dev/null +++ b/templates/tags/single.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block rss %} + {% set rss_path = "tags/" ~ term.name ~ "/atom.xml" %} + <link rel="alternate" type="application/atom+xml" title="RSS" href="{{ get_url(path=rss_path, trailing_slash=false) | safe }}"> + +{% endblock %} + +{% block title %}{{ taxonomy.name | capitalize }}: {{ term.name }} | {{ config.title }}{% endblock %} + +{% block main %} +<main> + <h1>{{ taxonomy.name | capitalize }}: {{ term.name }}</h1> + <section> + <ul class="h-feed"> + {%- for page in term.pages %} + <li class="h-entry"> + <time class="dt-published" datetime="{{ page.date | date(format="%+") }}">{{ page.date | date(format="%F") }}</time> + <a class="u-url p-name" href="{{ page.permalink | safe }}">{{ page.title }}</a> + </li> + {%- endfor %} + </ul> + </section> +</main> +{% endblock %} |