]> xn--ix-yja.es Git - alex.git/commitdiff
Add edit link to HTML version
authoralex <alex@pdp7.net>
Sun, 8 Oct 2023 18:53:57 +0000 (20:53 +0200)
committeralex <alex@pdp7.net>
Sun, 8 Oct 2023 18:53:57 +0000 (20:53 +0200)
blog_experiment/blog/blog_pages.py

index 065e4881072709f79ef89e8acc9378f2ac501229..132e56d268c170655308199ec75c819ad90322f7 100644 (file)
@@ -30,6 +30,10 @@ class Entry:
     def uri(self):
         return f"/{self.path.parts[1]}/{self.path.parts[2]}/{self.path.stem}/"
 
+    @property
+    def edit_url(self):
+        return f"https://github.com/alexpdp7/gemini_blog/edit/master/content{self.uri[:-1]}.gmi"
+
     def html(self):
         parsed = gemtext.parse(self.content)
 
@@ -103,6 +107,7 @@ class Entry:
 
             assert False, f"unknown element {gem_element}"
 
+        result.append(h.P(h.A("Editar", href=self.edit_url)))
         return result