| 1 |
# Test the hugo server command. |
| 2 |
|
| 3 |
# We run these tests in parallel so let Hugo decide which port to use. |
| 4 |
hugo server --renderToMemory & |
| 5 |
|
| 6 |
waitServer |
| 7 |
|
| 8 |
# Assert home page. |
| 9 |
httpget $HUGOTEST_BASEURL_0 'Title: Hugo Server Test' $HUGOTEST_BASEURL_0 |
| 10 |
httpget $HUGOTEST_BASEURL_1 'Title: Hugo Serveur Test' $HUGOTEST_BASEURL_1 |
| 11 |
|
| 12 |
# Assert static mount. |
| 13 |
httpget ${HUGOTEST_BASEURL_0}mystatic/mytext.txt 'en_mytext' |
| 14 |
httpget ${HUGOTEST_BASEURL_1}mystatic/mytext.txt 'fr_mytext' |
| 15 |
|
| 16 |
stopServer |
| 17 |
! stderr . |
| 18 |
|
| 19 |
-- hugo.toml -- |
| 20 |
title = "Hugo Server Test" |
| 21 |
baseURL = "https://example.org/" |
| 22 |
disableKinds = ["taxonomy", "term", "sitemap"] |
| 23 |
|
| 24 |
[[module.mounts]] |
| 25 |
source = 'static/en' |
| 26 |
target = 'static' |
| 27 |
lang = 'en' |
| 28 |
[[module.mounts]] |
| 29 |
source = 'static/fr' |
| 30 |
target = 'static' |
| 31 |
lang = 'fr' |
| 32 |
|
| 33 |
[languages] |
| 34 |
[languages.en] |
| 35 |
baseURL = "https://en.example.org/" |
| 36 |
languageName = "English" |
| 37 |
title = "Hugo Server Test" |
| 38 |
weight = 1 |
| 39 |
[languages.fr] |
| 40 |
baseURL = "https://fr.example.org/" |
| 41 |
title = "Hugo Serveur Test" |
| 42 |
languageName = "Français" |
| 43 |
weight = 2 |
| 44 |
-- layouts/home.html -- |
| 45 |
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}| |
| 46 |
-- static/en/mystatic/mytext.txt -- |
| 47 |
en_mytext |
| 48 |
-- static/fr/mystatic/mytext.txt -- |
| 49 |
fr_mytext |
| 50 |
|
| 51 |
|