From b4f85e4de9fb802757c2eb6fb1fb25afec30ddcc Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 3 Aug 2024 03:22:24 +0900 Subject: Move infra from sr.ht to loang.net --- .builds/auto.yml | 26 -------------------------- .builds/franklin.jl | 12 ------------ .builds/shell.nix | 14 -------------- _layout/footer.html | 3 +-- _libs/formbox/comment.html | 4 ++-- _libs/formbox/comment.xml | 6 +++--- blog/reply.md | 14 ++++++++++---- build | 10 ++++++++++ build.jl | 12 ++++++++++++ shell.nix | 11 +++++++++++ utils.jl | 3 +-- works.md | 2 +- 12 files changed, 51 insertions(+), 66 deletions(-) delete mode 100644 .builds/auto.yml delete mode 100644 .builds/franklin.jl delete mode 100644 .builds/shell.nix create mode 100755 build create mode 100644 build.jl create mode 100644 shell.nix diff --git a/.builds/auto.yml b/.builds/auto.yml deleted file mode 100644 index f20186f..0000000 --- a/.builds/auto.yml +++ /dev/null @@ -1,26 +0,0 @@ -image: nixos/unstable -oauth: lists.sr.ht/EMAILS:RO pages.sr.ht/PAGES:RW -packages: - - nixos.fead -sources: - - https://git.sr.ht/~amolith/fediring.net - - https://git.sr.ht/~cnx/site -environment: - NODE: node -tasks: - - inject: | - grep -C1 cnx.gdn fediring.net/webring.txt | - awk 'NR % 2 { print $2 }' > site/_libs/fediring - fead -F site/_libs/fead/sources -n 4 -l 192\ - < site/_libs/fead/in.html > site/_libs/fead/out.html - acurl https://lists.sr.ht/query/list/5261.mbox -o site/_libs/formbox/mbox - - build: | - cd site - nix-shell .builds/shell.nix --run 'julia --project=@. .builds/franklin.jl' - nix-shell -p htmlq --run _libs/onlymathml - nix-shell -p python3Packages.css-html-js-minify --run _libs/postprocess - - deploy: | - chmod -R +r site/__site - tar -cvzf site.tar.gz -C site/__site . -artifacts: - - site.tar.gz diff --git a/.builds/franklin.jl b/.builds/franklin.jl deleted file mode 100644 index e0a805a..0000000 --- a/.builds/franklin.jl +++ /dev/null @@ -1,12 +0,0 @@ -import Pkg -Pkg.instantiate() - -using Franklin: optimize -optimize(clear=true, minify=false, no_fail_prerender=false, - suppress_errors=false, fail_on_warning=true) -write(joinpath("__site", "assets", "fead.xhtml"), - """]> -
- $(readchomp(joinpath("_libs", "fead", "out.html"))) -
- """) diff --git a/.builds/shell.nix b/.builds/shell.nix deleted file mode 100644 index 5b50f03..0000000 --- a/.builds/shell.nix +++ /dev/null @@ -1,14 +0,0 @@ -with import {}; -mkShell { - nativeBuildInputs = [ - julia-bin nodejs nodePackages.katex python3Packages.formbox - ]; - - shellHook = '' - npm install highlight.js # https://github.com/NixOS/nixpkgs/issues/152201 - katex=${nodePackages.katex}/lib/node_modules/katex/dist - install -Dm 644 $katex/katex.min.js _libs/katex/katex.min.js - install -Dm 644 $katex/contrib/auto-render.min.js\ - _libs/katex/contrib/auto-render.min.js - ''; -} diff --git a/_layout/footer.html b/_layout/footer.html index 5ba0bd1..ab0be67 100644 --- a/_layout/footer.html +++ b/_layout/footer.html @@ -10,7 +10,6 @@ Part of Fediring; Visit the {{fediring 1 previous}}/{{fediring 2 next}} site
- Built on sr.ht - by Julia + Built by Julia Franklin diff --git a/_libs/formbox/comment.html b/_libs/formbox/comment.html index fe7aa6a..b54b659 100644 --- a/_libs/formbox/comment.html +++ b/_libs/formbox/comment.html @@ -1,8 +1,8 @@
{body}

{author}, - {author}, + {date}

{children}
diff --git a/_libs/formbox/comment.xml b/_libs/formbox/comment.xml index 3d8ff93..b83c1f9 100644 --- a/_libs/formbox/comment.xml +++ b/_libs/formbox/comment.xml @@ -1,11 +1,11 @@ - https://lists.sr.ht/~cnx/site/{message_id} - https://lists.sr.ht/~cnx/site/{message_id} + https://loa.loang.net/cnx.site/{message_id}/t + https://loa.loang.net/cnx.site/{message_id} {rfc822} {author} On {date}, {author} wrote: - Reply + Reply via email]]> {children} diff --git a/blog/reply.md b/blog/reply.md index e2f4a2f..0d7b0df 100644 --- a/blog/reply.md +++ b/blog/reply.md @@ -90,6 +90,12 @@ is any more difficult, presuming you have set up [offline email]. [sr.ht] user, you can use [acurl] on the build service with the URL from the [GraphQL] `query { me { lists { results { name, archive } } } }`. +!!! note "Update" + + I stopped paying for sr.ht in May 2024 after years of Sourcehut failing + to show any measurable progress towards reaching the beta status. + I am now using public-inbox for public, eh, inboxes. + ## Designing Data Flow I promise, this sounds bigger than it really is, but first, @@ -147,7 +153,7 @@ using Printf: @sprintf function hfun_mailto_comment() @sprintf("mailto:%s?%s=%s&%s=Re: %s", - "~cnx/site@lists.sr.ht", + "cnx.site@loa.loang.net", "In-Reply-To", message_id(), "Subject", locvar(:title)) end @@ -363,11 +369,11 @@ to each other, subscribe to the [site's mailing list] instead. [not on NixOS]: https://github.com/NixOS/nixpkgs/issues/20649 [mbox]: https://datatracker.ietf.org/doc/html/rfc4155 [meet in tha middle]: https://genius.com/Timbaland-meet-in-tha-middle-lyrics -[formbox]: https://sr.ht/~cnx/formbox +[formbox]: https://trong.loang.net/~cnx/formbox [Use plaintext emails]: https://useplaintext.email -[mailing list]: https://lists.sr.ht/~cnx/misc +[mailing list]: https://loa.loang.net/cnx.misc [CC BY-SA 4.0]: https://creativecommons.org/licenses/by-sa/4.0 -[site's mailing list]: https://lists.sr.ht/~cnx/site +[site's mailing list]: https://loa.loang.net/cnx.site [contrib]: https://drewdevault.com/2020/06/06/Add-a-contrib-directory.html [text/markdown]: https://blog.brixit.nl/markdown-email [UUID]: https://en.wikipedia.org/wiki/Universally_unique_identifier diff --git a/build b/build new file mode 100755 index 0000000..fef10f2 --- /dev/null +++ b/build @@ -0,0 +1,10 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i sh -p curl fead python3Packages.formbox htmlq julia-bin nodejs +set -ex +curl -Ss https://git.sr.ht/~amolith/fediring.net/blob/main/webring.txt | + awk 'NR % 2 { print $2 }' > _libs/fediring +fead -F _libs/fead/sources -n 4 -l 192\ + < _libs/fead/in.html > _libs/fead/out.html +NODE=node julia --project=@. build.jl +_libs/onlymathml +_libs/postprocess diff --git a/build.jl b/build.jl new file mode 100644 index 0000000..e0a805a --- /dev/null +++ b/build.jl @@ -0,0 +1,12 @@ +import Pkg +Pkg.instantiate() + +using Franklin: optimize +optimize(clear=true, minify=false, no_fail_prerender=false, + suppress_errors=false, fail_on_warning=true) +write(joinpath("__site", "assets", "fead.xhtml"), + """]> +
+ $(readchomp(joinpath("_libs", "fead", "out.html"))) +
+ """) diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..d70b937 --- /dev/null +++ b/shell.nix @@ -0,0 +1,11 @@ +with import {}; +mkShell { + nativeBuildInputs = [ nodejs nodePackages.katex ]; + shellHook = '' + npm install highlight.js # https://github.com/NixOS/nixpkgs/issues/152201 + katex=${nodePackages.katex}/lib/node_modules/katex/dist + install -Dm 644 $katex/katex.min.js _libs/katex/katex.min.js + install -Dm 644 $katex/contrib/auto-render.min.js\ + _libs/katex/contrib/auto-render.min.js + ''; +} diff --git a/utils.jl b/utils.jl index 41d057f..57772be 100644 --- a/utils.jl +++ b/utils.jl @@ -46,10 +46,9 @@ function hfun_fediring(args) end hfun_github(args) = "@$(args[1])" -hfun_job_url() = get(ENV, "JOB_URL", "https://builds.sr.ht/~cnx/site") function hfun_mailto_comment() - @sprintf("mailto:%s?%s=%s&%s=Re: %s", "~cnx/site@lists.sr.ht", + @sprintf("mailto:%s?%s=%s&%s=Re: %s", "cnx.site@loa.loang.net", "In-Reply-To", message_id(), "Subject", locvar(:title)) end diff --git a/works.md b/works.md index 91613e1..b56880d 100644 --- a/works.md +++ b/works.md @@ -235,7 +235,7 @@ in responsive styling. [Guix]: https://guix.gnu.org [threa]: https://sr.ht/~cnx/threa [Raku]: https://raku.org -[formbox]: https://sr.ht/~cnx/formbox +[formbox]: https://trong.loang.net/~cnx/formbox [replies]: /blog/reply [fead]: https://trong.loang.net/~cnx/fead [openring]: https://sr.ht/~sircmpwn/openring -- cgit 1.4.1