1
0
Fork 0

Adds support for repo hosted images and removes the need to pass an image path

This commit is contained in:
sloum 2022-10-04 23:06:00 -07:00
parent 63fe1bf7e2
commit 6812561666
2 changed files with 12 additions and 10 deletions

BIN
.solo/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

22
soloweb
View File

@ -499,21 +499,17 @@
(define count-dirs (lambda (p)
(length (filter (lambda (c) (equal? c "/")) (string->list p)))))
(define init (lambda (solo-path image)
(define init (lambda (solo-path)
(is-solo? solo-path)
(if (equal? (path-dir solo-path) (pwd))
(error-exit "soloweb error: the site cannot be generated in the same directory as the repository, as the folders will share a name"))
(set! repo-dir solo-path)
(set! c (conf solo-path))
(set! repo-name (path-base solo-path))
(if (and image (path-exists? image))
(begin
(set! logo-file (append "logo" (path-extension image)))
(cp image logo-file))
(display-lines "No logo file was found, skipping"))
(define new-base (path-join (pwd) repo-name))
(mkdir new-base 0755)
(chdir new-base)
(display-lines "soloweb: archiving and compressing")
(chdir (path-dir repo-dir))
@ -523,6 +519,14 @@
(chdir new-base)
(mkdir "files" 0755)
(define logo-list (path-glob (path-join repo-dir ".solo" "logo.*")))
(if (not (null? logo-list))
(begin
(set! logo-file (path-base (car logo-list)))
(cp (car logo-list) logo-file))
(display-lines "No logo file was found, skipping"))
(display-lines "soloweb: generating html")
(make-history-html)
(make-files-html)
@ -533,11 +537,9 @@
(set! sys-args (cdr sys-args))
(case (length sys-args)
(0 (error-exit "No solo repo path was given"))
(1 (init (path-abs (car sys-args)) #f))
(1 (init (path-abs (car sys-args))))
(else
(init
(path-abs (car sys-args))
(path-abs (car (cdr sys-args))))))))
(error-exit "Too many arguments. Expected only a path to a solo repo.")))))
(main)
; vim: ts=2 sw=2 expandtab ft=slope