diff options
| author | Philipp Geyer <philipp@geyer.co.uk> | 2022-01-22 14:12:35 +0000 |
|---|---|---|
| committer | Philipp Geyer <philipp@geyer.co.uk> | 2022-01-22 14:12:35 +0000 |
| commit | ba4e78346aac1843890c1a889807b8e60bdf9419 (patch) | |
| tree | 5982ccc113872b20db69005bf8bb2addff492571 /theme/templates | |
| parent | 93ea64f62c8056a532367600f53f69d4daa79ea3 (diff) | |
Some work on my website - should be looking half decent finally, and have some content
Diffstat (limited to 'theme/templates')
| -rw-r--r-- | theme/templates/articles.html | 18 | ||||
| -rw-r--r-- | theme/templates/base.html | 55 | ||||
| -rw-r--r-- | theme/templates/blog.html | 18 | ||||
| -rw-r--r-- | theme/templates/feed.xml | 44 | ||||
| -rw-r--r-- | theme/templates/page.html | 12 | ||||
| -rw-r--r-- | theme/templates/post.html | 33 |
6 files changed, 180 insertions, 0 deletions
diff --git a/theme/templates/articles.html b/theme/templates/articles.html new file mode 100644 index 0000000..07085a1 --- /dev/null +++ b/theme/templates/articles.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block main %} + <h1>Articles</h1> + + <ul class="posts"> + {% for post in posts %} + <li class="post-title"> + <a href="{{ url_for("pages", slug=post.slug) }}"> + {% if post.date is defined %} + {{ post.date|strftime("%b %d, %Y") }} — + {% endif %} + {{ post.title }} + </a> + </li> + {% endfor %} + </ul> +{% endblock %} diff --git a/theme/templates/base.html b/theme/templates/base.html new file mode 100644 index 0000000..ff31f26 --- /dev/null +++ b/theme/templates/base.html @@ -0,0 +1,55 @@ +<!doctype html> +<html lang="en-us"> + <head> + {% block head %} + <meta charset="utf-8"> + <title> + {% block title %}{{ site_name | default("Philipp Geyer") }}{% endblock %} + {% block subtitle %}{% endblock %} + </title> + <meta name="viewport" content="width=device-width, initial-scale=1"> + {% if site_owner is defined %}<meta name="author" content="{{ site_owner }}" />{% endif %} + {% if site_description is defined %}<meta name="description" content="{{ site_description }}" />{% endif %} + {% if site_keywords is defined %}<meta name="keywords" content="{{ site_keywords }}" />{% endif %} + {% block meta %}{% endblock %} + <link rel="stylesheet" href="{{ url_for("static", file="style.css") }}" type="text/css" /> + <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lora&family=Space+Mono&display=swap" /> + {% endblock %} + </head> + <body> + {# Top navigation bar #} + {% block nav %} + <header> + <h1> + <a href="{{ url_for("index") }}"> + {% block title %}{{ site_name | default("Philipp Geyer") }}{% endblock %} + </a> + </h1> + <a href="#main" class="visually-hidden">jump to main content</a> + <nav> + <ul class="menu"> + <li><a href="{{ url_for("blog") }}">posts</a></li> + <li><a href="{{ url_for("articles") }}">pages</a></li> + </ul> + </nav> + </header> + {% endblock %} + + {# Probably where most of the action will happen #} + <main id="main"> + {% block main %}{% endblock %} + </main> + + {# Links, copyright notice, etc #} + {% block footer %} + <footer> + <ul class="menu"> + <li><a href="{{ url_for("pages", slug="about") }}">about</a></li> + <li><a href="{{ url_for("pages", slug="contact") }}">contact</a></li> + <li><a href="{{ url_for("pages", slug="credits") }}">credits</a></li> + </ul> + </footer> + {% endblock %} + + </body> +</html> diff --git a/theme/templates/blog.html b/theme/templates/blog.html new file mode 100644 index 0000000..e3e8c3e --- /dev/null +++ b/theme/templates/blog.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block main %} + <h1>Blog Posts</h1> + + <ul class="posts"> + {% for post in posts %} + <li class="post-title"> + <a href="{{ url_for("posts", slug=post.slug) }}"> + {% if post.date is defined %} + {{ post.date|strftime("%b %d, %Y") }} — + {% endif %} + {{ post.title }} + </a> + </li> + {% endfor %} + </ul> +{% endblock %} diff --git a/theme/templates/feed.xml b/theme/templates/feed.xml new file mode 100644 index 0000000..5cf001c --- /dev/null +++ b/theme/templates/feed.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<rss version="2.0" + xmlns:content="http://purl.org/rss/1.0/modules/content/" + xmlns:wfw="http://wellformedweb.org/CommentAPI/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" + xmlns:slash="http://purl.org/rss/1.0/modules/slash/" + xmlns:georss="http://www.georss.org/georss" + xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" + xmlns:media="http://search.yahoo.com/mrss/"> + <channel> + <title>Simple Blog</title> + <atom:link + href="{{ url_for("feed") }}" + rel="self" type="application/rss+xml" /> + <link>{{ url_for("index") }}</link> + <description><![CDATA[]]></description> + <language>en</language> + <pubDate>{{ posts | first | getattr("date") | strftime("%a, %d %b %Y %H:%M:%S %z") }}</pubDate> + <lastBuildDate>{{ now() | strftime("%a, %d %b %Y %H:%M:%S %z") }}</lastBuildDate> + <generator>{{ meta.generator }}</generator> + <webMaster>web@master (Blog Author)</webMaster> + <image> + <url>{{ url_for("index") }}media/img/8bitme.png</url> + <title>Blog Author</title> + <link>{{ url_for("index") }}</link> + </image> + + {% for post in posts %} + <item> + <title>{{ post.title }}</title> + <link>{{ url_for("posts", slug=post.slug) }}</link> + <author>{{ post.author|default("author@mail.com (Blog Author)") }}</author> + <guid isPermaLink="false">{{ url_for("posts", slug=post.slug) }}</guid> + {% if post.date is defined %} + <pubDate>{{ post.date|strftime("%a, %d %b %Y %H:%M:%S %z") }}</pubDate> + {% endif %} + <description><![CDATA[{{ post.html|safe }}]]></description> + </item> + {% endfor %} + + </channel> +</rss> diff --git a/theme/templates/page.html b/theme/templates/page.html new file mode 100644 index 0000000..daa7a36 --- /dev/null +++ b/theme/templates/page.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block main %} + <article class="page"> + <h1 class="page__title"> + {{ post.title }} + </h1> + <section> + {{ post.html|safe }} + </section> + </article> +{% endblock %} diff --git a/theme/templates/post.html b/theme/templates/post.html new file mode 100644 index 0000000..7bded9a --- /dev/null +++ b/theme/templates/post.html @@ -0,0 +1,33 @@ +{% extends "base.html" %} + +{% block meta %} + <meta property="og:title" content="{{ post.title }}"> + <meta property="og:url" content="{{ post.url }}"> + {% if post.description is defined %} + <meta property="og:description" content="{{ post.description }}"> + {% elif project_description is defined %} + <meta property="og:description" content="{{ project_description }}"> + {% endif %} + {% if post.image is defined %} + <meta property="og:image" content="{{ post.image }}"> + {% elif project_image is defined %} + <meta property="og:image" content="{{ project_image }}"> + {% endif %} + <meta name="twitter:card" content="summary_large_image"> +{% endblock %} + +{% block main %} + <article class="post"> + <h1 class="post__title"> + {{ post.title }} + </h1> + <section class="post__meta"> + {% if post.date is defined %} + {{ post.date|strftime("%b %d, %Y") }} + {% endif %} + </section> + <section> + {{ post.html|safe }} + </section> + </article> +{% endblock %} |
