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,6 +17,8 @@ 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 {
// If static site generation is enabled.
if cfg.StaticDir != "" {
generated, err := generateLinks(md, cfg) generated, err := generateLinks(md, cfg)
if err != nil { if err != nil {
return err return err
@ -27,8 +29,6 @@ func GenerateStatic(md Markdown, cfg *Config) error {
return nil return nil
} }
// If static site generation is enabled.
if cfg.StaticDir != "" {
if err := generateStaticHTML(md, cfg); err != nil { if err := generateStaticHTML(md, cfg); err != nil {
return err return err
} }