diff --git a/collects/meta/web/common/layout.rkt b/collects/meta/web/common/layout.rkt index e63a234303..34d4716b05 100644 --- a/collects/meta/web/common/layout.rkt +++ b/collects/meta/web/common/layout.rkt @@ -89,7 +89,14 @@ (resource (get-path 'plain id file "html" dir) (file-writer output-xml page) referrer))) - (if html-only? page this)) + (when this (pages->part-of this (or part-of this))) + (or this page)) + +;; maps pages to their parts, so symbolic values can be used to determine it +(define pages->part-of + (let ([t (make-hasheq)]) + (case-lambda [(page) (hash-ref t page page)] + [(page part-of) (hash-set! t page part-of)]))) (provide set-navbar!) (define-syntax-rule (set-navbar! pages help) @@ -100,9 +107,13 @@ (define navbar-info (box #f)) (define (navbar-maker logo) - (define pages-promise (lazy (car (or (unbox navbar-info) - (error 'navbar "no navbar info set"))))) - (define help-promise (lazy (cadr (unbox navbar-info)))) + (define pages-promise + (lazy (car (or (unbox navbar-info) + (error 'navbar "no navbar info set"))))) + (define help-promise + (lazy (cadr (unbox navbar-info)))) + (define pages-parts-of-promise + (lazy (map pages->part-of (force pages-promise)))) (define (middle-text size x) (span style: `("font-size: ",size"px; vertical-align: middle;") class: 'navtitle @@ -126,12 +137,14 @@ CLOSE)) (define (links-table this) (table width: "100%" - (tr (map (lambda (nav) + (tr (map (lambda (nav navpart) (td class: 'navlinkcell (span class: 'navitem - (span class: (if (eq? this nav) 'navcurlink 'navlink) + (span class: (if (eq? (pages->part-of this) navpart) + 'navcurlink 'navlink) nav)))) - (force pages-promise))))) + (force pages-promise) + (force pages-parts-of-promise))))) (lambda (this) (div class: 'racketnav (div class: 'navcontent diff --git a/collects/meta/web/download/index.rkt b/collects/meta/web/download/index.rkt index e8bc4dd96c..ce9e26367e 100644 --- a/collects/meta/web/download/index.rkt +++ b/collects/meta/web/download/index.rkt @@ -11,7 +11,7 @@ (provide index) (define index - @page[#:link-title "Downloads"]{ + @page[#:link-title "Downloads" #:part-of 'download]{ @div[style: "float: right;"]{@download-button} Use these links to browse the download directories directly: @ul{@li{Current @a[href: `(,installers "/recent")]{installers} diff --git a/collects/meta/web/download/installer-pages.rkt b/collects/meta/web/download/installer-pages.rkt index f5149634b6..9b8cc298c1 100644 --- a/collects/meta/web/download/installer-pages.rkt +++ b/collects/meta/web/download/installer-pages.rkt @@ -25,7 +25,7 @@ [(render-option) (option value: url platform type)] [(#f) @a[href: url]{@title}] [else (error 'installer-page "unknown mode: ~e" mode)])) - @page[#:file html-file #:title title #:referrer this]{ + @page[#:file html-file #:title title #:referrer this #:part-of 'download]{ @table[width: "90%" align: 'center]{ @tr[valign: 'top]{ @td[width: "50%"]{ diff --git a/collects/meta/web/minis/lists.rkt b/collects/meta/web/minis/lists.rkt index 247d4d69d5..797672aa13 100644 --- a/collects/meta/web/minis/lists.rkt +++ b/collects/meta/web/minis/lists.rkt @@ -17,7 +17,7 @@ see how the sausages are made @mdash and help make them.}))) (define lists - @page[#:title "Mailing Lists" #:file ""]{ + @page[#:title "Mailing Lists" #:file "" #:part-of 'community]{ @p{This is the Racket mailing list server. We have three public mailing lists listed below, with several mirrors for each one.} @(map show-list MLs)}) diff --git a/collects/meta/web/stubs/blog.rkt b/collects/meta/web/stubs/blog.rkt index bf1bfbacef..f3aebc5046 100644 --- a/collects/meta/web/stubs/blog.rkt +++ b/collects/meta/web/stubs/blog.rkt @@ -32,15 +32,13 @@ ;; in blogger pages (regexp-replace* #rx" " str "\\ "))) -(define (racket-navbar) (get-resource-text 'navbar #f)) +(define (racket-navbar) (get-resource-text 'navbar 'community)) (define (racket-favicon) (get-resource-text 'favicon-headers)) (provide blog) (define blog @plain[#:file "" - #:referrer (lambda (u) @a[href: u]{Blog}) - ;; #:part-of community <-- TODO: is doing this a good idea - ]{ + #:referrer (lambda (u) @a[href: u]{Blog})]{ @; This is the blogger style template file, with one hole for the CSS and one @; for the navbar, and a few more tweaks (first by soegaard and then by eli). @; diff --git a/collects/meta/web/stubs/dirlist.rkt b/collects/meta/web/stubs/dirlist.rkt index 6486e8ac1d..7cb867af31 100644 --- a/collects/meta/web/stubs/dirlist.rkt +++ b/collects/meta/web/stubs/dirlist.rkt @@ -10,6 +10,7 @@ (delay (regexp-split #rx"{{{BODY}}}" (xml->string @page[#:id 'browse-downloads #:html-only #t + #:part-of 'download "{{{BODY}}}"])))) (define header @plain[#:file "header.html" (car (force header+footer))]) diff --git a/collects/meta/web/stubs/mailman.rkt b/collects/meta/web/stubs/mailman.rkt index 2122606069..12de2a25c6 100644 --- a/collects/meta/web/stubs/mailman.rkt +++ b/collects/meta/web/stubs/mailman.rkt @@ -32,7 +32,7 @@ (define listinfo @page[#:title @list{Mailing lists: @MM{List-Name}} - #:extra-headers style-header]{ + #:extra-headers style-header #:part-of 'community]{ @; -------------------- @comment{@|| Based on the Mailman file "listinfo.html", revision: 5865 diff --git a/collects/meta/web/www/community.rkt b/collects/meta/web/www/community.rkt index 84c15e1abe..376fd3e833 100644 --- a/collects/meta/web/www/community.rkt +++ b/collects/meta/web/www/community.rkt @@ -6,7 +6,7 @@ (provide community) (define community - @page{ + @page[#:part-of 'community]{ @mailing-lists-quick @parlist[@strong{Discussion Channels} @text{@irc-chat{Chat on IRC} in the @TT{@big{@strong{#racket}}} channel diff --git a/collects/meta/web/www/download.rkt b/collects/meta/web/www/download.rkt index 47d65cc02f..e2063298be 100644 --- a/collects/meta/web/www/download.rkt +++ b/collects/meta/web/www/download.rkt @@ -6,7 +6,7 @@ (define download @page[#:link-title "Download" #:window-title "Download Racket" - #:file "download/"]{ + #:file "download/" #:part-of 'download]{ @(render-download-page)}) (define download-button diff --git a/collects/meta/web/www/help.rkt b/collects/meta/web/www/help.rkt index d900e20275..65616c83fd 100644 --- a/collects/meta/web/www/help.rkt +++ b/collects/meta/web/www/help.rkt @@ -17,7 +17,7 @@ installed. As a second line of defense, the documentation for the core of the most recent version of Racket is available - @a[href: "http://docs.plt-scheme.org"]{from this web site}.} + @a[href: "http://docs.plt-scheme.org/"]{from this web site}.} @text{Not sure what to search for? The documentation includes a @a[href: "http://docs.plt-scheme.org/guide/"]{guide} (also located in your local copy of the documentation) that diff --git a/collects/meta/web/www/irc.rkt b/collects/meta/web/www/irc.rkt index 6ae54bf8ab..35567c4d9c 100644 --- a/collects/meta/web/www/irc.rkt +++ b/collects/meta/web/www/irc.rkt @@ -6,7 +6,7 @@ "http://webchat.freenode.net?channels=racket&uio=OT10cnVlJjExPTIzNg6b") (define irc-chat - @page[#:title "IRC"]{ + @page[#:title "IRC" #:part-of 'community]{ @iframe[src: webchat-link width: "100%" height: "400"]}) (define irc-logs-symlink (symlink "/home/scheme/irc-logs/racket/")) diff --git a/collects/meta/web/www/outreach+research.rkt b/collects/meta/web/www/outreach+research.rkt index f7f76ddfa9..012471dcc1 100644 --- a/collects/meta/web/www/outreach+research.rkt +++ b/collects/meta/web/www/outreach+research.rkt @@ -85,5 +85,5 @@ #:title "Technical Reports" #:extra-headers @meta[http-equiv: "refresh" - content: "2;url=http://plt-scheme.org/techreports/"]]{ + content: "0;url=http://plt-scheme.org/techreports/"]]{ TODO}) diff --git a/collects/meta/web/www/people.rkt b/collects/meta/web/www/people.rkt index 31a9c69f46..341539396b 100644 --- a/collects/meta/web/www/people.rkt +++ b/collects/meta/web/www/people.rkt @@ -37,7 +37,7 @@ (provide people) (define people - @page{ + @page[#:part-of 'community]{ @p{@|ldquo|PLT@|rdquo| refers to the group that is the core of the Racket development team. PLT consists of numerous people distributed across several different universities in the USA: @places}