Get our favicon to be used.

This commit is contained in:
Eli Barzilay 2010-06-15 12:42:59 -04:00
parent 5c027b6973
commit dc0959ce05
2 changed files with 20 additions and 8 deletions

View File

@ -135,22 +135,29 @@
(span class: 'helpicon (if (eq? this help) nbsp help)))))
(tr (td colspan: 2 (links-table this))))))))
(define (html-head-maker icon style)
(define (html-favicon-maker icon)
(define headers
(list @link[rel: "icon" href: icon type: "image/ico"]
@link[rel: "shortcut icon" href: icon]))
(lambda () headers))
(define (html-head-maker style favicon)
(define headers
(list @meta[name: "generator" content: "Racket"]
@meta[http-equiv: "Content-Type" content: "text/html; charset=utf-8"]
@link[rel: "icon" href: icon type: "image/ico"]
@link[rel: "shortcut icon" href: icon]
favicon
style))
(lambda (title* more-headers) (head @title[title*] headers more-headers)))
(define (make-resources icon logo style)
(let ([make-head (html-head-maker icon style)]
[make-navbar (navbar-maker logo)])
(let* ([favicon (html-favicon-maker icon)]
[make-head (html-head-maker style favicon)]
[make-navbar (navbar-maker logo)])
(lambda (what . more)
(apply (case what
[(head) make-head]
[(navbar) make-navbar]
[(favicon-headers) favicon]
[else (error 'resources "internal error")])
more))))

View File

@ -26,12 +26,14 @@
@navbar-style
})
(define (racket-navbar)
(define (xml->string content)
(regexp-replace* #rx" "
(with-output-to-string
(lambda () (output-xml (www:the-resources 'navbar #f))))
(with-output-to-string (lambda () (output-xml content)))
"\\ "))
(define (racket-navbar) (xml->string (www:the-resources 'navbar #f)))
(define (racket-favicon) (xml->string (www:the-resources 'favicon-headers)))
(provide blog)
(define blog
@plain[#:file ""
@ -480,6 +482,9 @@ body#layout #header {
/*** Racket CSS end ***/
]]></b:skin>
@racket-favicon
</head>
<body>