From 3eafbd03355581d72e89d4b5274975f795043850 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 4 Sep 2024 10:15:17 +0300 Subject: Set the branch name to a default value for github links. * web/view/markdown.scm (form-github-raw-url): Make branch an optional value that defaults to "master". (form-github-edit-url): Ditto. Signed-off-by: Munyoki Kilyungi --- web/view/markdown.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'web/view') diff --git a/web/view/markdown.scm b/web/view/markdown.scm index 0a408b3..3236cce 100644 --- a/web/view/markdown.scm +++ b/web/view/markdown.scm @@ -27,20 +27,24 @@ (receive (response-status response-body) (http-request url) response-body)) -(define (form-github-raw-url project repo page) +(define* (form-github-raw-url project repo page #:optional (branch "master")) (string-append "https://raw.githubusercontent.com/" project "/" repo - "/master/" + "/" + branch + "/" (string-join page "/"))) -(define (form-github-edit-url project repo page) +(define* (form-github-edit-url project repo page #:optional (branch "master")) (string-append "https://github.com/" project "/" repo - "/edit/master/" + "/edit/" + branch + "/" (string-join page "/"))) (define (markdown-github->sxml path) -- cgit v1.2.3