summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--middleware/markdown/generator.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/middleware/markdown/generator.go b/middleware/markdown/generator.go
index a02cb3b05..9db82bdcf 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
}