mirror of
https://github.com/gohugoio/hugo.git
synced 2026-03-02 18:23:29 +01:00
52 lines
1.1 KiB
Plaintext
52 lines
1.1 KiB
Plaintext
# Test the hugo server command.
|
|
|
|
# We run these tests in parallel so let Hugo decide which port to use.
|
|
hugo server --renderToMemory &
|
|
|
|
waitServer
|
|
|
|
# Assert home page.
|
|
httpget $HUGOTEST_BASEURL_0 'Title: Hugo Server Test' $HUGOTEST_BASEURL_0
|
|
httpget $HUGOTEST_BASEURL_1 'Title: Hugo Serveur Test' $HUGOTEST_BASEURL_1
|
|
|
|
# Assert static mount.
|
|
httpget ${HUGOTEST_BASEURL_0}mystatic/mytext.txt 'en_mytext'
|
|
httpget ${HUGOTEST_BASEURL_1}mystatic/mytext.txt 'fr_mytext'
|
|
|
|
stopServer
|
|
! stderr .
|
|
|
|
-- hugo.toml --
|
|
title = "Hugo Server Test"
|
|
baseURL = "https://example.org/"
|
|
disableKinds = ["taxonomy", "term", "sitemap"]
|
|
|
|
[[module.mounts]]
|
|
source = 'static/en'
|
|
target = 'static'
|
|
lang = 'en'
|
|
[[module.mounts]]
|
|
source = 'static/fr'
|
|
target = 'static'
|
|
lang = 'fr'
|
|
|
|
[languages]
|
|
[languages.en]
|
|
baseURL = "https://en.example.org/"
|
|
languageName = "English"
|
|
title = "Hugo Server Test"
|
|
weight = 1
|
|
[languages.fr]
|
|
baseURL = "https://fr.example.org/"
|
|
title = "Hugo Serveur Test"
|
|
languageName = "Français"
|
|
weight = 2
|
|
-- layouts/home.html --
|
|
Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
|
|
-- static/en/mystatic/mytext.txt --
|
|
en_mytext
|
|
-- static/fr/mystatic/mytext.txt --
|
|
fr_mytext
|
|
|
|
|