More files for all sites.
Two verification files for google/bing website tools, and also add a no-op robots.txt file to avoid error-log lines.
This commit is contained in:
parent
06f67b30f3
commit
fb2b5418df
|
@ -1,6 +1,6 @@
|
||||||
#lang at-exp racket/base
|
#lang at-exp racket/base
|
||||||
|
|
||||||
(require scribble/html (for-syntax racket/base syntax/name)
|
(require scribble/html (for-syntax racket/base syntax/name syntax/parse)
|
||||||
"utils.rkt" "resources.rkt")
|
"utils.rkt" "resources.rkt")
|
||||||
|
|
||||||
(define-for-syntax (process-contents who layouter stx xs)
|
(define-for-syntax (process-contents who layouter stx xs)
|
||||||
|
@ -210,21 +210,27 @@
|
||||||
;; site) to have its own resources (and possibly other customizations).
|
;; site) to have its own resources (and possibly other customizations).
|
||||||
(provide define+provide-context define-context)
|
(provide define+provide-context define-context)
|
||||||
(define-for-syntax (make-define+provide-context stx provide?)
|
(define-for-syntax (make-define+provide-context stx provide?)
|
||||||
(define (make-it dir [resources #f])
|
(syntax-parse stx
|
||||||
(with-syntax ([dir dir]
|
[(_ (~or (~optional dir:expr)
|
||||||
[page-id (datum->syntax stx 'page)]
|
(~optional (~seq #:resources resources))
|
||||||
|
(~optional (~seq #:robots.txt robots.txt)
|
||||||
|
#:defaults ([robots.txt #'#t])))
|
||||||
|
...)
|
||||||
|
(unless (attribute dir)
|
||||||
|
(raise-syntax-error 'define-context "missing <dir>"))
|
||||||
|
(with-syntax ([page-id (datum->syntax stx 'page)]
|
||||||
[plain-id (datum->syntax stx 'plain)]
|
[plain-id (datum->syntax stx 'plain)]
|
||||||
[copyfile-id (datum->syntax stx 'copyfile)]
|
[copyfile-id (datum->syntax stx 'copyfile)]
|
||||||
[symlink-id (datum->syntax stx 'symlink)]
|
[symlink-id (datum->syntax stx 'symlink)]
|
||||||
[resources-id (datum->syntax stx 'the-resources)])
|
[resources-id (datum->syntax stx 'the-resources)])
|
||||||
(with-syntax ([resources (or resources #'(make-resources
|
(with-syntax ([resources (or (attribute resources)
|
||||||
(make-resource-files dir)))]
|
#'(make-resources (make-resource-files
|
||||||
|
dir robots.txt)))]
|
||||||
[provides (if provide?
|
[provides (if provide?
|
||||||
#'(provide page-id plain-id copyfile-id
|
#'(provide page-id plain-id copyfile-id
|
||||||
symlink-id resources-id)
|
symlink-id resources-id)
|
||||||
#'(begin))])
|
#'(begin))])
|
||||||
#'(begin
|
#'(begin (define resources-id resources)
|
||||||
(define resources-id resources)
|
|
||||||
(define-syntax-rule (page-id . xs)
|
(define-syntax-rule (page-id . xs)
|
||||||
(page #:resources resources-id #:dir dir . xs))
|
(page #:resources resources-id #:dir dir . xs))
|
||||||
(define-syntax-rule (plain-id . xs)
|
(define-syntax-rule (plain-id . xs)
|
||||||
|
@ -233,10 +239,7 @@
|
||||||
(copyfile-resource source target #:dir dir))
|
(copyfile-resource source target #:dir dir))
|
||||||
(define (symlink-id source [target #f])
|
(define (symlink-id source [target #f])
|
||||||
(symlink-resource source target #:dir dir))
|
(symlink-resource source target #:dir dir))
|
||||||
provides))))
|
provides)))]))
|
||||||
(syntax-case stx ()
|
|
||||||
[(_ dir) (make-it #'dir)]
|
|
||||||
[(_ dir #:resources resources) (make-it #'dir #'resources)]))
|
|
||||||
(define-syntax (define+provide-context stx)
|
(define-syntax (define+provide-context stx)
|
||||||
(make-define+provide-context stx #t))
|
(make-define+provide-context stx #t))
|
||||||
(define-syntax (define-context stx)
|
(define-syntax (define-context stx)
|
||||||
|
|
|
@ -13,14 +13,25 @@
|
||||||
(provide make-resource-files
|
(provide make-resource-files
|
||||||
navbar-style page-sizes font-family) ; needed for the blog template
|
navbar-style page-sizes font-family) ; needed for the blog template
|
||||||
|
|
||||||
(define (make-resource-files dir)
|
(define (make-resource-files dir robots.txt)
|
||||||
(define (copyfile file)
|
(define (copyfile file)
|
||||||
(copyfile-resource (in-here file) (web-path dir file)))
|
(copyfile-resource (in-here file) (web-path dir file)))
|
||||||
(define (writefile file contents)
|
(define (writefile file . contents)
|
||||||
(resource (web-path dir file) (file-writer output (list contents "\n"))))
|
(resource (web-path dir file) (file-writer output (list contents "\n"))))
|
||||||
`([logo ,(copyfile "logo.png")]
|
`([logo ,(copyfile "logo.png")]
|
||||||
[icon ,(copyfile "plticon.ico")]
|
[icon ,(copyfile "plticon.ico")]
|
||||||
[style ,(writefile "plt.css" racket-style)]))
|
[style ,(writefile "plt.css" racket-style)]
|
||||||
|
[verification:google
|
||||||
|
@,writefile["google5b2dc47c0b1b15cb.html"]{
|
||||||
|
google-site-verification: google5b2dc47c0b1b15cb.html}]
|
||||||
|
[verification:bing
|
||||||
|
@,writefile["BingSiteAuth.xml"]{
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<users><user>140BE58EEC31CB97382E1016E21C405A</user></users>}]
|
||||||
|
[robots
|
||||||
|
;; #t (the default) => no-op file, good to avoid error-log lines
|
||||||
|
,(let ([t (if (eq? #t robots.txt) "User-agent: *\nDisallow:" robots.txt)])
|
||||||
|
(and t (writefile "robots.txt" t)))]))
|
||||||
|
|
||||||
(define page-sizes
|
(define page-sizes
|
||||||
@list{
|
@list{
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#lang meta/web
|
#lang meta/web
|
||||||
|
|
||||||
(define-context "stubs/git")
|
(define-context "stubs/git"
|
||||||
|
#:robots.txt @list{User-agent: *
|
||||||
|
@(add-newlines (for/list ([d '(plt libs testing play)])
|
||||||
|
@list{Disallow: /@|d|/}))})
|
||||||
|
|
||||||
(provide git)
|
(provide git)
|
||||||
(define git
|
(define git
|
||||||
|
@ -27,11 +30,6 @@
|
||||||
@p{See the "brief", PLT-oriented @intro{introduction to git}.}}))
|
@p{See the "brief", PLT-oriented @intro{introduction to git}.}}))
|
||||||
(define home-file @plain[#:file "home-text.html" home-text])
|
(define home-file @plain[#:file "home-text.html" home-text])
|
||||||
|
|
||||||
(define robots.txt
|
|
||||||
@plain{User-agent: *
|
|
||||||
@(add-newlines (for/list ([d '(plt libs testing play)])
|
|
||||||
@list{Disallow: /@|d|/}))})
|
|
||||||
|
|
||||||
(define gitweb-config
|
(define gitweb-config
|
||||||
@plain[#:file "gitweb_config.perl"]{
|
@plain[#:file "gitweb_config.perl"]{
|
||||||
our $projectroot = "repos";
|
our $projectroot = "repos";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user