diff --git a/pkgs/plt-web-pkgs/plt-web-doc/plt-web.scrbl b/pkgs/plt-web-pkgs/plt-web-doc/plt-web.scrbl index 68874daf28..fa2ad28738 100644 --- a/pkgs/plt-web-pkgs/plt-web-doc/plt-web.scrbl +++ b/pkgs/plt-web-pkgs/plt-web-doc/plt-web.scrbl @@ -236,6 +236,11 @@ file lists the content specified by @racket[content], where an integer corresponds to a file size and @racket['dir] indicates a directory.} +@defproc[(call-with-registered-roots [thunk (-> any)]) any]{ + +Calls @racket[thunk] with @racket[url-roots] set to a mapping for +registered sites.} + @; ---------------------------------------- @section{Generating Site Content} diff --git a/pkgs/plt-web-pkgs/plt-web-lib/layout.rkt b/pkgs/plt-web-pkgs/plt-web-lib/layout.rkt index fc690aa9a8..bb77f1020f 100644 --- a/pkgs/plt-web-pkgs/plt-web-lib/layout.rkt +++ b/pkgs/plt-web-pkgs/plt-web-lib/layout.rkt @@ -13,7 +13,8 @@ site-css-path site-favicon-path site-navbar - site-navbar-dynamic-js) + site-navbar-dynamic-js + call-with-registered-roots) (define-for-syntax (process-contents who layouter stx xs) (let loop ([xs xs] [kws '()] [id? #f]) @@ -70,7 +71,7 @@ ;; if this is true, return only the html -- don't create ;; a resource -- therefore no file is made, and no links ;; to it can be made (useful only for stub templates) - #:html-only [html-only? #f] + #:html-only? [html-only? #f] #:title [label (if id (let* ([id (format "~a" (force id))] [id (regexp-replace #rx"^.*/" id "")] @@ -344,3 +345,7 @@ } }) + +(define (call-with-registered-roots proc) + (parameterize ([url-roots (registered-url-roots)]) + (proc)))