hugo/testscripts/commands/server__edit_content.txt
Bjørn Erik Pedersen 241b21b0fd Create a struct with all of Hugo's config options
Primary motivation is documentation, but it will also hopefully simplify the code.

Also,

* Lower case the default output format names; this is in line with the custom ones (map keys) and how
it's treated all the places. This avoids doing `stringds.EqualFold` everywhere.

Closes #10896
Closes #10620
2023-05-16 18:01:29 +02:00

56 lines
1.1 KiB
Plaintext

# Test the hugo server command when editing content.
# We run these tests in parallel so let Hugo decide which port to use.
# Render to disk so we can check the /public dir.
hugo server --renderToDisk &
waitServer
httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1' $HUGOTEST_BASEURL_0
ls public/p2
cp stdout lsp2_1.txt
ls public/staticfiles
stdout 'static\.txt'
cp stdout lsstaticfiles_1.txt
replace $WORK/content/p1/index.md 'P1' 'P1 New'
httpget ${HUGOTEST_BASEURL_0}p1/ 'Title: P1 New' $HUGOTEST_BASEURL_0
ls public/p2
cp stdout lsp2_2.txt
cmp lsp2_1.txt lsp2_2.txt
ls public/staticfiles
cp stdout lsstaticfiles_2.txt
cmp lsstaticfiles_1.txt lsstaticfiles_2.txt
stopServer
! stderr .
-- hugo.toml --
title = "Hugo Server Test"
baseURL = "https://example.org/"
disableKinds = ["taxonomy", "term", "sitemap"]
-- layouts/index.html --
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
-- layouts/_default/single.html --
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
-- content/_index.md --
---
title: Hugo Home
---
-- content/p1/index.md --
---
title: P1
---
-- content/p2/index.md --
---
title: P2
---
-- static/staticfiles/static.txt --
static