plt-web and meta/new-web: move and extend web-page identity
For Google and Bing tools
This commit is contained in:
parent
b41ec5dd8c
commit
d459900f45
|
@ -1,6 +1,8 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
|
|
||||||
(require "resources.rkt" "download-pages.rkt")
|
(require "resources.rkt"
|
||||||
|
"download-pages.rkt"
|
||||||
|
"../identity.rkt")
|
||||||
|
|
||||||
(provide index)
|
(provide index)
|
||||||
(define index
|
(define index
|
||||||
|
@ -8,3 +10,5 @@
|
||||||
#:link-title "Download" #:window-title "Download Racket"
|
#:link-title "Download" #:window-title "Download Racket"
|
||||||
#:part-of 'download #:width 'full]{
|
#:part-of 'download #:width 'full]{
|
||||||
@(render-download-page)})
|
@(render-download-page)})
|
||||||
|
|
||||||
|
(register-identity download-site)
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
(require "../testing.rkt")
|
(require "../testing.rkt"
|
||||||
|
"../identity.rkt")
|
||||||
|
|
||||||
(provide download-site)
|
(provide download-site)
|
||||||
|
|
||||||
(define download-site (site "download"
|
(define download-site (site "download"
|
||||||
#:url (rewrite-for-testing "http://download.racket-lang.org/")))
|
#:url (rewrite-for-testing "http://download.racket-lang.org/")
|
||||||
|
#:page-headers (identity-headers)))
|
||||||
|
|
28
pkgs/plt-services/meta/new-web/identity.rkt
Normal file
28
pkgs/plt-services/meta/new-web/identity.rkt
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#lang plt-web
|
||||||
|
|
||||||
|
(provide identity-headers
|
||||||
|
register-identity)
|
||||||
|
|
||||||
|
;; Include the returned header in `#:page-headers` for each site:
|
||||||
|
(define (identity-headers)
|
||||||
|
(list
|
||||||
|
@script{
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
|
ga('create', 'UA-48767493-1', 'racket-lang.org');
|
||||||
|
ga('send', 'pageview');
|
||||||
|
}))
|
||||||
|
|
||||||
|
;; Call this function for each site:
|
||||||
|
(define (register-identity site)
|
||||||
|
;; the following resources are not used directly, so their names are
|
||||||
|
;; irrelevant
|
||||||
|
@plain[#:site site #:file "google5b2dc47c0b1b15cb.html"]{
|
||||||
|
google-site-verification: google5b2dc47c0b1b15cb.html}
|
||||||
|
@plain[#:site site #:file "BingSiteAuth.xml"]{
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<users><user>140BE58EEC31CB97382E1016E21C405A</user></users>}
|
||||||
|
(void))
|
|
@ -1,10 +1,12 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
|
|
||||||
(require "../www/resources.rkt")
|
(require "../www/resources.rkt"
|
||||||
|
"../identity.rkt")
|
||||||
|
|
||||||
(define drracket-site (site "drracket"
|
(define drracket-site (site "drracket"
|
||||||
#:url "http://drracket.org/"
|
#:url "http://drracket.org/"
|
||||||
#:share-from www-site
|
#:share-from www-site
|
||||||
|
#:page-headers (identity-headers)
|
||||||
#:page-style? #f
|
#:page-style? #f
|
||||||
#:meta? #t))
|
#:meta? #t))
|
||||||
|
|
||||||
|
@ -12,6 +14,8 @@
|
||||||
;; to Can Burak Cilingir for both the logo and the drracket.org domain
|
;; to Can Burak Cilingir for both the logo and the drracket.org domain
|
||||||
;; name.
|
;; name.
|
||||||
|
|
||||||
|
(register-identity drracket-site)
|
||||||
|
|
||||||
(define index
|
(define index
|
||||||
(page #:site drracket-site
|
(page #:site drracket-site
|
||||||
#:title "DrRacket" #:extra-headers (lazy headers) (center-div logo)))
|
#:title "DrRacket" #:extra-headers (lazy headers) (center-div logo)))
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
(require "../www/resources.rkt"
|
(require "../www/resources.rkt"
|
||||||
"../testing.rkt"
|
"../testing.rkt"
|
||||||
|
"../identity.rkt"
|
||||||
plt-web/style)
|
plt-web/style)
|
||||||
|
|
||||||
(provide installers)
|
(provide installers)
|
||||||
|
|
||||||
(define pre-site (site "pre"
|
(define pre-site (site "pre"
|
||||||
#:url (rewrite-for-testing "http://pre.racket-lang.org/")
|
#:url (rewrite-for-testing "http://pre.racket-lang.org/")
|
||||||
|
#:page-headers (identity-headers)
|
||||||
#:share-from www-site))
|
#:share-from www-site))
|
||||||
|
|
||||||
|
(register-identity pre-site)
|
||||||
|
|
||||||
(define (main id)
|
(define (main id)
|
||||||
@page[#:site pre-site
|
@page[#:site pre-site
|
||||||
#:id id
|
#:id id
|
||||||
|
|
|
@ -3,12 +3,15 @@
|
||||||
(require plt-web/style
|
(require plt-web/style
|
||||||
"resources.rkt"
|
"resources.rkt"
|
||||||
"utils.rkt"
|
"utils.rkt"
|
||||||
|
"../identity.rkt"
|
||||||
(prefix-in 2011: "2011/all.rkt")
|
(prefix-in 2011: "2011/all.rkt")
|
||||||
(prefix-in 2012: "2012/all.rkt")
|
(prefix-in 2012: "2012/all.rkt")
|
||||||
(prefix-in 2013: "2013/all.rkt"))
|
(prefix-in 2013: "2013/all.rkt"))
|
||||||
|
|
||||||
(provide index)
|
(provide index)
|
||||||
|
|
||||||
|
(register-identity con-site)
|
||||||
|
|
||||||
(define index
|
(define index
|
||||||
@page[#:site con-site
|
@page[#:site con-site
|
||||||
#:link-title "RacketCon" #:title "RacketCon"
|
#:link-title "RacketCon" #:title "RacketCon"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
(require "../www/resources.rkt"
|
(require "../www/resources.rkt"
|
||||||
|
"../identity.rkt"
|
||||||
"../testing.rkt")
|
"../testing.rkt")
|
||||||
|
|
||||||
(provide con-site
|
(provide con-site
|
||||||
|
@ -8,6 +9,7 @@
|
||||||
(define con-site
|
(define con-site
|
||||||
(site "con"
|
(site "con"
|
||||||
#:url (rewrite-for-testing "http://con.racket-lang.org/")
|
#:url (rewrite-for-testing "http://con.racket-lang.org/")
|
||||||
|
#:page-headers (identity-headers)
|
||||||
#:share-from www-site))
|
#:share-from www-site))
|
||||||
|
|
||||||
(define (rcon [year #f] . text)
|
(define (rcon [year #f] . text)
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
"irc.rkt"
|
"irc.rkt"
|
||||||
(prefix-in pre: "../minis/pre.rkt")
|
(prefix-in pre: "../minis/pre.rkt")
|
||||||
(only-in "../stubs/docs.rkt" docs-path)
|
(only-in "../stubs/docs.rkt" docs-path)
|
||||||
(only-in "../rcon/resources.rkt" rcon))
|
(only-in "../rcon/resources.rkt" rcon)
|
||||||
|
"../identity.rkt"
|
||||||
|
(only-in "../stubs/pkgs.rkt"))
|
||||||
|
|
||||||
;; TODO
|
;; TODO
|
||||||
;; -- add links in top paragraph
|
;; -- add links in top paragraph
|
||||||
|
@ -15,6 +17,8 @@
|
||||||
(require "resources.rkt" "code.rkt" "download.rkt" "learning.rkt" "people.rkt"
|
(require "resources.rkt" "code.rkt" "download.rkt" "learning.rkt" "people.rkt"
|
||||||
"community.rkt")
|
"community.rkt")
|
||||||
|
|
||||||
|
(register-identity www-site)
|
||||||
|
|
||||||
(define-runtime-path img-dir "img")
|
(define-runtime-path img-dir "img")
|
||||||
(define-runtime-path js-dir "js")
|
(define-runtime-path js-dir "js")
|
||||||
(define-runtime-path css-dir "css")
|
(define-runtime-path css-dir "css")
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#lang plt-web
|
#lang plt-web
|
||||||
(require plt-web/style
|
(require plt-web/style
|
||||||
|
"../identity.rkt"
|
||||||
"../testing.rkt")
|
"../testing.rkt")
|
||||||
|
|
||||||
(provide www-site)
|
(provide www-site)
|
||||||
|
@ -7,6 +8,7 @@
|
||||||
(define www-site
|
(define www-site
|
||||||
(site "www"
|
(site "www"
|
||||||
#:url (rewrite-for-testing "http://www.racket-lang.org/")
|
#:url (rewrite-for-testing "http://www.racket-lang.org/")
|
||||||
|
#:page-headers (identity-headers)
|
||||||
#:navigation
|
#:navigation
|
||||||
(list
|
(list
|
||||||
@a[href: (resource "stubs/pkgs/" #f)]{Packages}
|
@a[href: (resource "stubs/pkgs/" #f)]{Packages}
|
||||||
|
|
|
@ -38,6 +38,7 @@ relative directory is mapped to a destination URL via
|
||||||
[#:always-abs-url? always-abs-url? any/c #t]
|
[#:always-abs-url? always-abs-url? any/c #t]
|
||||||
[#:share-from share-from (or/c site? #f) #f]
|
[#:share-from share-from (or/c site? #f) #f]
|
||||||
[#:page-style? page-style? any/c #t]
|
[#:page-style? page-style? any/c #t]
|
||||||
|
[#:page-headers page-headers outputable/c null]
|
||||||
[#:meta? meta? any/c page-style?]
|
[#:meta? meta? any/c page-style?]
|
||||||
[#:robots robots (or/c #f #t outputable/c) #t]
|
[#:robots robots (or/c #f #t outputable/c) #t]
|
||||||
[#:htaccess htaccess (or/c #f #t outputable/c) #t]
|
[#:htaccess htaccess (or/c #f #t outputable/c) #t]
|
||||||
|
@ -65,6 +66,9 @@ include content to set the style of the overall page. Otherwise, only
|
||||||
sufficient resources and content are included to specify the style of
|
sufficient resources and content are included to specify the style of
|
||||||
the PLT web-page header (i.e., a bar with the Racket logo).
|
the PLT web-page header (i.e., a bar with the Racket logo).
|
||||||
|
|
||||||
|
The @racket[page-headers] argument provides content for the header of
|
||||||
|
any HTML page generated at the site via @racket[page] or @racket[page*].
|
||||||
|
|
||||||
If @racket[meta?] is true, then @filepath{.htaccess},
|
If @racket[meta?] is true, then @filepath{.htaccess},
|
||||||
@filepath{robots.txt}, and similar files are generated for the site.
|
@filepath{robots.txt}, and similar files are generated for the site.
|
||||||
The @racket[robots] and @racket[htaccess] arguments determine robot
|
The @racket[robots] and @racket[htaccess] arguments determine robot
|
||||||
|
|
|
@ -223,7 +223,7 @@
|
||||||
null)
|
null)
|
||||||
})
|
})
|
||||||
|
|
||||||
(define (make-resources files navigation page-style? sharing-site)
|
(define (make-resources files navigation page-style? extra-headers sharing-site)
|
||||||
(define (recur/share what)
|
(define (recur/share what)
|
||||||
(if sharing-site
|
(if sharing-site
|
||||||
((site-resources sharing-site) what)
|
((site-resources sharing-site) what)
|
||||||
|
@ -253,7 +253,7 @@
|
||||||
[sharing-site (recur/share what)]
|
[sharing-site (recur/share what)]
|
||||||
[else (error 'resource "unknown resource: ~e" what)])]))
|
[else (error 'resource "unknown resource: ~e" what)])]))
|
||||||
(define icon-headers (html-icon-headers (resources 'icon-path)))
|
(define icon-headers (html-icon-headers (resources 'icon-path)))
|
||||||
(define headers (html-headers resources icon-headers page-style?))
|
(define headers (list (html-headers resources icon-headers page-style?) extra-headers))
|
||||||
(define make-navbar (navbar-maker (resources 'logo-path) navigation page-style?))
|
(define make-navbar (navbar-maker (resources 'logo-path) navigation page-style?))
|
||||||
(define make-navbar-content (navbar-content (resources 'logo-path) navigation page-style?))
|
(define make-navbar-content (navbar-content (resources 'logo-path) navigation page-style?))
|
||||||
(define preamble (cons @doctype['html]
|
(define preamble (cons @doctype['html]
|
||||||
|
@ -280,6 +280,7 @@
|
||||||
#:robots [robots #t]
|
#:robots [robots #t]
|
||||||
#:htaccess [htaccess #t]
|
#:htaccess [htaccess #t]
|
||||||
#:navigation [navigation null]
|
#:navigation [navigation null]
|
||||||
|
#:page-headers [headers null]
|
||||||
#:page-style? [page-style? #t]
|
#:page-style? [page-style? #t]
|
||||||
#:meta? [meta? page-style?]
|
#:meta? [meta? page-style?]
|
||||||
#:share-from [given-sharing-site #f])
|
#:share-from [given-sharing-site #f])
|
||||||
|
@ -304,12 +305,13 @@
|
||||||
#:site the-site
|
#:site the-site
|
||||||
content))
|
content))
|
||||||
dir robots htaccess
|
dir robots htaccess
|
||||||
page-style?
|
page-style?
|
||||||
meta?
|
meta?
|
||||||
(and sharing-site
|
(and sharing-site
|
||||||
#t))
|
#t))
|
||||||
navigation
|
navigation
|
||||||
page-style?
|
page-style?
|
||||||
|
headers
|
||||||
sharing-site))))
|
sharing-site))))
|
||||||
the-site)])
|
the-site)])
|
||||||
site))
|
site))
|
||||||
|
|
|
@ -59,13 +59,6 @@
|
||||||
null)
|
null)
|
||||||
,@(if meta?
|
,@(if meta?
|
||||||
(list
|
(list
|
||||||
;; the following resources are not used directly, so their names are
|
|
||||||
;; irrelevant
|
|
||||||
@writefile["google5b2dc47c0b1b15cb.html"]{
|
|
||||||
google-site-verification: google5b2dc47c0b1b15cb.html}
|
|
||||||
@writefile["BingSiteAuth.xml"]{
|
|
||||||
<?xml version="1.0"?>
|
|
||||||
<users><user>140BE58EEC31CB97382E1016E21C405A</user></users>}
|
|
||||||
;; #t (the default) => no-op file, good to avoid error-log lines
|
;; #t (the default) => no-op file, good to avoid error-log lines
|
||||||
(let* ([t (if (eq? #t robots) "Disallow:" robots)]
|
(let* ([t (if (eq? #t robots) "Disallow:" robots)]
|
||||||
[t (and t (list "User-agent: *\n" t))])
|
[t (and t (list "User-agent: *\n" t))])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user