diff --git a/omicron/ssg/site.py b/omicron/ssg/site.py index 4bd04fa..1312112 100644 --- a/omicron/ssg/site.py +++ b/omicron/ssg/site.py @@ -1,6 +1,6 @@ import logging import shutil -from typing import Any, cast +from typing import Any, Literal, cast from urllib.parse import urlparse from omicron.ssg.output import ( @@ -155,6 +155,12 @@ class Site: def tags_url(self) -> str: return self.by_path[Tags.PATH].url + def feed_url( + self, kind: Literal["root", "section"], label: str | None + ) -> str | None: + output = self.by_path.get(Feed.build_path(kind, label)) + return output.url if output else None + def update_tags_by_count(self) -> None: tags = [(tag, len(items)) for tag, items in self.by_tag.items()] tags.sort(key=lambda x: x[1], reverse=True) diff --git a/omicron/ssg/templates/plain/base.html b/omicron/ssg/templates/plain/base.html index 3af903a..c96278a 100644 --- a/omicron/ssg/templates/plain/base.html +++ b/omicron/ssg/templates/plain/base.html @@ -7,6 +7,7 @@ {% if site.origin %}{% endif %} + {% if site.feed_url("root", None) %}{% endif %} {% block head %}{% endblock %} diff --git a/omicron/ssg/templates/plain/index.html b/omicron/ssg/templates/plain/index.html index b6f3ef4..4e8abb8 100644 --- a/omicron/ssg/templates/plain/index.html +++ b/omicron/ssg/templates/plain/index.html @@ -4,6 +4,9 @@ {% block head %} {% if page.page_num > 1 %}{% endif %} +{% if page.kind == "section" %} + +{% endif %} {% endblock %} {% block breadcrumb %}