From ad378f30835f3144e43b9a94d555e072e0b6417c Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 28 Sep 2021 02:00:12 +0530 Subject: README: Use a dynamic block to list releases. * README.org (Download): Replace releases with dynamic block. * build-aux/build-website.el: Update dynamic blocks before exporting. (org-dblock-write:releases): New function. --- README.org | 5 ++--- build-aux/build-website.el | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 49622a6..09ea5de 100644 --- a/README.org +++ b/README.org @@ -31,9 +31,8 @@ guile-email is used by Download release tarballs. -- 2019-12-22 [[https://guile-email.systemreboot.net/releases/guile-email-0.2.2.tar.lz][guile-email-0.2.2.tar.lz]] [[https://guile-email.systemreboot.net/releases/guile-email-0.2.2.tar.lz.asc][GPG Signature]] -- 2019-09-23 [[https://guile-email.systemreboot.net/releases/guile-email-0.2.1.tar.lz][guile-email-0.2.1.tar.lz]] [[https://guile-email.systemreboot.net/releases/guile-email-0.2.1.tar.lz.asc][GPG Signature]] -- 2019-08-09 [[https://guile-email.systemreboot.net/releases/guile-email-0.2.0.tar.lz][guile-email-0.2.0.tar.lz]] [[https://guile-email.systemreboot.net/releases/guile-email-0.2.0.tar.lz.asc][GPG Signature]] +#+BEGIN: releases +#+END: Download [[https://systemreboot.net/files/misc/arunisaac.pub][public signing key]]. diff --git a/build-aux/build-website.el b/build-aux/build-website.el index f29662f..f8b8454 100644 --- a/build-aux/build-website.el +++ b/build-aux/build-website.el @@ -28,5 +28,24 @@ org-html-head-include-scripts nil org-html-postamble nil) +(defun org-dblock-write:releases (params) + "Dynamically write releases block." + (call-process "git" nil t nil + "for-each-ref" "--sort=-taggerdate" + (let ((release-file "./releases/guile-email-%(refname:short).tar.lz")) + (format "--format=- %%(taggerdate:short) [[%s][%s]] [[%s.asc][GPG Signature]]" + release-file + (file-name-nondirectory release-file) + release-file)) + "refs/tags/v*") + ;; Fix tarball filenames. + (replace-string "guile-email-v" "guile-email-" nil nil nil t) + ;; Delete the v0.1.0 release line since we don't have a copy of the + ;; release tarball. + (search-forward "guile-email-0.1.0.tar.lz") + (beginning-of-line) + (kill-line)) + (with-current-buffer (find-file "README.org") + (org-update-all-dblocks) (org-export-to-file 'html "website/index.html")) -- cgit v1.2.3