aboutsummaryrefslogtreecommitdiff
path: root/blog
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2024-12-17 19:34:46 +0100
committeralexpdp7 <alex@corcoles.net>2024-12-17 19:35:42 +0100
commite567682fb673058f19350daa198ae6f3787404c9 (patch)
treef6a05825225300a148c5268eed7f2ba6fafc259b /blog
parentc491a6f852fd3618b0e78775f27a4e38e6863b4e (diff)
Point to Gemini
Diffstat (limited to 'blog')
-rw-r--r--blog/blog/blog_pages.py3
-rw-r--r--blog/blog/html.py10
2 files changed, 11 insertions, 2 deletions
diff --git a/blog/blog/blog_pages.py b/blog/blog/blog_pages.py
index 08262cdb..1a445b51 100644
--- a/blog/blog/blog_pages.py
+++ b/blog/blog/blog_pages.py
@@ -84,7 +84,7 @@ class Root(page.BasePage):
return (
bicephalus.Status.OK,
"text/html",
- html.html_template(*itertools.chain(posts), full=True),
+ html.html_template(*itertools.chain(posts), path=self.request.path, full=True),
)
def feed(self):
@@ -138,6 +138,7 @@ class EntryPage(page.BasePage):
html.html_template(
*self.entry.html(),
page_title=f"{self.entry.title} - {self.entry.posted}",
+ path=self.request.path,
full=False,
),
)
diff --git a/blog/blog/html.py b/blog/blog/html.py
index d38fff79..d3481744 100644
--- a/blog/blog/html.py
+++ b/blog/blog/html.py
@@ -6,7 +6,7 @@ import htmlgenerator as h
from blog import meta, pretty, gemtext
-def html_template(*content, page_title=None, full):
+def html_template(*content, page_title=None, path, full):
title = [h.A(meta.TITLE, href=f"{meta.SCHEMA}://{meta.HOST}")]
if page_title:
title += f" - {page_title}"
@@ -25,6 +25,8 @@ def html_template(*content, page_title=None, full):
h.P(*links),
]
+ gemini_url = f"gemini://alex.corcoles.net{path}"
+
return pretty.pretty_html(h.render(
h.HTML(
h.HEAD(
@@ -47,6 +49,12 @@ def html_template(*content, page_title=None, full):
""").lstrip())
),
h.BODY(
+ h.P(
+ "Contenido tambien disponible en Gemini en ",
+ h.A(gemini_url, href=gemini_url),
+ ". ",
+ h.A("Información sobre Gemini.", href="https://geminiprotocol.net/"),
+ ),
h.H1(title),
*full_part,
*content,