aboutsummaryrefslogtreecommitdiffhomepage
path: root/testscripts
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-05-18 13:29:33 +0200
committerBjørn Erik Pedersen <[email protected]>2023-05-18 15:38:25 +0200
commit3f00f47535d7b3eef829cda12296ba665dd50a4c (patch)
tree7967f7f68f3551cc1e58f739672cb74964097029 /testscripts
parent834b3d7e41d42a97df58804e3e6ed4d5ed596efc (diff)
downloadhugo-3f00f47535d7b3eef829cda12296ba665dd50a4c.tar.gz
hugo-3f00f47535d7b3eef829cda12296ba665dd50a4c.zip
commands: Load config before creating the filesystem
To allow publishDir to be set in config file.
Diffstat (limited to 'testscripts')
-rw-r--r--testscripts/commands/hugo__flags.txt6
-rw-r--r--testscripts/commands/hugo__publishdir_in_config.txt12
2 files changed, 17 insertions, 1 deletions
diff --git a/testscripts/commands/hugo__flags.txt b/testscripts/commands/hugo__flags.txt
index 46243f8a9..c2ea92c95 100644
--- a/testscripts/commands/hugo__flags.txt
+++ b/testscripts/commands/hugo__flags.txt
@@ -1,10 +1,12 @@
# Test the hugo command.
-hugo --baseURL http://example.com/ --destination ${WORK}/newpublic --clock 2021-11-06T22:30:00.00+09:00 -e staging --config ${WORK}/myconfig --configDir ${WORK}/myconfigdir -s mysource
+hugo --baseURL http://example.com/ --minify --destination ${WORK}/newpublic --clock 2021-11-06T22:30:00.00+09:00 -e staging --config ${WORK}/myconfig --configDir ${WORK}/myconfigdir -s mysource
stdout 'Pages.*|1'
stdout 'Total in'
grep 'Home: http://example.com/, Time: 2021-11-06' newpublic/index.html
grep 'Environment: staging, foo: bar, bar: baz' newpublic/index.html
+# Verify that it's minified.
+grep '<body>Home' newpublic/index.html
hugo --quiet
! stdout .
@@ -17,7 +19,9 @@ foo = "bar"
-- myconfigdir/_default/params.toml --
bar = "baz"
-- mysource/layouts/index.html --
+<body>
Home: {{ .Permalink }}, Time: {{ now }}
+</body>
Environment: {{ hugo.Environment }}, foo: {{ .Site.Params.foo }}, bar: {{ .Site.Params.bar }}
-- mysource/layouts/_default/single.html --
Title: {{ .Title }}
diff --git a/testscripts/commands/hugo__publishdir_in_config.txt b/testscripts/commands/hugo__publishdir_in_config.txt
new file mode 100644
index 000000000..e57d4ad2f
--- /dev/null
+++ b/testscripts/commands/hugo__publishdir_in_config.txt
@@ -0,0 +1,12 @@
+# Test the hugo command.
+
+hugo
+
+grep 'Home' newpublic/index.html
+
+-- hugo.toml --
+baseURL = "http://example.org/"
+disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
+publishDir = "newpublic"
+-- layouts/index.html --
+Home.