]> xn--ix-yja.es Git - alex.git/commitdiff
Point to Gemini
authoralex <alex@pdp7.net>
Tue, 17 Dec 2024 18:34:46 +0000 (19:34 +0100)
committeralexpdp7 <alex@corcoles.net>
Tue, 17 Dec 2024 18:35:42 +0000 (19:35 +0100)
blog/blog/blog_pages.py
blog/blog/html.py

index 08262cdb659d64129681a23da18e39ef0dac47e8..1a445b514e49b20fca050c0d8b9dbeff6d67e06a 100644 (file)
@@ -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,
             ),
         )
index d38fff7947681e310d1b0337589d7c659734d76a..d34817444b7eada719f4e5cdbfab70509a2ba4c7 100644 (file)
@@ -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,