From e48ea09a1442a49fd896f939fd4c1a1fb06522b8 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Fri, 19 Nov 2021 21:00:05 +0000 Subject: [PATCH] instance --- instance/cfg.py | 14 ++++++ instance/templates/layout.html | 25 +++++++++++ instance/templates/page.html | 67 +++++++++++++++++++++++++++++ instance/templates/page_plain.html | 68 ++++++++++++++++++++++++++++++ instance/templates/title.html | 67 +++++++++++++++++++++++++++++ 5 files changed, 241 insertions(+) create mode 100644 instance/cfg.py create mode 100644 instance/templates/layout.html create mode 100644 instance/templates/page.html create mode 100644 instance/templates/page_plain.html create mode 100644 instance/templates/title.html diff --git a/instance/cfg.py b/instance/cfg.py new file mode 100644 index 0000000..5c2b9e5 --- /dev/null +++ b/instance/cfg.py @@ -0,0 +1,14 @@ +import os +from envs import env + +pages_root = 'data' +static_root = 'static' +default_template = 'page.html' +URL_PREFIX = "/" +FLATPAGES_EXTENSION = ".md" +FLATPAGES_AUTO_RELOAD = True +DEBUG = True +FLATPAGES_ROOT = os.path.abspath(pages_root) +DEFAULT_TEMPLATE = 'page.html' +PAGES_ROOT='data' +STATIC_ROOT='static' \ No newline at end of file diff --git a/instance/templates/layout.html b/instance/templates/layout.html new file mode 100644 index 0000000..e2ecacf --- /dev/null +++ b/instance/templates/layout.html @@ -0,0 +1,25 @@ +{# -*-jinja2-*- #} + + + + +
+
+
+ + + {% block content %} + {% endblock %} + + +
+
+
+ + + diff --git a/instance/templates/page.html b/instance/templates/page.html new file mode 100644 index 0000000..6f119a2 --- /dev/null +++ b/instance/templates/page.html @@ -0,0 +1,67 @@ +{# -*-jinja2-*- #} +{% extends "layout.html" %} + +{% block content %} + +

{{post.title}}

+{{post.date}} +{% if post.links["subindexpages"] | length > 0 %} +
+ Unterseiten: + +{% endif %} + +{{ post.html|safe }} + + +{% if post.links["subpages"] |length > 0 %} + +{% endif %} + +{% if post.links["files"] |length > 0 %} + +
+ +Files: + +{% endif %} + +{% if post.links["images"] |length > 0 %} + +
+ +Images: + +{% endif %} + +{% endblock %} diff --git a/instance/templates/page_plain.html b/instance/templates/page_plain.html new file mode 100644 index 0000000..b728cbb --- /dev/null +++ b/instance/templates/page_plain.html @@ -0,0 +1,68 @@ +{# -*-jinja2-*- #} +{% extends "layout.html" %} + +{% block content %} + +

{{post.title}}

+{{post.date}} +{% if post.links["subindexpages"] | length > 0 %} +
+ Unterseiten: + +{% endif %} + +{{ post.html|safe }} + + +{% if post.links.subpages |length > 0 %} +hi + +{% endif %} + +{% if post.links["files"] |length > 0 %} + +
+ +Files: + +{% endif %} + +{% if post.links["images"] |length > 0 %} + +
+ +Images: + +{% endif %} + +{% endblock %} diff --git a/instance/templates/title.html b/instance/templates/title.html new file mode 100644 index 0000000..6f119a2 --- /dev/null +++ b/instance/templates/title.html @@ -0,0 +1,67 @@ +{# -*-jinja2-*- #} +{% extends "layout.html" %} + +{% block content %} + +

{{post.title}}

+{{post.date}} +{% if post.links["subindexpages"] | length > 0 %} +
+ Unterseiten: + +{% endif %} + +{{ post.html|safe }} + + +{% if post.links["subpages"] |length > 0 %} + +{% endif %} + +{% if post.links["files"] |length > 0 %} + +
+ +Files: + +{% endif %} + +{% if post.links["images"] |length > 0 %} + +
+ +Images: + +{% endif %} + +{% endblock %}