summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_rebuild_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-07-03 18:02:32 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-07-03 23:31:51 +0200
commit42e150fbfac736bd49bc7e50cb8cdf9f81386f59 (patch)
treef29afdf089823d6c6d4513ae67934357b88f2a05 /hugolib/hugo_sites_rebuild_test.go
parent028b356787426dbc190ce9868fbc9a6400c2996e (diff)
Fix server reload when non-HTML shortcode changes
Fixes #7448
Diffstat (limited to 'hugolib/hugo_sites_rebuild_test.go')
-rw-r--r--hugolib/hugo_sites_rebuild_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/hugolib/hugo_sites_rebuild_test.go b/hugolib/hugo_sites_rebuild_test.go
index 1f0b1b5d9..f0c9f8f09 100644
--- a/hugolib/hugo_sites_rebuild_test.go
+++ b/hugolib/hugo_sites_rebuild_test.go
@@ -26,6 +26,7 @@ baseURL = "https://example.com"
title = "Rebuild this"
contentDir = "content"
enableInlineShortcodes = true
+timeout = "5s"
`
@@ -217,4 +218,44 @@ Render /prender/: Baseof:Single Main: Page 1|Mypartial1: Mypartial1|Mypartial3:
})
+ t.Run("Edit RSS shortcode", func(t *testing.T) {
+ b := createSiteBuilder(t)
+
+ b.WithContent("output.md", `---
+title: Output
+outputs: ["HTML", "AMP"]
+layout: output
+---
+
+Content for Output.
+
+{{< output >}}
+
+`)
+
+ b.WithTemplates(
+ "layouts/_default/output.html", `Output HTML: {{ .RelPermalink }}|{{ .Content }}`,
+ "layouts/_default/output.amp.html", `Output AMP: {{ .RelPermalink }}|{{ .Content }}`,
+ "layouts/shortcodes/output.html", `Output Shortcode HTML`,
+ "layouts/shortcodes/output.amp.html", `Output Shortcode AMP`)
+
+ b.Build(BuildCfg{})
+
+ b.AssertFileContent("public/output/index.html", `
+Output Shortcode HTML
+`)
+ b.AssertFileContent("public/amp/output/index.html", `
+Output Shortcode AMP
+`)
+
+ b.EditFiles("layouts/shortcodes/output.amp.html", `Output Shortcode AMP Edited`)
+
+ b.Build(BuildCfg{})
+
+ b.AssertFileContent("public/amp/output/index.html", `
+Output Shortcode AMP Edited
+`)
+
+ })
+
}