summaryrefslogtreecommitdiffstats
path: root/testscripts/commands/server__edit_content.txt
blob: 5a2d9d502fc7ff3e5800242a524df5cfc0effbcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 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