0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

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

This commit is contained in:
Matthew Holt 2015-11-02 20:15:32 -07:00
parent b6078eded1
commit 09341fca12

View file

@ -17,18 +17,18 @@ import (
// It only generates static files if it is enabled (cfg.StaticDir // It only generates static files if it is enabled (cfg.StaticDir
// must be set). // must be set).
func GenerateStatic(md Markdown, cfg *Config) error { 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 static site generation is enabled.
if cfg.StaticDir != "" { 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 { if err := generateStaticHTML(md, cfg); err != nil {
return err return err
} }