From ad2be2b20c337d99ebe6e7d4b8cf6106cfba77df Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Sat, 12 Jun 2021 14:21:59 +0200 Subject: Initial commit --- templates/atom.xml | 33 +++++++++++++++++++++++++++++++++ templates/base.html | 27 +++++++++++++++++++++++++++ templates/index.html | 8 ++++++++ templates/macros.html | 43 +++++++++++++++++++++++++++++++++++++++++++ templates/page.html | 27 +++++++++++++++++++++++++++ templates/shortcodes/img.html | 9 +++++++++ templates/shortcodes/ref.html | 1 + templates/tags/list.html | 19 +++++++++++++++++++ templates/tags/single.html | 20 ++++++++++++++++++++ 9 files changed, 187 insertions(+) create mode 100644 templates/atom.xml create mode 100644 templates/base.html create mode 100644 templates/index.html create mode 100644 templates/macros.html create mode 100644 templates/page.html create mode 100644 templates/shortcodes/img.html create mode 100644 templates/shortcodes/ref.html create mode 100644 templates/tags/list.html create mode 100644 templates/tags/single.html (limited to 'templates') diff --git a/templates/atom.xml b/templates/atom.xml new file mode 100644 index 0000000..ab0012c --- /dev/null +++ b/templates/atom.xml @@ -0,0 +1,33 @@ + + + {{ config.title }} + {%- if term %} - {{ term.name }} + {%- elif section.title %} - {{ section.title }} + {%- endif -%} + + {%- if config.description %} + {{ config.description }} + {%- endif %} + + + Zola + {{ last_updated | date(format="%+") }} + {{ feed_url | safe }} + {%- for page in pages %} + + {{ config.extra.author }} + {{ page.title | default(value="Post № " ~ page.slug)}} + {{ page.date | date(format="%+") }} + {{ page.updated | default(value=page.date) | date(format="%+") }} + + {{ page.permalink | safe }} + {{ page.content }} + + {%- endfor %} + diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..edce080 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,27 @@ +{% import "macros.html" as macros -%} + + + + {{ config.title ~ " · " }}{% block title %}{{ config.description }}{% endblock %} + + + + {%- block additional_feeds %}{% endblock %} + + + + +
+
+

{{ config.title }}

+ +
+ {%- block content %}{% endblock -%} +
+ + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..87220f7 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{%- block content %} +{%- for post in paginator.pages %} + {{ macros::render_post(post=post) }} +{%- endfor -%} +{{ macros::render_pagination(paginator=paginator) }} +{%- endblock content %} diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..9f0f792 --- /dev/null +++ b/templates/macros.html @@ -0,0 +1,43 @@ +{% macro render_post(post, mention=false, in_feed=true) -%} +{% if mention -%} +
+{% else -%} +
+{% endif -%} +
+ {{ config.extra.author }} + +
+
{{ post.content | safe }}
+
+{% endmacro render_post -%} + +{%- macro render_pagination(paginator) %} +{%- if paginator.number_pagers > 1 %} + +{%- endif %} +{%- endmacro render_pagination -%} + +{%- macro render_tags(tags) %} +{%- for tag in tags %} +
  • {{ tag }}
  • +{%- endfor %} +{%- endmacro render_tags %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..8703c7c --- /dev/null +++ b/templates/page.html @@ -0,0 +1,27 @@ +{% extends "base.html" -%} + +{%- block title -%} +{%- if page.title -%} +{{ page.title }} +{%- else -%} +post № {{ page.slug }} +{%- endif -%} +{%- endblock title -%} + +{%- block description %} +post № {{ page.slug }} +{%- if page.title -%} +· {{ page.title }} +{%- endif -%} +{%- endblock description %} + +{%- block content %} +{{ macros::render_post(post=page, in_feed=false) }} +{%- if "mentions" in page.extra and page.extra.mentions | length > 0 -%} +

    Mentioned posts

    +{%- for ref in page.extra.mentions %} +{%- set page = get_page(path=ref ~ "/index.md") -%} +{{ macros::render_post(post=page, mention=true) }} +{%- endfor %} +{%- endif %} +{%- endblock content %} diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html new file mode 100644 index 0000000..13d38d6 --- /dev/null +++ b/templates/shortcodes/img.html @@ -0,0 +1,9 @@ +{% set url = page.path ~ path | trim_start_matches(pat="/") -%} +
    + + {{ alt }} + + {% if caption -%} +
    {{ caption }}
    + {% endif -%} +
    diff --git a/templates/shortcodes/ref.html b/templates/shortcodes/ref.html new file mode 100644 index 0000000..6708552 --- /dev/null +++ b/templates/shortcodes/ref.html @@ -0,0 +1 @@ +{{ text | default(value="№ " ~ id) }} diff --git a/templates/tags/list.html b/templates/tags/list.html new file mode 100644 index 0000000..0cab254 --- /dev/null +++ b/templates/tags/list.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{%- block title -%} +all tags +{%- endblock title -%} + +{%- block description %} +all tags +{%- endblock description %} + +{% block content %} + +{% endblock content %} diff --git a/templates/tags/single.html b/templates/tags/single.html new file mode 100644 index 0000000..2238061 --- /dev/null +++ b/templates/tags/single.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{%- block additional_feeds %} + +{%- endblock %} + +{%- block title -%} +posts tagged with #{{ term.name }} +{%- endblock title -%} + +{%- block description %} +posts tagged with #{{ term.name }} · feed +{%- endblock description %} + +{%- block content %} +{%- for post in paginator.pages %} + {{ macros::render_post(post=post) }} +{%- endfor %} +{{ macros::render_pagination(paginator=paginator) }} +{%- endblock content %} -- cgit v1.2.3-2-gb3c3