Compare commits
No commits in common. "c489a6f0763c33e3725adba96dbc728f84b529ad" and "404e951651f4192e6828078a725a51e257e9ebbe" have entirely different histories.
c489a6f076
...
404e951651
8 changed files with 15 additions and 51 deletions
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 %}
|
||||
<center>
|
||||
<time class="post-date" datetime="{{ metadata.date | safe }}"
|
||||
>{{ metadata.date | safe}}</time>
|
||||
</center>
|
||||
{% endif %} {% endif %} {% if is_post %} {% include "post_nav.html" %} {% endif
|
||||
%}
|
||||
{% endif %}
|
||||
<hr>
|
||||
{% endif %}
|
||||
|
||||
<article>{{ content | safe }}</article>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<div class="post-nav">
|
||||
<center>
|
||||
<span class="symbol"><</span>{% if previous %}<a
|
||||
href="{{ previous.url }}"
|
||||
>prev</a>{% endif %}{% if previous and next %}<span class="symbol"
|
||||
>|</span>{% endif %}{% if next %}<a href="{{ next.url }}">next</a>{% endif
|
||||
%}<span class="symbol">></span>
|
||||
</center>
|
||||
</div>
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -237,11 +237,9 @@ 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),
|
||||
path=str(root / "templates"),
|
||||
recursive=True,
|
||||
)
|
||||
observer.start()
|
||||
|
|
|
@ -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,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue