From 4bc524d02ce063bf598f9630907b0f1010734995 Mon Sep 17 00:00:00 2001 From: m455 Date: Wed, 7 Dec 2022 21:42:04 -0500 Subject: [PATCH] Changed file source image view path to absolute path - my last fix used to use a relative path to the image, this fix makes an absolute path - i added a parameter to the display-source-html function so i could use the repository-name in the format functions that are used there - changed some of the string template "repo-name"s to "repository-name"s to stay consistent with the rest of the main.scm --- main.scm | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/main.scm b/main.scm index 010823c..5ec152f 100755 --- a/main.scm +++ b/main.scm @@ -19,7 +19,7 @@ (define DESCRIPTION (or (get-environment-variable "REPO2HTML_DESCRIPTION") "my git repositories")) (define H1 (or (get-environment-variable "REPO2HTML_H1") "git.example.com")) -(define (populate-html-template repo-name display-body-thunk) +(define (populate-html-template repository-name display-body-thunk) (display #<#string-block @@ -56,12 +56,12 @@ hr {

#{H1}

-

#{repo-name}

-

clone url: #{CLONE-URL}/#{repo-name}

+

#{repository-name}

+

clone url: #{CLONE-URL}/#{repository-name}


string-block @@ -88,7 +88,7 @@ string-block (call-with-input-pipe read-lines) (string-intersperse "\n"))) -(define (display-source-html source-file) ;; src/main.scm +(define (display-source-html repository-name source-file) ;; src/main.scm (format #t "

~a

" source-file) (case (string->symbol (or (pathname-extension source-file) "no-extension")) ((md markdown) @@ -103,9 +103,9 @@ string-block (display "")) (markdown->html (git-file->string source-file)))) ((jpg jpeg png gif webp webm apng avif svgz ico) - (format #t "

" source-file)) + (format #t "

" repository-name source-file)) ((svg) - (format #t "

" source-file) + (format #t "

" repository-name source-file) (display "
")
      (display-escaped-html (git-file->string source-file))
      (display "
")) @@ -160,7 +160,7 @@ string-block (lambda (source-file) (write-with-template (string-append source-file ".html") - (lambda () (display-source-html source-file))) + (lambda () (display-source-html repository-name source-file))) (case (string->symbol (or (pathname-extension source-file) "")) ((jpg jpeg png gif webp webm svg apng avif svgz ico) (system (format "git show HEAD:~a > ~a"