about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-12-20 23:42:32 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-12-21 12:41:36 +0700
commit3fae5dd37c658eb185fec2ad99dd11cacf97b7bb (patch)
tree80e44fb2a0f7e5f62f7dd2db7d15cce144618398
parent822a8410c29cf37be4ff5f288e9292db9b873497 (diff)
downloadsite-3fae5dd37c658eb185fec2ad99dd11cacf97b7bb.tar.gz
Add openring
-rw-r--r--.build.yml1
-rw-r--r--_css/style.css21
-rw-r--r--_layout/page_foot.html18
-rw-r--r--_rss/comments.xml (renamed from _rss/comment-head.xml)0
-rw-r--r--_templates/formbox.xml (renamed from _rss/comment-item.xml)0
-rw-r--r--_templates/openring.html12
-rw-r--r--blog/2020/gsoc/index.md1
-rw-r--r--blog/index.md4
-rw-r--r--config.md4
-rw-r--r--index.md12
-rw-r--r--utils.jl24
11 files changed, 73 insertions, 24 deletions
diff --git a/.build.yml b/.build.yml
index 9f0bfb6..a2c3429 100644
--- a/.build.yml
+++ b/.build.yml
@@ -3,6 +3,7 @@ oauth: lists.sr.ht/EMAILS:RO pages.sr.ht/PAGES:RW
 packages:
   - julia
   - katex
+  - openring-git
   - python-pip
 sources:
   - https://git.sr.ht/~cnx/site
