aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAhmed M Alaa <aa@4b.cx>2022-12-05 14:48:27 +0200
committerAhmed M Alaa <aa@4b.cx>2022-12-05 14:48:27 +0200
commit7daa254c0b2be4055a40ef320f44e7d066dca753 (patch)
treea1e5998194299808803a8812d7fe283a0fae0e75 /templates
parent2d7be35ef50d37f5057248d20cbeb1f06fd5cde0 (diff)
added: default taxonomies templates, custom nav links
Diffstat (limited to 'templates')
-rw-r--r--templates/base.html14
-rw-r--r--templates/categories/list.html16
-rw-r--r--templates/categories/single.html26
-rw-r--r--templates/contexts/list.html14
-rw-r--r--templates/contexts/single.html26
-rw-r--r--templates/index.html2
-rw-r--r--templates/page.html18
-rw-r--r--templates/tags/list.html14
-rw-r--r--templates/tags/single.html26
-rw-r--r--templates/taxonomy_list.html1
-rw-r--r--templates/taxonomy_single.html3
11 files changed, 155 insertions, 5 deletions
diff --git a/templates/base.html b/templates/base.html
index e00a202..9e3965f 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -95,6 +95,13 @@
<body theme="auto">
<div class="w">
<header>
+ {% if config.extra.header_nav %}
+ <nav>
+ {% for nav_item in config.extra.header_nav %}
+ <a href="{{ nav_item.url | safe }}">{{ nav_item.name }}</a>
+ {% endfor %}
+ </nav>
+ {% endif %}
{% block header %}{% if title %}<h1>{{ config.title }}</h1>{% endif %}{% endblock header %}
</header>
<main class="page-content" aria-label="Content">
@@ -102,6 +109,13 @@
</main>
<footer>
{% block footer %}{% endblock footer %}
+ {% if config.extra.footer_nav %}
+ <nav>
+ {% for nav_item in config.extra.footer_nav %}
+ <a href="{{ nav_item.url | safe }}">{{ nav_item.name }}</a>
+ {% endfor %}
+ </nav>
+ {% endif %}
</footer>
</div>
</body>
diff --git a/templates/categories/list.html b/templates/categories/list.html
new file mode 100644
index 0000000..83b74fb
--- /dev/null
+++ b/templates/categories/list.html
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+
+{% block header %}
+<p><a href="{{ current_path }}..">..</a>{{ current_path }}</p>
+<h1>{{ taxonomy.name }}</h1>
+{% endblock header %}
+
+{% block content %}
+<ul>
+{% for term in terms %}
+ <li>
+ <a href="{{ term.permalink | safe }}">{{ term.name }}</a> [{{ term.pages | length }}]
+ </li>
+{% endfor %}
+</ul>
+{% endblock content %} \ No newline at end of file
diff --git a/templates/categories/single.html b/templates/categories/single.html
new file mode 100644
index 0000000..7a3ab44
--- /dev/null
+++ b/templates/categories/single.html
@@ -0,0 +1,26 @@
+{% extends "base.html" %}
+
+{% block header %}
+<p><a href="{{ current_path }}">..</a>/{{ term.slug }}/</p>
+<h1>{{ term.name }}</h1>
+{% endblock header %}
+
+{% block content %}
+{% if paginator %}
+{% set pages = paginator.pages %}
+{% else %}
+{% set pages = term.pages %}
+{% endif %}
+<ul>
+{% for page in pages %}
+ <li>
+ <a href="{{ page.permalink | safe }}">{% if page.date %}{{ page.date }} - {% endif %}{{ page.title }}</a>
+ <br />
+ {{ page.description }}
+ </li>
+{% endfor %}
+</ul>
+{% if paginator %}
+<p>{% if paginator.previous %}<a href="{{ paginator.first }}">&lt;&lt; First</a> <a href="{{ paginator.previous }}">&lt; Previous</a>{% endif %} [{{ paginator.current_index }}/{{ paginator.number_pagers }}] {% if paginator.next %}<a href="{{ paginator.next }}">Next &gt;</a> <a href="{{ paginator.last }}">Last &gt;&gt;</a>{% endif %}</p>
+{% endif %}
+{% endblock content %} \ No newline at end of file
diff --git a/templates/contexts/list.html b/templates/contexts/list.html
new file mode 100644
index 0000000..c6a529b
--- /dev/null
+++ b/templates/contexts/list.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+
+{% block header %}
+<p><a href="{{ current_path }}..">..</a>{{ current_path }}</p>
+<h1>{{ taxonomy.name }}</h1>
+{% endblock header %}
+
+{% block content %}
+<p>
+{% for term in terms %}
+<a href="{{ term.permalink | safe }}">@{{ term.name }}</a>
+{% endfor %}
+</p>
+{% endblock content %} \ No newline at end of file
diff --git a/templates/contexts/single.html b/templates/contexts/single.html
new file mode 100644
index 0000000..7a3ab44
--- /dev/null
+++ b/templates/contexts/single.html
@@ -0,0 +1,26 @@
+{% extends "base.html" %}
+
+{% block header %}
+<p><a href="{{ current_path }}">..</a>/{{ term.slug }}/</p>
+<h1>{{ term.name }}</h1>
+{% endblock header %}
+
+{% block content %}
+{% if paginator %}
+{% set pages = paginator.pages %}
+{% else %}
+{% set pages = term.pages %}
+{% endif %}
+<ul>
+{% for page in pages %}
+ <li>
+ <a href="{{ page.permalink | safe }}">{% if page.date %}{{ page.date }} - {% endif %}{{ page.title }}</a>
+ <br />
+ {{ page.description }}
+ </li>
+{% endfor %}
+</ul>
+{% if paginator %}
+<p>{% if paginator.previous %}<a href="{{ paginator.first }}">&lt;&lt; First</a> <a href="{{ paginator.previous }}">&lt; Previous</a>{% endif %} [{{ paginator.current_index }}/{{ paginator.number_pagers }}] {% if paginator.next %}<a href="{{ paginator.next }}">Next &gt;</a> <a href="{{ paginator.last }}">Last &gt;&gt;</a>{% endif %}</p>
+{% endif %}
+{% endblock content %} \ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
index 40487bc..dafb0e4 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -12,7 +12,7 @@
<ul>
{% for page in pages %}
<li>
- <a href="{{ page.permalink | safe }}">{{ page.date }} - {{ page.title }}</a>
+ <a href="{{ page.permalink | safe }}">{% if page.date %}{{ page.date }} - {% endif %}{{ page.title }}</a>
<br />
{{ page.description }}
</li>
diff --git a/templates/page.html b/templates/page.html
index 1e395e3..aab169f 100644
--- a/templates/page.html
+++ b/templates/page.html
@@ -29,4 +29,20 @@ Table of contents
{% endif %}
{{ page.content | safe }}
-{% endblock content %} \ No newline at end of file
+{% endblock content %}
+
+{% block footer %}
+<p class="taxonomies">
+{% if page.taxonomies.tags %}
+{% for tag in page.taxonomies.tags %}
+<a href="/tags/{{ tag | slugify }}">#{{ tag }}</a>
+{% endfor %}
+{% for category in page.taxonomies.categories %}
+<a href="/categories/{{ category | slugify }}">+{{ category }}</a>
+{% endfor %}
+{% for context in page.taxonomies.contexts %}
+<a href="/contexts/{{ context | slugify }}">@{{ context }}</a>
+{% endfor %}
+{% endif %}
+</p>
+{% endblock footer %} \ No newline at end of file
diff --git a/templates/tags/list.html b/templates/tags/list.html
new file mode 100644
index 0000000..11d1282
--- /dev/null
+++ b/templates/tags/list.html
@@ -0,0 +1,14 @@
+{% extends "base.html" %}
+
+{% block header %}
+<p><a href="{{ current_path }}..">..</a>{{ current_path }}</p>
+<h1>{{ taxonomy.name }}</h1>
+{% endblock header %}
+
+{% block content %}
+<p>
+{% for term in terms %}
+<a href="{{ term.permalink | safe }}">#{{ term.name }}</a>[{{ term.pages | length }}]
+{% endfor %}
+</p>
+{% endblock content %} \ No newline at end of file
diff --git a/templates/tags/single.html b/templates/tags/single.html
new file mode 100644
index 0000000..7a3ab44
--- /dev/null
+++ b/templates/tags/single.html
@@ -0,0 +1,26 @@
+{% extends "base.html" %}
+
+{% block header %}
+<p><a href="{{ current_path }}">..</a>/{{ term.slug }}/</p>
+<h1>{{ term.name }}</h1>
+{% endblock header %}
+
+{% block content %}
+{% if paginator %}
+{% set pages = paginator.pages %}
+{% else %}
+{% set pages = term.pages %}
+{% endif %}
+<ul>
+{% for page in pages %}
+ <li>
+ <a href="{{ page.permalink | safe }}">{% if page.date %}{{ page.date }} - {% endif %}{{ page.title }}</a>
+ <br />
+ {{ page.description }}
+ </li>
+{% endfor %}
+</ul>
+{% if paginator %}
+<p>{% if paginator.previous %}<a href="{{ paginator.first }}">&lt;&lt; First</a> <a href="{{ paginator.previous }}">&lt; Previous</a>{% endif %} [{{ paginator.current_index }}/{{ paginator.number_pagers }}] {% if paginator.next %}<a href="{{ paginator.next }}">Next &gt;</a> <a href="{{ paginator.last }}">Last &gt;&gt;</a>{% endif %}</p>
+{% endif %}
+{% endblock content %} \ No newline at end of file
diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html
index e27d135..37577ed 100644
--- a/templates/taxonomy_list.html
+++ b/templates/taxonomy_list.html
@@ -2,7 +2,6 @@
{% block header %}
<p><a href="{{ current_path }}..">..</a>{{ current_path }}</p>
-
<h1>{{ taxonomy.name }}</h1>
{% endblock header %}
diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html
index 934cea5..7a3ab44 100644
--- a/templates/taxonomy_single.html
+++ b/templates/taxonomy_single.html
@@ -2,7 +2,6 @@
{% block header %}
<p><a href="{{ current_path }}">..</a>/{{ term.slug }}/</p>
-
<h1>{{ term.name }}</h1>
{% endblock header %}
@@ -15,7 +14,7 @@
<ul>
{% for page in pages %}
<li>
- <a href="{{ page.permalink | safe }}">{{ page.date }} - {{ page.title }}</a>
+ <a href="{{ page.permalink | safe }}">{% if page.date %}{{ page.date }} - {% endif %}{{ page.title }}</a>
<br />
{{ page.description }}
</li>