2023-01-04 12:24:36 -05:00
|
|
|
# Test the hugo command.
|
|
|
|
|
2023-05-18 07:29:33 -04: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 12:24:36 -05: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 07:29:33 -04:00
|
|
|
# Verify that it's minified.
|
|
|
|
grep '<body>Home' newpublic/index.html
|
2023-01-04 12:24:36 -05:00
|
|
|
|
|
|
|
hugo --quiet
|
|
|
|
! stdout .
|
|
|
|
|
|
|
|
-- 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 07:29:33 -04:00
|
|
|
<body>
|
2023-01-04 12:24:36 -05:00
|
|
|
Home: {{ .Permalink }}, Time: {{ now }}
|
2023-05-18 07:29:33 -04:00
|
|
|
</body>
|
2023-01-04 12:24:36 -05: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"
|
|
|
|
---
|