Commit 09341fca authored by Matthew Holt's avatar Matthew Holt

markdown: Don't generate static site or links unless sitegen is enabled

parent b6078ede
......@@ -17,18 +17,18 @@ import (
// It only generates static files if it is enabled (cfg.StaticDir
// must be set).
func GenerateStatic(md Markdown, cfg *Config) error {
generated, err := generateLinks(md, cfg)
if err != nil {
return err
}
// No new file changes, return.
if !generated {
return nil
}
// If static site generation is enabled.
if cfg.StaticDir != "" {
generated, err := generateLinks(md, cfg)
if err != nil {
return err
}
// No new file changes, return.
if !generated {
return nil
}
if err := generateStaticHTML(md, cfg); err != nil {
return err
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment