about summary refs log tree commit diff homepage
path: root/utils.jl
diff options
context:
space:
mode:
Diffstat (limited to 'utils.jl')
-rw-r--r--utils.jl24
1 files changed, 17 insertions, 7 deletions
diff --git a/utils.jl b/utils.jl
index d05a254..4d43cdc 100644
--- a/utils.jl
+++ b/utils.jl
@@ -17,16 +17,17 @@ hfun_comments() = @sprintf("https://lists.sr.ht/~cnx/site?search=%s:%s",
 
 function hfun_comment_rss()
   rpath = joinpath(dir_url(), "comments.xml")
-  head_template = joinpath(path(:rss), "comment-head.xml")
-  item_template = joinpath(path(:rss), "comment-item.xml")
   open(joinpath(path(:site), rpath), "w") do feed
-    write(feed, convert_html(read(head_template, String)))
-    #write(feed, read(`python3 formbox.py mbox $(message_id()) $(item_template)`, String))
-    write(feed, "</channel></rss>")
+    write(feed, convert_html(readchomp(joinpath(path(:rss), "comments.xml"))))
+    #write(feed, read(`python3 formbox.py mbox $(message_id()) $item_template`, String))
   end
   return joinpath(globvar(:website_url), rpath)
 end
 
+hfun_fediring(args) = "https://fediring.net/$(args[1])?host=cnx.srht.site"
+hfun_github(args) = "<a href=https://github.com/$(args[1])>@$(args[1])</a>"
+hfun_job_url() = get(ENV, "JOB_URL", "https://builds.sr.ht/~cnx/site")
+
 function hfun_mailto_comment()
   return @sprintf("mailto:%s?%s=%s&%s=Re: %s",
                   "~cnx/site@lists.sr.ht",
@@ -34,8 +35,17 @@ function hfun_mailto_comment()
                   "Subject", locvar(:title))
 end
 
-hfun_github(args) = @sprintf("<a href=https://github.com/%s>@%s</a>",
-                             args[1], args[1])
+ring_sources = ["https://blog.ganssle.io/feeds/all.atom.xml",
+                "https://codesections.com/rss.xml",
+                "https://danct12.github.io/feed.xml",
+                "https://drewdevault.com/feed.xml",
+                "https://huyngo.envs.net/index.xml",
+                "https://pgjones.dev/blog/rss20.xml",
+                "https://stallman.org/rss/rss.xml",
+                "https://unixsheikh.com/feed.rss"]
+# TODO: joinpath
+hfun_openring() = readchomp(pipeline("_templates/openring.html",
+                                     `openring -n4 -s$ring_sources`))
 
 function hfun_pep(args)
   postfix = length(args) < 2 ? "" : '#' * args[2]