2023-01-04 17:24:36 +00:00
|
|
|
# Test the hugo command.
|
|
|
|
|
2023-05-18 11:29:33 +00:00
|
|
|
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
|
2023-01-04 17:24:36 +00:00
|
|
|
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
|
2023-05-18 11:29:33 +00:00
|
|
|
# Verify that it's minified.
|
|
|
|
grep '<body>Home' newpublic/index.html
|
2023-01-04 17:24:36 +00:00
|
|
|
|
|
|
|
hugo --quiet
|
|
|
|
! stdout .
|
|
|
|
|
2023-05-27 14:07:56 +00:00
|
|
|
-- hugo.toml --
|
|
|
|
title = "Hugo Test"
|
2023-01-04 17:24:36 +00:00
|
|
|
-- myconfig.toml --
|
|
|
|
baseURL = "http://example.org/"
|
|
|
|
disableKinds = ["RSS", "sitemap", "robotsTXT", "404", "taxonomy", "term"]
|
|
|
|
[params]
|
|
|
|
foo = "bar"
|
|
|
|
-- myconfigdir/_default/params.toml --
|
|
|
|
bar = "baz"
|
|
|
|
-- mysource/layouts/index.html --
|
2023-05-18 11:29:33 +00:00
|
|
|
<body>
|
2023-01-04 17:24:36 +00:00
|
|
|
Home: {{ .Permalink }}, Time: {{ now }}
|
2023-05-18 11:29:33 +00:00
|
|
|
</body>
|
2023-01-04 17:24:36 +00:00
|
|
|
Environment: {{ hugo.Environment }}, foo: {{ .Site.Params.foo }}, bar: {{ .Site.Params.bar }}
|
|
|
|
-- mysource/layouts/_default/single.html --
|
|
|
|
Title: {{ .Title }}
|
|
|
|
-- mysource/content/p1.md --
|
|
|
|
---
|
|
|
|
title: "P1"
|
|
|
|
---
|