diff options
-rw-r--r-- | .builds/auto.yml | 2 | ||||
-rw-r--r-- | .builds/franklin.jl | 7 | ||||
-rw-r--r-- | _assets/feed.xslt | 103 | ||||
-rw-r--r-- | _layout/hair.html | 1 | ||||
-rw-r--r-- | _libs/fead/in.html | 2 | ||||
-rw-r--r-- | _rss/head.xml | 1 | ||||
-rw-r--r-- | blog/index.md | 3 | ||||
-rw-r--r-- | utils.jl | 5 | ||||
-rw-r--r-- | works.md | 37 |
9 files changed, 123 insertions, 38 deletions
diff --git a/.builds/auto.yml b/.builds/auto.yml index bcca7f6..f20186f 100644 --- a/.builds/auto.yml +++ b/.builds/auto.yml @@ -20,7 +20,7 @@ tasks: 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 . - # acurl -f https://pages.sr.ht/publish/cnx.gdn -F content=@site.tar.gz artifacts: - site.tar.gz diff --git a/.builds/franklin.jl b/.builds/franklin.jl index c090540..50f4755 100644 --- a/.builds/franklin.jl +++ b/.builds/franklin.jl @@ -1,6 +1,11 @@ import Pkg Pkg.instantiate() -using Franklin +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"), + """<div class='fead'> + $(readchomp(joinpath("_libs", "fead", "out.html"))) + </div> + """) diff --git a/_assets/feed.xslt b/_assets/feed.xslt new file mode 100644 index 0000000..15817d2 --- /dev/null +++ b/_assets/feed.xslt @@ -0,0 +1,103 @@ +<?xml version='1.0' encoding='utf-8'?> +<xsl:stylesheet version='3.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> + <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/> + <xsl:template match='pubDate'> + <xsl:value-of select='substring(., 13, 4)'/> + <xsl:text>-</xsl:text> + <xsl:choose> + <xsl:when test='contains(., "Jan")'>01</xsl:when> + <xsl:when test='contains(., "Feb")'>02</xsl:when> + <xsl:when test='contains(., "Mar")'>03</xsl:when> + <xsl:when test='contains(., "Apr")'>04</xsl:when> + <xsl:when test='contains(., "May")'>05</xsl:when> + <xsl:when test='contains(., "Jun")'>06</xsl:when> + <xsl:when test='contains(., "Jul")'>07</xsl:when> + <xsl:when test='contains(., "Aug")'>08</xsl:when> + <xsl:when test='contains(., "Sep")'>09</xsl:when> + <xsl:when test='contains(., "Oct")'>10</xsl:when> + <xsl:when test='contains(., "Nov")'>11</xsl:when> + <xsl:when test='contains(., "Dec")'>12</xsl:when> + </xsl:choose> + <xsl:text>-</xsl:text> + <xsl:value-of select='format-number(substring(., 6, 2), "00")'/> + </xsl:template> + + <xsl:template match='item'> + <xsl:param name='space'/> + <xsl:if test='category = $space'> + <li> + <a href='{substring(link, 1, string-length(link)-11)}' + title='{description}'> + <xsl:value-of select='title'/> + </a> + <xsl:text>. </xsl:text> + <time><xsl:apply-templates select='pubDate'/></time> + <xsl:text>. </xsl:text> + <small> + <xsl:for-each select='category'> + <xsl:if test='. != $space'> + <xsl:text> </xsl:text> + <a class='tag' href='/tag/{.}'> + <xsl:value-of select='.'/> + </a> + </xsl:if> + </xsl:for-each> + </small> + </li> + </xsl:if> + </xsl:template> + + <xsl:template match="/"> + <xsl:variable name='home' select='link'/> + <html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset='utf-8'/> + <meta name='color-scheme' content='dark light'/> + <meta name='viewport' content='width=device-width, initial-scale=1'/> + <link rel='stylesheet' href='/css/style.css'/> + <link rel='icon' href='/assets/favicon.svg'/> + <title><xsl:value-of select='/rss/channel/title'/></title> + </head> + <body> + <header> + <div class='blog-name'><a href='/'>McSinyx</a></div> + <nav> + <ul> + <li><a href='/works'>Portfolio</a></li> + <li><a href='/blog'>Blogs</a></li> + </ul> + </nav> + </header> + <main class='franklin-content'> + <h1>Web Logs</h1> + <p>I occasionally blog about functional programming + and other computational stuff, or anything related + to computers in general. These write-ups are tagged + as <a class='tag' href='/tag/fun'>fun</a>.</p> + <ol reversed='reversed'> + <xsl:apply-templates select='/rss/channel/item'> + <xsl:with-param name='space' select='"fun"'/> + </xsl:apply-templates> + </ol> + <p>I sometimes note what happens in meatspace as well. + Such writings might still have a thing or two to do with computing + (given it is integrated into my life) and they are tagged + as <a class='tag' href='/tag/lyf'>lyf</a>.</p> + <ol reversed='reversed'> + <xsl:apply-templates select='/rss/channel/item'> + <xsl:with-param name='space' select='"lyf"'/> + </xsl:apply-templates> + </ol> + <p>The page you are viewing is an RSS feed. How cool is that?</p> + <h2>See Also</h2> + <xsl:copy-of select='document("/assets/fead.xhtml")'/> + <small class='right'>Generated by + <a href='https://trong.loang.net/~cnx/fead'>fead</a></small> + </main> + <footer> + <xsl:value-of select='/rss/channel/copyright'/> + </footer> + </body> + </html> + </xsl:template> +</xsl:stylesheet> diff --git a/_layout/hair.html b/_layout/hair.html index 50fc888..da54a85 100644 --- a/_layout/hair.html +++ b/_layout/hair.html @@ -3,6 +3,7 @@ <meta charset=utf-8> <meta name=color-scheme content='dark light'> <meta name=viewport content='width=device-width, initial-scale=1'> +{{ispage /blog/index.html}}<meta http-equiv='refresh' content='0; url=/feed.xml'/>{{end}} <link rel='alternate' type='application/rss+xml' title='{{website_title}}' href='/{{ispage /tag/*}}tag/{{fd_tag}}/{{end}}{{rss_file}}.xml'> <link rel='icon' href='/assets/favicon.svg'> diff --git a/_libs/fead/in.html b/_libs/fead/in.html index f0be760..a95514d 100644 --- a/_libs/fead/in.html +++ b/_libs/fead/in.html @@ -1,6 +1,6 @@ <article> <h3><a href='{link}'>{title}</a></h3> {summary} - <small class=right>—<a href='{source_link}'>{source_title}</a>, + <small class='right'>⁚<a href='{source_link}'>{source_title}</a>, {time:%F}</small> </article> diff --git a/_rss/head.xml b/_rss/head.xml index 814236d..26ea527 100644 --- a/_rss/head.xml +++ b/_rss/head.xml @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="/assets/feed.xslt"?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" diff --git a/blog/index.md b/blog/index.md index 414b4db..39e8e43 100644 --- a/blog/index.md +++ b/blog/index.md @@ -8,7 +8,4 @@ Such writings might still have a thing or two to do with computing 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). - {{fead}} diff --git a/utils.jl b/utils.jl index 3217272..41d057f 100644 --- a/utils.jl +++ b/utils.jl @@ -57,9 +57,10 @@ function hfun_fead() ads = readchomp(joinpath(path(:libs), "fead", "out.html")) """<h2>See Also</h2> <div class=fead> - $(ads)</div> + $(ads) + </div> <small class=right>Generated by - <a href=https://trong.loang.net/~cnx/fead>fead</a></small><br> + <a href=https://trong.loang.net/~cnx/fead>fead</a></small> """ end diff --git a/works.md b/works.md index 99736e7..1c0589a 100644 --- a/works.md +++ b/works.md @@ -44,7 +44,7 @@ without any third-party library. ### rsskey [rsskey] is a simple script for mirroring [RSS] or [Atom] feeds -on [Misskey]. It is known for replicating Richard Stallman's +on [Misskey]. It was known for replicating Richard Stallman's political notes to [rms@birb.space]. ### mepo @@ -153,7 +153,7 @@ who wrote the original version and suggested the change ### vim-octave -I am maintaining [Octave syntax and indentation support for Vim][vim-octave]. +I wrote [Octave indentation support for Vim][vim-octave]. ## Localizations @@ -210,27 +210,14 @@ I send trivial patches for random issues I run into every now and then. ### Loang -[Loang] is a collection of services, including a [Matrix] homeserver, -a web server, a [Gemini] server, an authoritative name server, -an [UnifiedPush] server, an IRC bouncer and shell access. +[Loang] is a collection of services, including (but not limited to) +[Matrix] homeserver, mail server, web server, authoritative name server, +CI/CD, [UnifiedPush] server, IRC bouncer and shell access. ### Phylactery [Phylactery] is a web server rendering comic books directly from ZIP archives. -### Acanban - -[Acanban] is a work-in-progress collaboration platform for students -and supervisors during group projects and internships. It is built -on the [ASGI] framework [Quart] and uses [Trio] for concurrency -when interacting with persistency layers [RethinkDB] and [IPFS]. - -### ComLake - -I worked as an intern at [USTH] [ICTLab] on a data lake's -[core API and workers]. It also uses [IPFS] but [PostgreSQL] -was picked for database. - [ipwhl]: https://man.sr.ht/~cnx/ipwhl [IPFS]: https://ipfs.io [nixpkgs]: https://github.com/NixOS/nixpkgs @@ -270,7 +257,7 @@ was picked for database. [Lua]: https://www.lua.org [Alful]: https://addons.mozilla.org/en-US/firefox/addon/alful [alful patch]: https://github.com/tazeat/AutoFullscreen/issues/4#issuecomment-509723353 -[vim-octave]: https://github.com/McSinyx/vim-octave +[vim-octave]: https://github.com/gnu-octave/vim-octave [tevnex]: https://github.com/McSinyx/ibus-table-vietnamese#phương-thức-gõ [vim-tevnex]: https://github.com/vim/vim/commit/a02a551 [ibus-table]: https://github.com/moebiuscurve/ibus-table-others/commit/b6fafd0 @@ -282,18 +269,8 @@ was picked for database. [Adwaita]: https://blogs.gnome.org/mclasen/2014/06/13/a-new-default-theme-for-gtk [MathieWD]: https://www.opendesktop.org/p/1016294 [dotfiles]: https://trong.loang.net/~cnx/dotfiles +[SourceHut]: https://sourcehut.org [Loang]: https://loang.net [Matrix]: https://matrix.org -[Gemini]: https://gemini.circumlunar.space [UnifiedPush]: https://unifiedpush.org [Phylactery]: https://trong.loang.net/phylactery -[SourceHut]: https://sourcehut.org -[Acanban]: https://pypi.org/project/acanban -[ASGI]: https://asgi.readthedocs.io -[Quart]: https://pgjones.gitlab.io/quart -[Trio]: https://trio.readthedocs.io -[RethinkDB]: https://rethinkdb.com -[USTH]: https://usth.edu.vn -[ICTLab]: https://ictlab.usth.edu.vn -[core API and workers]: https://comlake.github.io/comlake.core -[PostgreSQL]: https://www.postgresql.org |