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:
parent
b6078eded1
commit
09341fca12
1 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue