From dd1996eefd5a03588fd001928c5685d8496b3862 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 14 Oct 2013 02:20:10 -0400 Subject: [PATCH] Major simplification of site resources. Only one resource (`make-navbar') returns a function now, the others return just misc contents. Dump the idea of a `head' resource which complicated things whenever something new needed to be injected into the head section -- and instead do the head assembly in the page layout function. Turn the preamble and postamble into resources too in preparation for more contents taht is used in the postamble, mostly dealing with resource files. (The former doesn't need to be one since it's just static text, but make it symmetric.) Finally, the resources (implemented in `make-resources') have some symbols that return things that are constructed by the code, and the rest are files that are copied. There are also some symbolic names that stand for "special" resources -- these should get attention on changes, since they are mostly there to expose some things for various pages. For example, if more CSS is added, `style-path' should change to be a list of CSS files and the code that uses it (in the git content that is derived by gitweb) should also be adjusted to deal with more than one file. --- new-racket-web/web/common/layout.rkt | 199 ++++++++++++------------ new-racket-web/web/common/resources.rkt | 67 ++++---- new-racket-web/web/stubs/blog.rkt | 16 +- 3 files changed, 145 insertions(+), 137 deletions(-) diff --git a/new-racket-web/web/common/layout.rkt b/new-racket-web/web/common/layout.rkt index 88e0d423e8..ee449d57fc 100644 --- a/new-racket-web/web/common/layout.rkt +++ b/new-racket-web/web/common/layout.rkt @@ -51,32 +51,6 @@ ;; page layout function (define-syntax (page stx) (syntax-case stx () [(_ . xs) (process-contents 'page #'page* stx #'xs)])) -(define preamble - @list{ - @doctype['html] - @; paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ - @comment{[if lt IE 7]>