diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2020-02-01 18:30:23 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2020-02-01 18:30:34 +0100 |
commit | 633a882544d3b54cc7b7cfc96359a2ca1497d766 (patch) | |
tree | e0d677381b1647104a231103f12776d61c2a871e /main.go | |
parent | ace49dc8ef6eb5236eed364f885ff6ed76554188 (diff) |
Added CSS copy, img symlink generation
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -2,7 +2,9 @@ package main import ( "fmt" + "github.com/otiai10/copy" "os" + "path/filepath" ) func main() { @@ -13,10 +15,10 @@ func main() { } // read config file specified in the command line - cfg, err := readConfig(os.Args[1]) - if err != nil { - panic(err) - } + cfg := readConfig(os.Args[1]) + + // create temporary target directory + tmp := createTempDir("godocs") // gather all sites in docsRoot sites := getSites(cfg) @@ -32,6 +34,12 @@ func main() { createNavSlice(&site, cfg) // output the site - generateSite(site, cfg) + generateSite(site, cfg, tmp) + } + + // copy CSS file to generation directory + err := copy.Copy(cfg.CssFile, filepath.Join(tmp, "style.css")) + if err != nil { + panic(err) } } |