From 93cda87bbd4699ab1fc4e008d7c0508cd0a9217e Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 18 Jun 2026 08:46:45 +0100 Subject: [PATCH] http: adds microlog index --- http/src/microlog.upphtml | 84 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 http/src/microlog.upphtml diff --git a/http/src/microlog.upphtml b/http/src/microlog.upphtml new file mode 100644 index 0000000..a1da471 --- /dev/null +++ b/http/src/microlog.upphtml @@ -0,0 +1,84 @@ +#! +PAGE="$1" +SITE_URL="$2" +export TITLE="Joe Carstairs" +export DESCRIPTION="Joe Carstairs' personal website" + +POSTS="$(ls --reverse "${SRC}/microlog/" | grep "^[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\(\.[0-9]\+\)\?\.microlog.upphtml$")" +set -- +for post in $POSTS +do + this_year="$( echo "$post" | cut -c1-4 )" + has_this_year=0 + for year in $@ + do + if [ "$this_year" = "$year" ] + then + has_this_year=1 + break + fi + done + if [ $has_this_year -eq 0 ] + then + set -- $@ "$this_year" + fi +done +YEARS="$@" + +pp "${SHARE}"/components/meta.upphtml +#! + +
+ +
+ +

My microlog

+ + + +
+

How to subscribe to my logs

+
+ +#! +for year in $YEARS; do +#! +

${year}

+ +
    + +#! +for post in $POSTS; do if [ "$(echo "${post}" | cut -c1-4)" = "$year" ]; then +title="$(grep "^export TITLE=" "${SRC}/microlog/${post}" | cut -c15-)" +title="${title::${#title}-16}" +date_published="$(echo "${post}" | cut -c1-10)" +href="${SITE_URL}/microlog/${post::${#post}-17}.html" +#! + +
  • +

    ${title}

    +
    +#! +pp "${SRC}/microlog/${post}" "${SITE_URL}" +#! +
    +#! +DATE="${date_published}" CLASS="dt-published" ATTRIBUTES="hidden" \ + pp "${SHARE}/components/formatted_date.upphtml" +#! +
  • + +#! +fi; done +#! + +
+ +#! +done +#! + +