diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-07-27 16:49:18 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2020-07-27 16:49:18 -0400 |
| commit | e11c75d3d9f06b5e3fc413dd2c1eedf0da97692f (patch) | |
| tree | 50e2443ea7fe952aca3a789ce3b9c18628669a1b | |
| parent | 8c2bb753fdfc1a4245de8df02496d17a8d271ee6 (diff) | |
[blog] Add a link to commentpara.de at the bottom of ∀ posts.
| -rw-r--r-- | haunt/jakob/builder/blog.scm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/haunt/jakob/builder/blog.scm b/haunt/jakob/builder/blog.scm index 13ef492..f6c64c1 100644 --- a/haunt/jakob/builder/blog.scm +++ b/haunt/jakob/builder/blog.scm @@ -29,6 +29,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) #:use-module (srfi srfi-26) + #:use-module (web uri) #:export (post-uri blog)) @@ -45,6 +46,20 @@ ;;; Rendering. ;;; +(define (build-anonymous-comment-url post) + (let* ((target (format #f "http://jakob.space~a" (post-uri post))) + (params `(("dontask" . "1") + ("me" . "https://commentpara.de") + ("reply" . ,target))) + (query (string-join (map (lambda (pair) + (string-concatenate + (list (uri-encode (car pair)) + "=" + (uri-encode (cdr pair))))) + params) + "&"))) + (format #f "https://quill.p3k.io/?~a" query))) + (define (render-article post) "Return the SHTML for POST's contents." #<(main @@ -77,6 +92,9 @@ " to this? Let me know the URL:") (input (@ (name "source") (type "url"))) (input (@ (value "Send Webmention") (type "submit")))) + (p "Alternatively, you can send an " + ,(hyperlink (build-anonymous-comment-url post) "anonymous comment") + ".") ,(script "webmention.js")))) (define (render-preview post) |