diff options
| author | Botond Hende <contact@wazul.moe> | 2026-05-01 21:28:35 +0200 |
|---|---|---|
| committer | Botond Hende <contact@wazul.moe> | 2026-05-01 21:28:35 +0200 |
| commit | 32cb783aa8675d275cb9136eeadffa8294d40b89 (patch) | |
| tree | 350b570140efd5672c2823673307cdda7ed82e67 | |
| parent | 41ebb83adbb462c28ba1d686a80f273265987971 (diff) | |
created global template and refactored blog templates
| -rw-r--r-- | blog/templates/acknowledgement.html.j2 | 4 | ||||
| -rw-r--r-- | blog/templates/blog_base.html.j2 | 25 | ||||
| -rw-r--r-- | blog/templates/blogpost.html.j2 | 4 | ||||
| -rw-r--r-- | blog/templates/blogpost_sub.html.j2 | 4 | ||||
| -rw-r--r-- | blog/templates/tag.html.j2 | 4 | ||||
| -rw-r--r-- | blog/templates/tags.html.j2 | 4 | ||||
| -rw-r--r-- | config.py | 1 | ||||
| -rw-r--r-- | global/templates/base.html.j2 | 18 |
8 files changed, 37 insertions, 27 deletions
diff --git a/blog/templates/acknowledgement.html.j2 b/blog/templates/acknowledgement.html.j2 index e12ea6f..87bd188 100644 --- a/blog/templates/acknowledgement.html.j2 +++ b/blog/templates/acknowledgement.html.j2 @@ -1,6 +1,6 @@ {% extends "blog_base.html.j2" %} -{% block page_title %}Acknowledgement {{ super() }}{% endblock %} -{% block page_title_short %}Acknowledgement{% endblock %} +{% block page_title %}Acknowledgement - {{ super() }}{% endblock %} +{% block og_page_title %}Acknowledgement{% endblock %} {% block content %} <h1 class="first-element">Acknowledgement</h1> <p>Thank you for everyone, who made this blog possible, like...<br> diff --git a/blog/templates/blog_base.html.j2 b/blog/templates/blog_base.html.j2 index 6c5845a..b250abf 100644 --- a/blog/templates/blog_base.html.j2 +++ b/blog/templates/blog_base.html.j2 @@ -1,19 +1,12 @@ -<!DOCTYPE html> -<html dir="ltr" lang="en"> -<head> - <meta charset="utf-8"/> - <title>{% block page_title %}{{ blog.blog_name }}{% endblock %}</title> - <meta name="viewport" content="width=device-width, initial-scale=1"/> - <meta property="og:title" content="{% block page_title_short %}{{ blog.blog_name }}{% endblock %}" /> - <meta property="og:type" content="article" /> - <meta property="og:url" content="{{ url }}" /> - <link rel="stylesheet" href="{{ site.assets_path_static }}/css/bootstrap-grid.min.css" /> +{% extends "base.html.j2" %} +{% block page_title %}{{ blog.blog_name }}{% endblock %} +{% block og_page_title %}{{ blog.blog_name }}{% endblock %} +{% block og_type %}article{% endblock %} +{% block head_extra %}{{ super() }} <link rel="stylesheet" href="{{ site.assets_path }}/css/font.css" /> <script src="{{ site.assets_path }}/js/theme.js"></script> - <link rel="stylesheet" href="{{ site.assets_path }}/css/blog.css" /> -</head> -<body> -<div class="bootstrap-wrapper"> + <link rel="stylesheet" href="{{ site.assets_path }}/css/blog.css" />{% endblock %} +{% block body %}<div class="bootstrap-wrapper"> <div class="container"> <a href="/" class="row dont-bother"> <header class="col-lg-9" role="banner"> @@ -45,6 +38,4 @@ CgggbU8OU qOp qOdoUOdcb </div> </div> </div> -<div class="huge-vertical-spacer-at-the-bottom"></div> -</body> -</html> +<div class="huge-vertical-spacer-at-the-bottom"></div>{% endblock %} diff --git a/blog/templates/blogpost.html.j2 b/blog/templates/blogpost.html.j2 index 0a09558..801df54 100644 --- a/blog/templates/blogpost.html.j2 +++ b/blog/templates/blogpost.html.j2 @@ -1,6 +1,6 @@ {% extends "blog_base.html.j2" %} -{% block page_title %}{{ post.title() }} {{ super() }}{% endblock %} -{% block page_title_short %}{{ post.title() }}{% endblock %} +{% block page_title %}{{ post.title() }} - {{ super() }}{% endblock %} +{% block og_page_title %}{{ post.title() }}{% endblock %} {% block content %} <h1 class="first-element">{{ post.title() }}</h1> <p>{{ post.get_prompt("ls tags/") }} diff --git a/blog/templates/blogpost_sub.html.j2 b/blog/templates/blogpost_sub.html.j2 index bc1c2b8..a2c6960 100644 --- a/blog/templates/blogpost_sub.html.j2 +++ b/blog/templates/blogpost_sub.html.j2 @@ -1,6 +1,6 @@ {% extends "blog_base.html.j2" %} -{% block page_title %}{{ post.title() }} {{ super() }}{% endblock %} -{% block page_title_short %}{{ post.title() }}{% endblock %} +{% block page_title %}{{ post.title() }} - {{ super() }}{% endblock %} +{% block og_page_title %}{{ post.title() }}{% endblock %} {% block content %} <p class="first-element">{{ post.get_cat_prompt(subpage_name) }}</p> <div class="blog-content-spacer"></div> diff --git a/blog/templates/tag.html.j2 b/blog/templates/tag.html.j2 index 951f233..8334c26 100644 --- a/blog/templates/tag.html.j2 +++ b/blog/templates/tag.html.j2 @@ -1,6 +1,6 @@ {% extends "blog_base.html.j2" %} -{% block page_title %}tags/{{ tag }} {{ super() }}{% endblock %} -{% block page_title_short %}tags/{{ tag }}{% endblock %} +{% block page_title %}tags/{{ tag }} - {{ super() }}{% endblock %} +{% block og_page_title %}tags/{{ tag }}{% endblock %} {% block content %} <h1 class="first-element">tags/{{ tag }}/</h1> <p>{{ config.get_tag_prompt(tag, "find other_posts/ -type f -exec head {} +") }}</p> diff --git a/blog/templates/tags.html.j2 b/blog/templates/tags.html.j2 index ea4774a..620aaf7 100644 --- a/blog/templates/tags.html.j2 +++ b/blog/templates/tags.html.j2 @@ -1,6 +1,6 @@ {% extends "blog_base.html.j2" %} -{% block page_title %}tags/ {{ super() }}{% endblock %} -{% block page_title_short %}tags/{% endblock %} +{% block page_title %}tags/ - {{ super() }}{% endblock %} +{% block og_page_title %}tags/{% endblock %} {% block content %} <h1 class="first-element">tags/</h1> <p>{{ config.get_tag_prompt("", "ls .") }}</p> @@ -19,6 +19,7 @@ class Config: BLOG_ROOT_URL = "https://blog.wazul.moe" BLOG_ASSETS_SOURCE_DIR = os.path.join(__DIR, "blog/assets") TEMPLATES_SOURCE_DIR = [ + os.path.join(__DIR, "global/templates"), os.path.join(__DIR, "main/templates"), os.path.join(__DIR, "blog/templates"), os.path.join(__DIR, "comic/templates"), diff --git a/global/templates/base.html.j2 b/global/templates/base.html.j2 new file mode 100644 index 0000000..61826d9 --- /dev/null +++ b/global/templates/base.html.j2 @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<html dir="ltr" lang="en"> +<head> + <meta charset="utf-8"/> + <title>{% block page_title %}{% endblock %}</title> + <meta name="viewport" content="width=device-width, initial-scale=1"/> + <meta property="og:title" content="{% block og_page_title %}{% endblock %}" /> + <meta property="og:type" content="{% block og_type %}{% endblock %}" /> + <meta property="og:url" content="{{ url }}" /> + {% block head_extra %}<link rel="stylesheet" href="{{ site.assets_path_static }}/css/bootstrap-grid.min.css" />{% endblock %} +</head> +<body> +{% block body %}{% endblock %} +</body> +<footer> + {% block footer %}{% endblock %} +</footer> +</html> |
