summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2023-01-24 13:19:23 +0100
committerBrian Picciano <mediocregopher@gmail.com>2023-01-24 13:19:23 +0100
commit3f97311514902ae76a905f7c8e7ed7031b4121de (patch)
tree13e631c223c088ac47366380c66a815bdcde21bb
parentb766eefe7cfaf334aeb607171250a2b4b9eaabf0 (diff)
Add notice atop md->gmi translated pages
-rw-r--r--src/gmi/tpl.go4
-rw-r--r--src/gmi/tpl/posts/post.gmi8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gmi/tpl.go b/src/gmi/tpl.go
index 5777024..ae94bc6 100644
--- a/src/gmi/tpl.go
+++ b/src/gmi/tpl.go
@@ -203,6 +203,10 @@ func (a *api) tplHandler() (gemini.Handler, error) {
path := filepath.Join("posts", id) + ".gmi"
return blogURL(a.params.PublicURL, path, true)
},
+ "PostHTTPURL": func(id string) string {
+ path := filepath.Join("posts", id)
+ return preprocessFuncs.BlogHTTPURL(path)
+ },
})
err := fs.WalkDir(tplFS, "tpl", func(path string, d fs.DirEntry, err error) error {
diff --git a/src/gmi/tpl/posts/post.gmi b/src/gmi/tpl/posts/post.gmi
index 0e7cd74..09d20fe 100644
--- a/src/gmi/tpl/posts/post.gmi
+++ b/src/gmi/tpl/posts/post.gmi
@@ -1,5 +1,13 @@
{{ $post := .GetPostByID (.GetQueryValue "id" "") -}}
+{{ if eq $post.Format "md" -}}
+This post has been translated from it's original markdown format, if it seems
+busted it might appear better over HTTP:
+
+=> {{ PostHTTPURL $post.ID }}
+
+{{ end -}}
+
# {{ $post.Title }}
{{ if ne $post.Description "" -}}