enable targeting another site dir
This commit is contained in:
parent
367cf27324
commit
2972869e0b
14
README.md
14
README.md
@ -1,7 +1,7 @@
|
||||
## Go by Example
|
||||
|
||||
Source for the [Go by Example](https://gobyexample.com)
|
||||
site.
|
||||
Content and toolchain source for the
|
||||
[Go by Example](https://gobyexample.com) site.
|
||||
|
||||
|
||||
### Overview
|
||||
@ -39,6 +39,16 @@ Generation requires the [`pygmentize`](http://pygments.org/)
|
||||
binary for syntax highlighting.
|
||||
|
||||
|
||||
### Serving
|
||||
|
||||
The site is served by the [gobyexample-server](https://github.com/mmcgrana/gobyexample-server)
|
||||
tool. To export to this tool:
|
||||
|
||||
```console
|
||||
$ SITEDIR = ../gobyexample-server/public tool/build
|
||||
```
|
||||
|
||||
|
||||
### License
|
||||
|
||||
This work is licensed under a [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/).
|
||||
|
@ -101,6 +101,13 @@ func whichLexer(path string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func whichSiteDir() {
|
||||
dir := os.Getenv("SITEDIR")
|
||||
if dir != "" {
|
||||
siteDir = dir
|
||||
}
|
||||
}
|
||||
|
||||
func debug(msg string) {
|
||||
if os.Getenv("DEBUG") == "1" {
|
||||
fmt.Fprintln(os.Stderr, msg)
|
||||
@ -228,6 +235,7 @@ func renderChapters(chapters []*Chapter) {
|
||||
}
|
||||
|
||||
func main() {
|
||||
whichSiteDir()
|
||||
ensureDir(siteDir)
|
||||
copyFile("template/site.css", siteDir+"/site.css")
|
||||
chapters := parseChapters()
|
||||
|
Loading…
x
Reference in New Issue
Block a user