Add fediverse link to posts in July 2024 or later

This commit is contained in:
mez 2025-06-25 20:23:16 +01:00
parent b35dcf2e2b
commit 6d71a8b844

View file

@ -29,7 +29,12 @@
t
nil))
(setq org-html-head (concat "<meta property=\"og:title\" content=\"" thetitle "\">\n<meta property=\"og:type\" content=\"article\">\n<meta property=\"og:image\" content=\"https://tre.praze.net/ab.png\">\n<meta property=\"og:url\" content=\"https://tre.praze.net/notes/" pageurl "\">\n<meta name=\"description\" property=\"og:description\" content=\"" thedesc "\">\n<meta property=\"og:locale\" content=\"en_GB\">\n<meta property=\"og:site_name\" content=\"tre.praze.net\">\n<meta name=\"fediverse:creator\" content=\"@tre@praze.net\">\n<link rel=\"stylesheet\" href=\"/new.css\">\n<link rel=\"me\" href=\"https://kes.praze.net/@tre\">\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"tre.praze.net\" href=\"/feed.xml\">\n<link rel=\"alternate\" type=\"application/activity+json\" href=\"https://fed.brid.gy/r/https://tre.praze.net/notes/" pageurl "\">\n<meta name=\"theme-color\" content=\"#f2f2f2\" />\n<noscript>\n <style>.jsonly{display:none;}</style>\n</noscript>"))
(setq thedate (concat (substring (file-name-base) 0 4) (substring (file-name-base) 5 7) (substring (file-name-base) 8 10)))
(if (> (string-to-number thedate) 20240700)
(setq bridged t)
(setq bridged nil))
(setq org-html-head (concat "<meta property=\"og:title\" content=\"" thetitle "\">\n<meta property=\"og:type\" content=\"article\">\n<meta property=\"og:image\" content=\"https://tre.praze.net/ab.png\">\n<meta property=\"og:url\" content=\"https://tre.praze.net/notes/" pageurl "\">\n<meta name=\"description\" property=\"og:description\" content=\"" thedesc "\">\n<meta property=\"og:locale\" content=\"en_GB\">\n<meta property=\"og:site_name\" content=\"tre.praze.net\">\n<meta name=\"fediverse:creator\" content=\"@tre@praze.net\">\n<link rel=\"stylesheet\" href=\"/new.css\">\n<link rel=\"me\" href=\"https://kes.praze.net/@tre\">\n<link rel=\"webmention\" href=\"https://webmention.io/tre.praze.net/webmention\">\n<link rel=\"alternate\" type=\"application/rss+xml\" title=\"tre.praze.net\" href=\"/feed.xml\">\n<link rel=\"alternate\" type=\"application/activity+json\" href=\"https://fed.brid.gy/r/https://tre.praze.net/notes/" pageurl "\">\n<meta name=\"theme-color\" content=\"#f2f2f2\" />\n<noscript>\n <style>.jsonly{display:none;}</style>\n</noscript>"))
(defun org-html-template (contents info)
"Return complete document string after HTML conversion.
@ -95,7 +100,9 @@ holding export options."
(unless (string-match "tumblr" thecategory)
(concat "<p style=\"display:none;\"><i>If the formatting of this post seems odd or incomplete, try viewing <a href=\".\">the original</a> on my site.</i></p>"))
contents
"</div>\n"
"</div>\n</section>\n<section>"
(when bridged
(concat "<p><i>You can find this post on the fediverse by searching for <code>https://fed.brid.gy/r/https://tre.praze.net/notes/" thedate "/</code> in your fediverse client.</i></p>"))
(if havecomments
"<div id=\"comments\">\n<h2>Comments</h2>\n<noscript>\n<p><b>JavaScript is unavailable.</b> Please <a href=\"mailto:tre@praze.net\">email me</a> any comments.</p>\n</noscript>\n<p class=\"jsonly\">You can comment on this post if you like. Comments will be posted below after moderation.</p>\n<form id=\"theform\" onsubmit=\"sendContact(event)\" class=\"jsonly\">\n<input type=\"text\" id=\"nameInput\" required placeholder=\"Pseudonym (required)\">\n<input type=\"email\" id=\"emailInput\" placeholder=\"Email (if you want email notification of reply)\">\n<input type=\"url\" id=\"siteInput\" placeholder=\"Site (if you want a link back)\">\n<textarea id=\"messageInput\" rows=\"5\" maxlength=\"4800\" required placeholder=\"Your comment (required, include whatever markup [or down] you like)\"></textarea>\n<button type=\"submit\">Submit</button>\n</form>\n</div>\n")
"</section>\n"