commit 8eb658e5fe92c611fa5f6e7bd0a40b8e3aca4b65 from: Omar Polo date: Sat Nov 07 08:21:03 2020 UTC fix link to gmi files change links to .gmi files to .html when exporting to HTML. This is fine for my use-case at the moment, but in the future an additional check must be made: only relative links and absolute URL to *.omarpolo.com must be hijacked. commit - 70db7fa56630b59ac4fd064799509c5e372bb810 commit + 8eb658e5fe92c611fa5f6e7bd0a40b8e3aca4b65 blob - 9d63e3de165251a480bce636f997aa23a10d392d blob + f7a4722906c7a76d8c2d787904901dcb9c7d1dae --- resources/posts/sndio-over-network.gmi +++ resources/posts/sndio-over-network.gmi @@ -1,6 +1,6 @@ Like I said in the previous entry I don't like to write howtos: the information tend to rot away if not carefully updated, and I don't have all that stamina. Anyway, I felt like writing this, and so here we are. -=> /post/openbsd-tethering.html Previous entry: Automatic USB Tethering on OpenBSD +=> /post/openbsd-tethering.gmi Previous entry: Automatic USB Tethering on OpenBSD Due to events that are outside the scope of this entry, I moved my computer in a place where I cannot comfortably attach a jack to it. (I realized this only after the rearrangement, shame on me!) blob - 465fb98bc05d3f894a9e80d70f3a2f6782cc451a blob + 3ebff976f629fed54fd9d9444ad202433844af29 --- src/blog/gemtext.clj +++ src/blog/gemtext.clj @@ -146,12 +146,20 @@ return a (HTML) link." [[_ href text]] (let [text (html-escape text)] - (if (re-matches #".*\.(jpg|jpeg|png|gif)" href) + (cond + (re-matches #".*\.(jpg|jpeg|png|gif)" href) [:figure [:a {:href href} [:img {:src href :alt text}]] [:figcaption text]] + + ;; TODO: only for local and absolute URL to my site + (re-matches #".*\.gmi" href) + [:p.link [:a {:href (str/replace href #"\.gmi$" ".html")} + text]] + + :else [:p.link [:a {:href href} text]])))