about summary refs log tree commit diff
path: root/build-aux
diff options
context:
space:
mode:
authorArun Isaac2021-09-29 01:18:26 +0530
committerArun Isaac2021-09-29 01:47:28 +0530
commit29a0b81f92c84543fc18791d2f36d52f99c6ea22 (patch)
tree412c72a9980aadb067632c36e7199b8b62fb43f5 /build-aux
parentf1a5d47fe3ed4cceb00d21c5858442a84dfa8147 (diff)
downloadccwl-29a0b81f92c84543fc18791d2f36d52f99c6ea22.tar.gz
ccwl-29a0b81f92c84543fc18791d2f36d52f99c6ea22.tar.lz
ccwl-29a0b81f92c84543fc18791d2f36d52f99c6ea22.zip
README: Add a Download section using a dynamic block.
In addition, we link to the GitHub repo in this new Download section
rather than in the Contributing section.

* README.org (download): Add dynamic block.
(Contributing): Delete github-link dynamic block.
* build-aux/build-home-page.el (org-dblock-write:github-link): Delete
function.
(org-dblock-write:download): New function.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/build-home-page.el28
1 files changed, 25 insertions, 3 deletions
diff --git a/build-aux/build-home-page.el b/build-aux/build-home-page.el
index caad516..f83438c 100644
--- a/build-aux/build-home-page.el
+++ b/build-aux/build-home-page.el
@@ -34,11 +34,33 @@
       org-html-head-include-scripts nil
       org-html-postamble nil)
 
-(defun org-dblock-write:github-link (params)
-  "Dynamically write github-link block."
-  (insert "ccwl is developed on [[https://github.com/arunisaac/ccwl][GitHub]]."))
+(defun org-dblock-write:download (params)
+  "Dynamically write download block."
+  (insert "* Download
+
+Download release tarballs.
+
+")
+  (call-process "git" nil t nil
+                "for-each-ref" "--sort=-taggerdate"
+                (let ((release-file "./releases/ccwl-%(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*")
+  (insert "
+Download [[https://systemreboot.net/files/misc/arunisaac.pub][public signing key]].
+
+Browse the [[https://github.com/arunisaac/ccwl][development version]] of ccwl hosted on GitHub.")
+  ;; Fix tarball filenames.
+  (replace-string "ccwl-v" "ccwl-" nil nil nil t))
 
 (defun build-website ()
   (with-current-buffer (find-file "README.org")
     (org-update-all-dblocks)
+    ;; Unfortunately, org is unable to handle headlines inside dynamic
+    ;; blocks. So, dissolve the download dynamic block.
+    (replace-string "#+BEGIN: download" "")
+    (replace-string "#+END:" "")
     (org-export-to-file 'html "website/index.html")))