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

View File

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