diff options
author | Vasudev Kamath <vasudev@copyninja.info> | 2017-05-07 19:58:39 +0530 |
---|---|---|
committer | Vasudev Kamath <vasudev@copyninja.info> | 2017-05-07 19:58:39 +0530 |
commit | 7c08afd343e19c35151fc614611151033b7f2ad1 (patch) | |
tree | 786e0fc26bf70c193dd23412eedfa855a4622cce | |
parent | 073089162f8be3d6eb77d471055fcce3773f0b39 (diff) |
More fine tuning of template
Allow smooth navigation and move redundant information to base.html.
-rw-r--r-- | templates/article.html | 8 | ||||
-rw-r--r-- | templates/base.html | 17 | ||||
-rw-r--r-- | templates/categories.html | 1 | ||||
-rw-r--r-- | templates/category.html | 1 | ||||
-rw-r--r-- | templates/index.html | 7 | ||||
-rw-r--r-- | templates/tag.html | 6 | ||||
-rw-r--r-- | templates/tags.html | 3 |
7 files changed, 24 insertions, 19 deletions
diff --git a/templates/article.html b/templates/article.html index 630323b..e00ffdc 100644 --- a/templates/article.html +++ b/templates/article.html @@ -1,10 +1,6 @@ {% extends "base.html" %} -{% block menu %} - | <a href="{{ SITEURL }}">Home</a> | - {% for p in PAGES %} - | <a href="{{ SITEURL}}/{{p.url}}">{{p.title}}</a> | - {% endfor %} -{% endblock %} +{% block title %} {{ article.title}} {%endblock title %} +{% block home %} | <a href="{{ SITEURL }}">Home</a> | {% endblock %} {% block article %} <h1><a href="{{ SITEURL }}/{{ article.url}}">{{ article.title |striptags }}</a></h1> diff --git a/templates/base.html b/templates/base.html index 75ef425..e1dd592 100644 --- a/templates/base.html +++ b/templates/base.html @@ -36,11 +36,18 @@ </head> <body> - <div id="header" class="body"> - <div id="navigation"> - {% block menu %} - {% endblock %} - </div> + <div id="header" class="body"> + <div id="navigation"> + {% block home %} + {% endblock %} + {% block menu %} + {% for p in pages %} + | <a href="{{ SITEURL}}/{{p.url}}">{{p.title}}</a> | + {% endfor %} + | <a href="{{ SITEURL }}/categories.html">Categories</a> | + | <a href="{{ SITEURL }}/tags.html">Tags</a> | + {% endblock %} + </div> {% block article %} {% endblock %} {% block page %} diff --git a/templates/categories.html b/templates/categories.html index e29be0c..dcdf3b8 100644 --- a/templates/categories.html +++ b/templates/categories.html @@ -1,4 +1,5 @@ {% extends "base.html" %} +{% block home %} | <a href="{{ SITEURL }}">Home</a> | {% endblock %} {% block content %} <ul> {% for category, articles in categories %} diff --git a/templates/category.html b/templates/category.html index 4e6fd24..e30f3ec 100644 --- a/templates/category.html +++ b/templates/category.html @@ -1,4 +1,5 @@ {% extends "index.html" %} +{% block home %} | <a href="{{ SITEURL }}">Home</a> | {% endblock %} {% block content_title %} <h2>Articles in the {{ category }} category</h2> {% endblock %} diff --git a/templates/index.html b/templates/index.html index 429020e..98e5f15 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,11 +1,6 @@ {% extends "base.html" %} -{% block menu %} - {% for p in PAGES %} - | <a href="{{ SITEURL}}/{{p.url}}">{{p.title}}</a> | - {% endfor %} -<h1><a href="{{ SITEURL }}">Home</a></h1> -{% endblock %} {% block content %} +<h1><a href="{{ SITEURL }}">Random Ramblings</a></h1> <section id="content"> {% block content_title %} <h2>All articles</h2> diff --git a/templates/tag.html b/templates/tag.html index e69de29..b2cda7a 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -0,0 +1,6 @@ +{% extends "index.html" %} +{% block title %} {{SITENAME}} - Tag {{tag}} {% endblock %} +{% block home %} | <a href="{{ SITEURL }}">Home</a> | {% endblock %} +{% block content_title %} +<h2>Articles in the {{ tag }} tag</h2> +{% endblock %} diff --git a/templates/tags.html b/templates/tags.html index b5d1482..d38c107 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -1,7 +1,6 @@ {% extends "base.html" %} - {% block title %}{{ SITENAME }} - Tags{% endblock %} - +{% block home %} | <a href="{{ SITEURL }}">Home</a> | {% endblock %} {% block content %} <h1>Tags for {{ SITENAME }}</h1> {%- for tag, articles in tags|sort %} |