| 1 |
# Test the hugo server command when editing content. |
| 2 |
|
| 3 |
# We run these tests in parallel so let Hugo decide which port to use. |
| 4 |
# Render to disk so we can check the /public dir. |
| 5 |
hugo server & |
| 6 |
|
| 7 |
waitServer |
| 8 |
|
| 9 |
httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1' $HUGOTEST_BASEURL_0 |
| 10 |
|
| 11 |
ls public/p2 |
| 12 |
cp stdout lsp2_1.txt |
| 13 |
ls public/staticfiles |
| 14 |
stdout 'static\.txt' |
| 15 |
cp stdout lsstaticfiles_1.txt |
| 16 |
|
| 17 |
replace $WORK/content/p1/index.md 'P1' 'P1 New' |
| 18 |
|
| 19 |
httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1 New' $HUGOTEST_BASEURL_0 |
| 20 |
|
| 21 |
ls public/p2 |
| 22 |
cp stdout lsp2_2.txt |
| 23 |
cmp lsp2_1.txt lsp2_2.txt |
| 24 |
ls public/staticfiles |
| 25 |
cp stdout lsstaticfiles_2.txt |
| 26 |
cmp lsstaticfiles_1.txt lsstaticfiles_2.txt |
| 27 |
|
| 28 |
stopServer |
| 29 |
! stderr . |
| 30 |
|
| 31 |
-- hugo.toml -- |
| 32 |
title = "Hugo Server Test" |
| 33 |
baseURL = "https://example.org/" |
| 34 |
disableKinds = ["taxonomy", "term", "sitemap"] |
| 35 |
-- layouts/home.html -- |
| 36 |
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}| |
| 37 |
-- layouts/single.html -- |
| 38 |
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}| |
| 39 |
-- content/_index.md -- |
| 40 |
--- |
| 41 |
title: Hugo Home |
| 42 |
--- |
| 43 |
-- content/p1/index.md -- |
| 44 |
--- |
| 45 |
title: P1 |
| 46 |
--- |
| 47 |
-- content/p2/index.md -- |
| 48 |
--- |
| 49 |
title: P2 |
| 50 |
--- |
| 51 |
-- static/staticfiles/static.txt -- |
| 52 |
static |
| 53 |
|
| 54 |
|
| 55 |
|