Build multiple HTMLs

This commit is contained in:
Greg Hendershott 2012-11-13 13:57:32 -05:00
parent 16bbc60944
commit 1dd377cc5f
5 changed files with 15 additions and 371 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
.DS_Store
main.html
index/

View File

@ -41,9 +41,15 @@ EOF
(define all (string-append metas web-font ga-code </head>))
(define subst (regexp-replace* "\n" all "")) ;minify
(define old (file->string "main.html"))
(define new (regexp-replace "</head>" old subst))
(with-output-to-file (build-path 'same "index.html")
(lambda () (display new))
#:mode 'text
#:exists 'replace)
(define (do-file path)
(define old (file->string path))
(define new (regexp-replace </head> old subst))
(with-output-to-file path
(lambda () (display new))
#:mode 'text
#:exists 'replace))
(for ([path (find-files (lambda (path)
(regexp-match? #rx"\\.html" path))
(build-path 'same "index"))])
(do-file path))

File diff suppressed because one or more lines are too long

View File

View File

@ -1,2 +1,3 @@
scribble --html ++style gh.css ++xref-in setup/xref load-collections-xref --redirect-main "http://docs.racket-lang.org/" main.rkt
scribble --htmls ++style gh.css ++xref-in setup/xref load-collections-xref --redirect-main "http://docs.racket-lang.org/" index.rkt
racket add-to-head.rkt
cp index/ ./