Added `get-resource-path' to get the path of any resource.
Use it to allow getting the standard resource paths from the common layout.
This commit is contained in:
parent
76300bd759
commit
8f69e94980
|
@ -184,6 +184,9 @@
|
||||||
[(head) make-head]
|
[(head) make-head]
|
||||||
[(navbar) make-navbar]
|
[(navbar) make-navbar]
|
||||||
[(favicon-headers) favicon]
|
[(favicon-headers) favicon]
|
||||||
|
[(icon-path) (lambda () (get-resource-path icon))]
|
||||||
|
[(logo-path) (lambda () (get-resource-path logo))]
|
||||||
|
[(style-path) (lambda () (get-resource-path style))]
|
||||||
[else (error 'resources "internal error")])
|
[else (error 'resources "internal error")])
|
||||||
more))))
|
more))))
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,13 @@
|
||||||
(add-renderer path render)
|
(add-renderer path render)
|
||||||
(make-keyword-procedure
|
(make-keyword-procedure
|
||||||
(lambda (kws kvs . args) (keyword-apply referrer kws kvs (url) args))
|
(lambda (kws kvs . args) (keyword-apply referrer kws kvs (url) args))
|
||||||
(lambda args (apply referrer (url) args)))))
|
(case-lambda [(x) (if (eq? x get-resource-path) (url) (referrer (url) x))]
|
||||||
|
[args (apply referrer (url) args)]))))
|
||||||
|
|
||||||
|
;; make it possible to always get the path to a resource
|
||||||
|
(provide get-resource-path)
|
||||||
|
(define (get-resource-path resource)
|
||||||
|
(resource get-resource-path))
|
||||||
|
|
||||||
;; a convenient utility to create renderers from some output function (like
|
;; a convenient utility to create renderers from some output function (like
|
||||||
;; `output-xml' or `display') and some content
|
;; `output-xml' or `display') and some content
|
||||||
|
|
Loading…
Reference in New Issue
Block a user