diff options
author | Munyoki Kilyungi | 2024-09-04 10:15:17 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2024-09-04 11:42:07 +0300 |
commit | 3eafbd03355581d72e89d4b5274975f795043850 (patch) | |
tree | d7c46d83d64f0955ad116c923049bf33893b1c92 /web/view | |
parent | cfee36707b7cf03a5d6838f0dd62ae6539f3b8a3 (diff) | |
download | gn-guile-3eafbd03355581d72e89d4b5274975f795043850.tar.gz |
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 <me@bonfacemunyoki.com>
Diffstat (limited to 'web/view')
-rw-r--r-- | web/view/markdown.scm | 12 |
1 files changed, 8 insertions, 4 deletions
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) |