commit a9f5a8c513f9d379668ec0f0ccd180a0bb009c81
parent 1bf7397ac869edaeb1032904aca8f6f66cdc2791
Author: Eli Barzilay <eli@barzilay.org>
Date: Fri, 2 Jul 2010 04:52:22 -0400
Added `get-resource-path' to get the path of any resource.
Use it to allow getting the standard resource paths from the common
layout.
original commit: 8f69e94980760da76651a1140d052b0acbae90a7
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/collects/meta/web/html/resource.rkt b/collects/meta/web/html/resource.rkt
@@ -200,7 +200,13 @@
(add-renderer path render)
(make-keyword-procedure
(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
;; `output-xml' or `display') and some content