diff --git a/_css/style.css b/_css/style.css
index 5185744..990a1ab 100644
--- a/_css/style.css
+++ b/_css/style.css
@@ -232,3 +232,24 @@ code, .hljs {
 .hljs-subst, .hljs-symbol, .hljs-selector-id, .hljs-selector-attr,
 .hljs-selector-pseudo, .hljs-template-tag, .hljs-template-variable,
 .hljs-addition { color: var(--red) }
+
+.openring {
+    display: flex;
+    flex-wrap: wrap;
+    margin: -0.5rem;
+}
+.openring .title, .openring .source { margin: 0 }
+.openring .article {
+    background: var(--block-bg);
+    display: flex;
+    flex-direction: column;
+    flex: 1 1 0;
+    margin: 1ex;
+    min-width: 15rem;
+    padding: 1ex;
+}
+.right {
+    color: var(--fade-fg);
+    font-size: 80%;
+    text-align: right;
+}
diff --git a/_layout/page_foot.html b/_layout/page_foot.html
index c7b7bca..8d8f783 100644
--- a/_layout/page_foot.html
+++ b/_layout/page_foot.html
@@ -1,11 +1,17 @@
-{{isnotpage /tag/*}}{{isnotempty rss}}<div class=comments>
+{{isnotpage /tag/*}}{{isnotempty rss}}<section class=comments>
   <a href='{{mailto_comment}}'>Reply via email</a>
-</div>{{end}}{{end}}
-<div class=page-foot>
+</section>{{end}}{{end}}
+<section class=page-foot>
   {{copyright}}; See <a href=/COPYING>license terms</a><br>
+
   {{isnotpage /tag/*}}Last modified: {{author_date}};  View
   <a href=https://git.sr.ht/~cnx/site/tree/main/item/{{fd_rpath}}>page
   source</a><br>{{end}}
-  A website by <a href=https://julialang.org>Julia</a>
-  <a href=https://franklinjl.org>Franklin</a>
-</div>
+
+  Part of <a href=https://fediring.net>Fediring</a>; Visit neighbor on the
+  <a href={{fediring previous}}>left</a>/<a href={{fediring next}}>right</a><br>
+
+  <a href={{job_url}}>Built on sr.ht</a>
+  by <a href=https://julialang.org>Julia</a>
+  <a href=https://franklinjl.org>Franklin</a><br>
+</section>
diff --git a/_rss/comment-head.xml b/_rss/comments.xml
index be8fa6c..be8fa6c 100644
--- a/_rss/comment-head.xml
+++ b/_rss/comments.xml
diff --git a/_rss/comment-item.xml b/_templates/formbox.xml
index 2078071..2078071 100644
--- a/_rss/comment-item.xml
+++ b/_templates/formbox.xml
diff --git a/_templates/openring.html b/_templates/openring.html
new file mode 100644
index 0000000..a585f17
--- /dev/null
+++ b/_templates/openring.html
@@ -0,0 +1,12 @@
+<section class=openring>
+  {{range .Articles}}
+  <div class=article>
+    <h3 class=title><a href='{{.Link}}'>{{.Title}}</a></h3>
+    {{.Summary}}<br>
+    <small class=right>&mdash;<a href='{{.SourceLink}}'>{{.SourceTitle}}</a>,
+      {{.Date | datef "2006-01-02"}}</small>
+  </div>
+  {{end}}
+</section>
+<small class=right>Generated by
+  <a href=https://git.sr.ht/~sircmpwn/openring>openring</a></small>
diff --git a/blog/2020/gsoc/index.md b/blog/2020/gsoc/index.md
index e345cd1..2e32563 100644
--- a/blog/2020/gsoc/index.md
+++ b/blog/2020/gsoc/index.md
@@ -2,6 +2,7 @@
 title = "Google Summer of Code 2020"
 rss = "GSoC 2020 final report"
 date = Date(2020, 8, 31)
+rss_pubdate = date # work around Franklin issue GH-797
 tags = ["fun", "gsoc", "packaging", "pip"]
 internship = "https://summerofcode.withgoogle.com/archive/2020/projects/6238594655584256"
 benchmark = "/blog/2020/gsoc/article/7/#the_benchmark"
diff --git a/blog/index.md b/blog/index.md
index 68d57aa..a3fcc64 100644
--- a/blog/index.md
+++ b/blog/index.md
@@ -10,3 +10,7 @@ As usual, the good old [RSS feed]({{fd_rss_feed_url}}) is available.
 
 If you are instead looking for the more formal literatures of mine,
 they are listed in [my ORCID profile](https://orcid.org/0000-0003-2336-706X).
+
+## See Also
+
+{{openring}}
diff --git a/config.md b/config.md
index c63251b..c3173a0 100644
--- a/config.md
+++ b/config.md
@@ -7,8 +7,8 @@ website_url = "https://cnx.srht.site"
 date_format = "yyyy-mm-dd"
 mintoclevel = 2
 generate_rss = true
-ignore = ["Manifest.toml", "Project.toml", ".build.jl", ".build.yml",
-          "mbox", "node_modules/", "package-lock.json"]
+ignore = [".build.jl", ".build.yml", "Manifest.toml", "Project.toml",
+          "_templates/", "mbox", "node_modules/", "package-lock.json"]
 +++
 
 \newcommand{\R}{\mathbb R}
diff --git a/index.md b/index.md
index 914a483..2656537 100644
--- a/index.md
+++ b/index.md
@@ -1,7 +1,7 @@
 # About Me
 
 Hi!  [My name is] Nguyễn Gia Phong and I'm a Vietnamese [free software]
-enthusiast.  I am generally interested in programming languages,
+enthusiast who is generally interested in programming languages,
 concurrency, reproducibility and decentralization.  In meatspace
 I also like cooking, dogs[^culture] and urban music.
 
@@ -11,13 +11,11 @@ in the [Fediverse][]:
 * Pleroma: [cnx@nixnet.social]
 * PeerTube: [cnx@video.hardlimit.com]
 * SourceHut: [sr.ht/~cnx]
-* Email (and XMPP): [mcsinyx@disroot.org][^pgp]
+* Email: [mcsinyx@disroot.org][^xmpp][^pgp]
 * Matrix: [@cnx:halogen.city]
 
-In addition, I am a member of the [250kb Club] and a [Fediverse webring].
-You might want to pay my [left] and [right] neighbors a visit!
-
 [^culture]: Not necessarily mutually exclusive
+[^xmpp]: Also XMPP, but mostly inactive
 [^pgp]: PGP: [27148B2C06A2224B], also on [OpenPGP]
 
 [My name is]: https://www.youtube.com/watch?v=LDj8kkVwisY
@@ -28,9 +26,5 @@ You might want to pay my [left] and [right] neighbors a visit!
 [sr.ht/~cnx]: https://sr.ht/~cnx
 [mcsinyx@disroot.org]: mailto:mcsinyx@disroot.org
 [@cnx:halogen.city]: matrix:u/cnx:halogen.city
-[250kb Club]: https://250kb.club
-[Fediverse webring]: https://fediring.net
-[left]: https://fediring.net/previous?host=cnx.srht.site
-[right]: https://fediring.net/next?host=cnx.srht.site
 [27148B2C06A2224B]: https://meta.sr.ht/~cnx.pgp
 [OpenPGP]: https://keys.openpgp.org/search?q=27148B2C06A2224B
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]