Compact the main nav a little more effectively
This commit is contained in:
parent
70e0790fe9
commit
0b9c0f28bd
|
@ -85,11 +85,7 @@
|
|||
,(bootstrap-project-name))))
|
||||
(div ((id "navbar") (class "collapse navbar-collapse"))
|
||||
(ul ((class "nav navbar-nav"))
|
||||
,@(for/list ((n (bootstrap-navigation)))
|
||||
(match-define (list text url) n)
|
||||
`(li ,@(maybe-splice (equal? text (bootstrap-active-navigation))
|
||||
`((class "active")))
|
||||
(a ((href ,url)) ,text))))
|
||||
,@(render-nav-items (bootstrap-navigation)))
|
||||
,@(bootstrap-navbar-extension)
|
||||
)))
|
||||
(div ((class "container"))
|
||||
|
@ -105,6 +101,28 @@
|
|||
,@(for/list ((script (bootstrap-page-scripts)))
|
||||
`(script ((type "text/javascript") (src ,script))))))))
|
||||
|
||||
(define (render-nav-items items)
|
||||
(for/list ((n items))
|
||||
(match n
|
||||
[(list text (? string? url))
|
||||
`(li ,@(maybe-splice (equal? text (bootstrap-active-navigation))
|
||||
`((class "active")))
|
||||
(a ((href ,url)) ,text))]
|
||||
['separator
|
||||
`(li ((role "separator") (class "divider")))]
|
||||
[(list text (? list? subitems))
|
||||
`(li ((class "dropdown"))
|
||||
(a ((href "#")
|
||||
(class "dropdown-toggle")
|
||||
(data-toggle "dropdown")
|
||||
(role "button")
|
||||
(aria-haspopup "true")
|
||||
(aria-expanded "false"))
|
||||
,text
|
||||
(span ((class "caret"))))
|
||||
(ul ((class "dropdown-menu"))
|
||||
,@(render-nav-items subitems)))])))
|
||||
|
||||
;; String [#:permanent? Boolean] [#:headers (Listof Header)] -> Response
|
||||
(define (bootstrap-redirect url
|
||||
#:permanent? [permanent? #f]
|
||||
|
|
20
src/site.rkt
20
src/site.rkt
|
@ -126,14 +126,18 @@
|
|||
|
||||
(define-syntax-rule (with-site-config body ...)
|
||||
(parameterize ((bootstrap-navbar-header (navbar-header))
|
||||
(bootstrap-navigation `((,nav-index ,(main-page-url))
|
||||
(,nav-search ,(named-url search-page))
|
||||
("About Package Builds" "https://pkg-build.racket-lang.org/about.html")
|
||||
("Documentation" "https://docs.racket-lang.org/")
|
||||
((div ,(glyphicon 'download-alt)
|
||||
" Download Racket")
|
||||
"http://download.racket-lang.org/")
|
||||
))
|
||||
(bootstrap-navigation
|
||||
`((,nav-index ,(main-page-url))
|
||||
("Documentation" "https://docs.racket-lang.org/")
|
||||
(,nav-search ,(named-url search-page))
|
||||
("About"
|
||||
(("The Racket Package System"
|
||||
"http://docs.racket-lang.org/pkg/getting-started.html")
|
||||
("Package Builds" "https://pkg-build.racket-lang.org/about.html")))
|
||||
((div ,(glyphicon 'download-alt)
|
||||
" Download Racket")
|
||||
"http://download.racket-lang.org/")
|
||||
))
|
||||
(bootstrap-static-urlprefix
|
||||
(if (rendering-static-page?)
|
||||
static-urlprefix
|
||||
|
|
Loading…
Reference in New Issue
Block a user