From 09341fca1276b248d946dde1528138271daa9c40 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Mon, 2 Nov 2015 20:15:32 -0700 Subject: [PATCH] markdown: Don't generate static site or links unless sitegen is enabled --- middleware/markdown/generator.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/middleware/markdown/generator.go b/middleware/markdown/generator.go index a02cb3b0..9db82bdc 100644 --- a/middleware/markdown/generator.go +++ b/middleware/markdown/generator.go @@ -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 }