Set asset-directory explicitly
gitile/config.scm
| 30 | 30 | config-index-title | |
| 31 | 31 | config-intro | |
| 32 | 32 | config-footer | |
| 33 | + | asset-directory | |
| 33 | 34 | avatar-url-template | |
| 34 | 35 | avatar-hash-algorithm | |
| 35 | 36 | set-parameters-from-config!)) | |
… | |||
| 46 | 47 | (intro config-intro) | |
| 47 | 48 | (footer config-footer)) | |
| 48 | 49 | ||
| 50 | + | (define asset-directory | |
| 51 | + | (make-parameter #f)) | |
| 52 | + | ||
| 49 | 53 | (define avatar-url-template | |
| 50 | 54 | (make-parameter "https://avatar.lepiller.eu/cat-avatar-generator.php?seed=$hash")) | |
| 51 | 55 | ||
… | |||
| 56 | 60 | (let ((params (config-database config))) | |
| 57 | 61 | (if (list? params) | |
| 58 | 62 | (begin | |
| 63 | + | (asset-directory | |
| 64 | + | (or (assoc-ref params 'asset-directory) | |
| 65 | + | (asset-directory))) | |
| 59 | 66 | (avatar-url-template | |
| 60 | 67 | (or (assoc-ref params 'avatar-url-template) | |
| 61 | 68 | (avatar-url-template))) | |
gitile/handler.scm
| 42 | 42 | (dir asset-dir) | |
| 43 | 43 | (mime asset-mime)) | |
| 44 | 44 | ||
| 45 | - | (define (asset-directory) | |
| 46 | - | (canonicalize-path | |
| 47 | - | (string-append (dirname (current-filename)) "/../assets"))) | |
| 48 | - | ||
| 49 | 45 | (define (asset-list-specific dir subdir suffix mime) | |
| 50 | 46 | (map (lambda (name) | |
| 51 | 47 | (make-asset (string-append "/" subdir "/" name) | |
… | |||
| 254 | 250 | (substring request (string-length slug)))) | |
| 255 | 251 | (loop projects)))))))) | |
| 256 | 252 | ||
| 257 | - | (define assets (asset-list (asset-directory))) | |
| 253 | + | (define assets (if (asset-directory) | |
| 254 | + | (asset-list (asset-directory)) | |
| 255 | + | (list))) | |
| 258 | 256 | ||
| 259 | 257 | (match config | |
| 260 | 258 | (($ <config> port host database repositories base-git-url index-title intro | |