diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-01-02 22:40:14 +0000 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-01-02 22:40:14 +0000 |
commit | 19900890799668d96e2daf64c820b4e3957bee5c (patch) | |
tree | 363d1ef66413fedaabe49b02fc4b945a45be3014 /crumbs/templates | |
parent | de036f830d3670cce37513f4fe6cf3208c8aaaca (diff) |
crumbs: basically rewriting the theme to be less complicated
Diffstat (limited to 'crumbs/templates')
-rw-r--r-- | crumbs/templates/article.html | 39 | ||||
-rw-r--r-- | crumbs/templates/base.html | 46 | ||||
-rw-r--r-- | crumbs/templates/category.html | 28 | ||||
-rw-r--r-- | crumbs/templates/components/article_header.html | 18 | ||||
-rw-r--r-- | crumbs/templates/components/card_content.html | 14 | ||||
-rw-r--r-- | crumbs/templates/components/gay.html (renamed from crumbs/templates/components/super_gay.html) | 0 | ||||
-rw-r--r-- | crumbs/templates/components/html_head.html | 18 | ||||
-rw-r--r-- | crumbs/templates/components/links.html (renamed from crumbs/templates/components/link_generator.html) | 5 | ||||
-rw-r--r-- | crumbs/templates/components/navbar_generator.html | 8 | ||||
-rw-r--r-- | crumbs/templates/components/title.html | 8 | ||||
-rw-r--r-- | crumbs/templates/components/title_text.html | 13 | ||||
-rw-r--r-- | crumbs/templates/home.html | 27 | ||||
-rw-r--r-- | crumbs/templates/keys.html | 34 | ||||
-rw-r--r-- | crumbs/templates/normal.html | 18 | ||||
-rw-r--r-- | crumbs/templates/page.html | 22 |
15 files changed, 140 insertions, 158 deletions
diff --git a/crumbs/templates/article.html b/crumbs/templates/article.html index f156bfa..07bb368 100644 --- a/crumbs/templates/article.html +++ b/crumbs/templates/article.html @@ -1,6 +1,4 @@ -{% extends "normal.html" %} - -{% block title %}{{ article.title }} {% endblock title %} +{% extends "base.html" %} {% block metatags %} {% autoescape true %} @@ -26,8 +24,35 @@ {% endautoescape %} {% endblock metatags %} -{% block content %} - {% with type='single' %} - {% include "components/card_content.html" %} - {% endwith %} + +{% block body %} +<div class="gay nav"> + {% include "components/title.html" %} + {% include "components/links.html" %} +</div> + +{% include "components/gay.html" %} + +<div class="content"> + <h1>{{ article.title }}</h1> + + <div class="header"> + <hr/> + <a href="{{ SITEURL }}/{{ article.category|lower }}"> ⇠ back</a> + {% if article.tags|length > 0 %} + <span> | tags:</span> + {% for tag in article.tags|sort %} + <span><strong>{{ tag }}</strong>{% if loop.index < article.tags|length %}, </span>{% endif %} + {% endfor %} + {% endif %} + <span> | duration: <strong>{{article.read_time_string}}</strong></span> + <hr/> + </div> + + + <div class="article"> + {{ article.content }} + </div> + +</div> {% endblock %} diff --git a/crumbs/templates/base.html b/crumbs/templates/base.html index 43eab3a..c655cea 100644 --- a/crumbs/templates/base.html +++ b/crumbs/templates/base.html @@ -1,26 +1,34 @@ <!DOCTYPE html> <html lang="{{ DEFAULT_LANG }}"> + <head> + {% block metatags %}{% endblock %} - <head> - {% block metatags %} - {% endblock %} - {% block head %} - {% endblock %} - </head> + <title>{{ SITENAME }}</title> - {% block body %} - <body> - <div class="container"> - {% block wrapped %} - {% endblock %} + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> - {# This can be used for a footer #} - <div> - {% block footer %} - {% endblock %} - </div> + {# Mastodon verification link #} + <a rel="me" href="https://octodon.social/@spacekookie"></a> + + <link href="{{ SITEURL }}/theme/css/crumbs.css" rel="stylesheet"> + {% block css %}{% endblock %} + + <!-- TODO: remove --> + <link href="https://fonts.googleapis.com/css?family=Montserrat:400,600" rel="stylesheet"> + + <!-- TODO: remove --> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.6/css/all.css"> + <link rel="alternate" type="application/rss+xml" href="{{ SITEURL }}/rss.xml" title="{{ SITENAME }} — Latest Posts" /> + </head> + + <body> + <div class="wrap"> + {# Wrappen body block #} + {% block body %}{% endblock %} - </div> - </body> - {% endblock %} + {# Footer only used on 'home' #} + {% block footer %}{% endblock %} + </div> + </body> </html> diff --git a/crumbs/templates/category.html b/crumbs/templates/category.html index 39ff421..22e0081 100644 --- a/crumbs/templates/category.html +++ b/crumbs/templates/category.html @@ -1,11 +1,21 @@ -{% extends "normal.html" %} +{% extends "base.html" %} -{% block title %} {{ category }} {% endblock title %} +{% block body %} +<div class="gay nav"> + {% include "components/title.html" %} + {% include "components/links.html" %} +</div> -{% block content %} - {% for article in articles %} - {% with type='multi' %} - {% include "components/card_content.html" %} - {% endwith %} - {% endfor %} -{% endblock content %} +{% include "components/gay.html" %} + +<div class="content"> + <h1>{{ category }}</h1> + + {% for article in articles %} + <ul class="list"> + <li><time class="date">{{ article.locale_date }}</time> + <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></li> + </ul> + {% endfor %} +</div> +{% endblock %} diff --git a/crumbs/templates/components/article_header.html b/crumbs/templates/components/article_header.html deleted file mode 100644 index c8839c7..0000000 --- a/crumbs/templates/components/article_header.html +++ /dev/null @@ -1,18 +0,0 @@ -{% if type == 'single' %} -<h3 class="card-header-url"><a href="{{ SITEURL }}/{{ article.category|lower }}"> ⇠ Back</a></h3> -{% else %} -<h2 class="card-header-url"><b><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></b></h2> -{% endif %} - -<div class="article-meta"> - <p> - {% if article.tags|length > 0 %} - {% for tag in article.tags|sort %} - <strong>{{ tag }} |</strong> - {% endfor %} - Tags - {% endif %} - </p> - <p>Published <span class="tc-brown"><strong>{{ article.locale_date }}</strong></span></p> - <p>This article takes <span class="tc-brown"><strong>{{article.read_time_string}}</strong></span> to read.</p> -</div>
\ No newline at end of file diff --git a/crumbs/templates/components/card_content.html b/crumbs/templates/components/card_content.html deleted file mode 100644 index c46f9ee..0000000 --- a/crumbs/templates/components/card_content.html +++ /dev/null @@ -1,14 +0,0 @@ - -<div class="card"> - <div class="card-header"> - {% include "components/article_header.html" %} - </div> - - <div class="card-content"> - {% if type == 'single' %} - {{ article.content }} - {% else %} - {{ article.summary }} - {% endif %} - </div> -</div> diff --git a/crumbs/templates/components/super_gay.html b/crumbs/templates/components/gay.html index 6089ec4..6089ec4 100644 --- a/crumbs/templates/components/super_gay.html +++ b/crumbs/templates/components/gay.html diff --git a/crumbs/templates/components/html_head.html b/crumbs/templates/components/html_head.html deleted file mode 100644 index 0082421..0000000 --- a/crumbs/templates/components/html_head.html +++ /dev/null @@ -1,18 +0,0 @@ -<meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1"> -<title>{{ SITENAME }}</title> - -{% if type == 'home' %} -<link href="{{ SITEURL }}/theme/css/crumbs.css" rel="stylesheet"> -<link href="{{ SITEURL }}/theme/css/cr_title.css" rel="stylesheet"> {# This contains various overrides #} -<a rel="me" href="https://octodon.social/@spacekookie"></a> -{% else %} -<link href="{{ SITEURL }}/theme/css/pygment.css" rel="stylesheet"> -<link href="{{ SITEURL }}/theme/css/crumbs.css" rel="stylesheet"> -{% endif %} - -<link href="https://fonts.googleapis.com/css?family=Montserrat:400,600" rel="stylesheet"> - -<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.6/css/all.css"> -<link rel="alternate" type="application/rss+xml" href="{{ SITEURL }}/rss.xml" title="{{ SITENAME }} — Latest Posts" /> - diff --git a/crumbs/templates/components/link_generator.html b/crumbs/templates/components/links.html index 7c7dc6a..d081bef 100644 --- a/crumbs/templates/components/link_generator.html +++ b/crumbs/templates/components/links.html @@ -1,8 +1,9 @@ +{# GENERATE LINK SECTION #} + {% for title, link in MENUITEMS %} - {# Do magic with http/https #} {% if 'http://' in link or 'https://' in link %} <a class="nav-item" href="{{ link }}">{{ title }} </a> {% else %} <a class="nav-item" href="{{ SITEURL }}{{ link }}">{{ title }} </a> {% endif %} -{% endfor %}
\ No newline at end of file +{% endfor %} diff --git a/crumbs/templates/components/navbar_generator.html b/crumbs/templates/components/navbar_generator.html deleted file mode 100644 index 07121ca..0000000 --- a/crumbs/templates/components/navbar_generator.html +++ /dev/null @@ -1,8 +0,0 @@ -<div class="navigation"> - {% if type == 'home' %} - {% include "components/link_generator.html" %} - {% else %} - {% with title_type='page-title' %} {% include "components/title_text.html" %} {% endwith %} - {% include "components/link_generator.html" %} - {% endif %} -</div> diff --git a/crumbs/templates/components/title.html b/crumbs/templates/components/title.html new file mode 100644 index 0000000..3c914ba --- /dev/null +++ b/crumbs/templates/components/title.html @@ -0,0 +1,8 @@ +{# GENERATE HEADER TITLE #} +<div class="title"> + <span id="t-color-red"><b># ~ </b></span> + <span id="t-color-org">fun</span> + <span id="t-color-ylw">memory</span> + <span id="t-color-grn">violations</span> + <span class="cursor">▁</span> +</div> diff --git a/crumbs/templates/components/title_text.html b/crumbs/templates/components/title_text.html deleted file mode 100644 index a77477c..0000000 --- a/crumbs/templates/components/title_text.html +++ /dev/null @@ -1,13 +0,0 @@ -<div class="{{ title_type }}" title="Inconsolata is my favourite monospace font, after all..."> - {% if title_type == 'title' %} - <h1> - {% endif %} - <span id="t-color-red"><b># ~ </b></span> - <span id="t-color-org">fun</span> - <span id="t-color-ylw">memory</span> - <span id="t-color-grn">violations</span> - <span class="cursor" id="cursor"> ▁</span> - {% if title_type == 'title' %} - </h1> - {% endif %} -</div> diff --git a/crumbs/templates/home.html b/crumbs/templates/home.html index 0f3774c..65bb385 100644 --- a/crumbs/templates/home.html +++ b/crumbs/templates/home.html @@ -1,16 +1,21 @@ {% extends "base.html" %} -{# Define what html head we include #} -{% block head %} - {% with type='home' %} - {% include "components/html_head.html" %} - {% endwith %} -{% endblock head %} +{% block css %} +<link href="{{ SITEURL }}/theme/css/home.css" rel="stylesheet"> +{% endblock %} + +{% block body %} +<div class="gay nav"> + {% include "components/links.html" %} +</div> + +{% include "components/title.html" %} +{% include "components/gay.html" %} -{% block wrapped %} - {% with type='home' %} {% include "components/navbar_generator.html" %} {% endwith %} - {% with title_type='title' %} {% include "components/title_text.html" %} {% endwith %} - {% include "components/super_gay.html" %} +<div> +{{ page.content }} +</div> - {{ page.content }} {% endblock %} + + diff --git a/crumbs/templates/keys.html b/crumbs/templates/keys.html index e1b98ee..a498ae3 100644 --- a/crumbs/templates/keys.html +++ b/crumbs/templates/keys.html @@ -1,19 +1,25 @@ -{% extends "normal.html" %} +{% extends "base.html" %} -{% block title %}{{ page.title }} {% endblock title %} +{% block body %} +<div class="gay nav"> + {% include "components/title.html" %} + {% include "components/links.html" %} +</div> -{% block content %} -<div class="card"> - <div class="card-content"> - {{ page.content }} - - <p>Following is a signed key statement:</p> +{% include "components/gay.html" %} - <pre class="keys"> - {% include "keys.txt" %} - </pre> - </div> -</div> -{% endblock %} +<div class="content"> + <h1>Keys</h1> + <div class="article"> + {{ page.content }} + + <p>Following is a signed key statement:</p> + <pre class="keys"> + {% include "keys.txt" %} + </pre> + </div> + +</div> +{% endblock %} diff --git a/crumbs/templates/normal.html b/crumbs/templates/normal.html deleted file mode 100644 index 4c58b7b..0000000 --- a/crumbs/templates/normal.html +++ /dev/null @@ -1,18 +0,0 @@ -{% extends "base.html" %} - -{# Define what html head we include #} -{% block head %} - {% with type='base' %} - {% include "components/html_head.html" %} - {% endwith %} -{% endblock head %} - -{% block wrapped %} - {% with type='normal' %} {% include "components/navbar_generator.html" %} {% endwith %} - {% include "components/super_gay.html" %} - - <h1 class="normal">{% block title %}{% endblock %}</h1> - - {% block content %} - {% endblock %} -{% endblock %}
\ No newline at end of file diff --git a/crumbs/templates/page.html b/crumbs/templates/page.html index 2312a15..fca02b8 100644 --- a/crumbs/templates/page.html +++ b/crumbs/templates/page.html @@ -1,11 +1,19 @@ -{% extends "normal.html" %} +{% extends "base.html" %} -{% block title %}{{ page.title }} {% endblock title %} +{% block body %} +<div class="gay nav"> + {% include "components/title.html" %} + {% include "components/links.html" %} +</div> + +{% include "components/gay.html" %} + +<div class="content"> + <h1>{{ page.title }}</h1> + + <div class="article"> + {{ page.content }} + </div> -{% block content %} -<div class="card"> - <div class="card-content"> - {{ page.content }} - </div> </div> {% endblock %} |