From 09f668df44432da378da7b251ea4bd4a011d62c6 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Mon, 20 Dec 2021 17:46:31 +0700 Subject: Join Fediring --- _layout/page_foot.html | 6 ++++-- _rss/item.xml | 47 ++++++++--------------------------------------- config.md | 5 +++-- index.md | 17 ++++++++++++----- utils.jl | 39 +++++++++++++++++++++++++++++++-------- 5 files changed, 58 insertions(+), 56 deletions(-) diff --git a/_layout/page_foot.html b/_layout/page_foot.html index 6a9431a..c7b7bca 100644 --- a/_layout/page_foot.html +++ b/_layout/page_foot.html @@ -1,6 +1,8 @@ +{{isnotpage /tag/*}}{{isnotempty rss}}
+ Reply via email +
{{end}}{{end}}
- © 2019–2021 {{author}}; - See license terms
+ {{copyright}}; See license terms
{{isnotpage /tag/*}}Last modified: {{author_date}}; View page source
{{end}} diff --git a/_rss/item.xml b/_rss/item.xml index 412148a..76f892a 100644 --- a/_rss/item.xml +++ b/_rss/item.xml @@ -1,45 +1,14 @@ - - <![CDATA[{{fd2rss rss_title}}]]> + {{fd2rss rss_title}} {{fd_full_url}} {{fd_full_url}} - - - - {{if rss_full_content}} + {{fd2rss rss_description}} + {{for tag in tags}}{{tag}}{{end}} + {{RFC822 rss_pubdate}} - + Reply]]> - {{end}} - - - {{RFC822 rss_pubdate}} - - {{isnotempty rss_author}}{{rss_author}}{{end}} - {{isnotempty author}} - - {{author}} - - {{end}} - - {{isnotempty rss_category}}{{rss_category}}{{end}} - {{isnotempty rss_comments}}{{rss_comments}}{{end}} - {{isnotempty rss_enclosure}}{{rss_enclosure}}{{end}} + + {{comment_rss}} diff --git a/config.md b/config.md index 0e556b2..fbd8a06 100644 --- a/config.md +++ b/config.md @@ -2,13 +2,14 @@ author = "Nguyễn Gia Phong" website_title = "Web logs by McSinyx" website_description = "Random write-ups packed with pop culture references" +copyright = "🄯 2019–2021 " * author website_url = "https://cnx.srht.site" +website_url = "http://localhost:8000" date_format = "yyyy-mm-dd" mintoclevel = 2 generate_rss = true -rss_full_content = true ignore = ["Manifest.toml", "Project.toml", ".build.jl", ".build.yml", - "node_modules/", "package-lock.json"] + "mbox", "node_modules/", "package-lock.json"] +++ \newcommand{\R}{\mathbb R} diff --git a/index.md b/index.md index 1ac9659..914a483 100644 --- a/index.md +++ b/index.md @@ -1,7 +1,11 @@ # About Me Hi! [My name is] Nguyễn Gia Phong and I'm a Vietnamese [free software] -enthusiast. You can find me under my Internet alias McSinyx (or CnX for short) +enthusiast. I am generally interested in programming languages, +concurrency, reproducibility and decentralization. In meatspace +I also like cooking, dogs[^culture] and urban music. + +You can find me under my Internet alias McSinyx (or CnX for short) in the [Fediverse][]: * Pleroma: [cnx@nixnet.social] @@ -10,12 +14,11 @@ in the [Fediverse][]: * Email (and XMPP): [mcsinyx@disroot.org][^pgp] * Matrix: [@cnx:halogen.city] -I am generally interested in programming languages, concurrency, -reproducibility and decentralization. In meatspace I also like -cooking, dogs[^culture] and urban music. +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! -[^pgp]: PGP: [27148B2C06A2224B], also on [OpenPGP] [^culture]: Not necessarily mutually exclusive +[^pgp]: PGP: [27148B2C06A2224B], also on [OpenPGP] [My name is]: https://www.youtube.com/watch?v=LDj8kkVwisY [free software]: https://www.gnu.org/philosophy/free-sw.html @@ -25,5 +28,9 @@ cooking, dogs[^culture] and urban music. [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 86b16c5..3e58dde 100644 --- a/utils.jl +++ b/utils.jl @@ -1,14 +1,42 @@ -using Printf +using Printf: @sprintf +using Franklin: convert_html, path function hfun_author_date() return readchomp(`git log -1 --date=short --format=%ad $(locvar(:fd_rpath))`) end function hfun_abslink(args) - path = args[1] - return @sprintf("%s", path, pagevar(path, "title")) + rpath = args[1] + return @sprintf("%s", rpath, pagevar(rpath, :title)) end +dir_url() = strip(dirname(locvar(:fd_url)), '/') +message_id() = @sprintf("<%s@cnx>", dir_url()) +hfun_comments() = @sprintf("https://lists.sr.ht/~cnx/site?search=%s:%s", + "In-Reply-To", message_id()) + +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, "") + end + return joinpath(globvar(:website_url), rpath) +end + +function hfun_mailto_comment() + return @sprintf("mailto:%s?%s=%s&%s=Re: %s", + "~cnx/site@lists.sr.ht", + "In-Reply-To", message_id(), + "Subject", locvar(:title)) +end + +hfun_github(args) = @sprintf("@%s", + args[1], args[1]) + function hfun_pep(args) postfix = length(args) < 2 ? "" : '#' * args[2] return @sprintf( @@ -16,11 +44,6 @@ function hfun_pep(args) Meta.parse(args[1]), postfix, args[1], postfix) end -function hfun_github(args) - return @sprintf("@%s", - args[1], args[1]) -end - function hfun_pip(args) content = length(args) < 2 ? "GH-" * args[1] : args[2] return @sprintf("%s", -- cgit 1.4.1