diff --git a/src/zona/builder.py b/src/zona/builder.py index c53701e..446f07d 100644 --- a/src/zona/builder.py +++ b/src/zona/builder.py @@ -99,13 +99,6 @@ class ZonaBuilder: else date.min, reverse=True, ) - posts = len(post_list) - for i, item in enumerate(post_list): - prev = post_list[i - 1] if i > 0 else None - next = post_list[i + 1] if i < posts - 2 else None - item.previous = prev - item.next = next - templater = Templater( config=self.config, template_dir=self.layout.templates, diff --git a/src/zona/data/content/static/style.css b/src/zona/data/content/static/style.css index f02717e..d2cacf0 100644 --- a/src/zona/data/content/static/style.css +++ b/src/zona/data/content/static/style.css @@ -31,18 +31,6 @@ header { text-transform: lowercase; } -.post-nav { - font-family: monospace; -} - -.post-nav .symbol { - color: var(--main-bullet-color); -} - -.post-nav a { - margin: 0 2px; -} - .site-logo { color: inherit; font-weight: bold; diff --git a/src/zona/data/templates/page.html b/src/zona/data/templates/page.html index 0c22f8b..fd3cdb4 100644 --- a/src/zona/data/templates/page.html +++ b/src/zona/data/templates/page.html @@ -1,12 +1,18 @@ -{% extends "base.html" %} {% block content %} {% if metadata.show_title %} {% -include "title.html" %} {% if metadata.date %} +{% extends "base.html" %} {% block content %} + +{% if metadata.show_title %} +{% include "title.html" %} +{% if metadata.date %}
-{% endif %} {% endif %} {% if is_post %} {% include "post_nav.html" %} {% endif -%} +{% endif %}
+{% endif %}
{{ content | safe }}
{% endblock %} + + + diff --git a/src/zona/data/templates/post_nav.html b/src/zona/data/templates/post_nav.html deleted file mode 100644 index 324f110..0000000 --- a/src/zona/data/templates/post_nav.html +++ /dev/null @@ -1,9 +0,0 @@ -
-
- <{% if previous %}prev{% endif %}{% if previous and next %}|{% endif %}{% if next %}next{% endif - %}> -
-
diff --git a/src/zona/metadata.py b/src/zona/metadata.py index 98b14cf..0cd6a8c 100644 --- a/src/zona/metadata.py +++ b/src/zona/metadata.py @@ -18,8 +18,6 @@ class Metadata: date: date description: str | None show_title: bool = True - show_date: bool = True - show_nav: bool = True style: str | None = "/static/style.css" header: bool = True footer: bool = True diff --git a/src/zona/models.py b/src/zona/models.py index d009476..2e7721c 100644 --- a/src/zona/models.py +++ b/src/zona/models.py @@ -1,5 +1,3 @@ -from __future__ import annotations - from dataclasses import dataclass from enum import Enum from pathlib import Path @@ -23,8 +21,6 @@ class Item: type: ItemType | None = None copy: bool = True post: bool = False - next: Item | None = None - previous: Item | None = None # @dataclass diff --git a/src/zona/server.py b/src/zona/server.py index f8b0000..82e6381 100644 --- a/src/zona/server.py +++ b/src/zona/server.py @@ -237,13 +237,11 @@ def serve( observer.schedule( event_handler, path=str(root / "content"), recursive=True ) - templates = root / "templates" - if templates.is_dir(): - observer.schedule( - event_handler, - path=str(templates), - recursive=True, - ) + observer.schedule( + event_handler, + path=str(root / "templates"), + recursive=True, + ) observer.start() # function to shut down gracefully diff --git a/src/zona/templates.py b/src/zona/templates.py index fe1e6dd..872762c 100644 --- a/src/zona/templates.py +++ b/src/zona/templates.py @@ -3,7 +3,6 @@ from typing import Literal from jinja2 import Environment, FileSystemLoader, select_autoescape -from zona import util from zona.config import ZonaConfig from zona.markdown import md_to_html from zona.models import Item @@ -77,10 +76,5 @@ class Templater: metadata=meta, header=header, footer=footer, - is_post=item.post, - next=util.normalize_url(item.next.url) if item.next else None, - previous=util.normalize_url(item.previous.url) - if item.previous - else None, post_list=self.post_list, )