File tree Expand file tree Collapse file tree 3 files changed +86
-4
lines changed Expand file tree Collapse file tree 3 files changed +86
-4
lines changed Original file line number Diff line number Diff line change 1+ hugo --quiet
2+ ls public/files
3+ stdout 'f1.txt'
4+ stdout 'f2.txt'
5+
6+ grep 'enf1' public/files/f1.txt # en mount is last.
7+ grep 'frf2' public/files/f2.txt
8+
9+ -- hugo.toml --
10+ disableKinds = ["taxonomy", "term"]
11+ defaultContentLanguage = "en"
12+ defaultContentLanguageInSubdir = true
13+
14+ [languages]
15+ [languages.en]
16+ languageName = "English"
17+ weight = 1
18+ [languages.fr]
19+ languageName = "Français"
20+ weight = 2
21+ [module]
22+ [[module.mounts]]
23+ source = "static/fr"
24+ target = "static"
25+ lang = "fr"
26+ [[module.mounts]]
27+ source = "static/en"
28+ target = "static"
29+ lang = "en"
30+
31+ -- static/en/files/f1.txt --
32+ enf1
33+ -- static/fr/files/f1.txt --
34+ frf1
35+ -- static/fr/files/f2.txt --
36+ frf2
37+ -- layouts/home.html --
38+ Home.
39+
Original file line number Diff line number Diff line change @@ -5,16 +5,31 @@ hugo server --renderToMemory &
55
66waitServer
77
8+ # Assert home page.
89httpget $HUGOTEST_BASEURL_0 'Title: Hugo Server Test' $HUGOTEST_BASEURL_0
910httpget $HUGOTEST_BASEURL_1 'Title: Hugo Serveur Test' $HUGOTEST_BASEURL_1
1011
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+
1116stopServer
1217! stderr .
1318
1419-- hugo.toml --
1520title = "Hugo Server Test"
1621baseURL = "https://example.org/"
1722disableKinds = ["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+
1833[languages]
1934[languages.en]
2035baseURL = "https://en.example.org/"
@@ -28,5 +43,9 @@ languageName = "Français"
2843weight = 2
2944-- layouts/index.html --
3045Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
46+ -- static/en/mystatic/mytext.txt --
47+ en_mytext
48+ -- static/fr/mystatic/mytext.txt --
49+ fr_mytext
3150
3251
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ hugo server --renderToMemory --renderStaticToDisk &
55
66waitServer
77
8- httpget $HUGOTEST_BASEURL_0 'Title: Hugo Server Test' $HUGOTEST_BASEURL_0
9- httpget ${HUGOTEST_BASEURL_0}mystatic.txt 'This is a static file.'
8+ httpget ${ HUGOTEST_BASEURL_0}en/ 'Title: Hugo Server Test' $HUGOTEST_BASEURL_0
9+ httpget ${HUGOTEST_BASEURL_0}mystatic.txt 'This is a static file in English .'
1010
1111! exists public/index.html
1212exists public/mystatic.txt
@@ -18,8 +18,32 @@ stopServer
1818title = "Hugo Server Test"
1919baseURL = "https://example.org/"
2020disableKinds = ["taxonomy", "term", "sitemap"]
21- -- static/mystatic.txt --
22- This is a static file.
21+ defaultContentLanguage = "en"
22+ defaultContentLanguageInSubdir = true
23+ [[module.mounts]]
24+ source = 'static/en'
25+ target = 'static'
26+ lang = 'en'
27+ [[module.mounts]]
28+ source = 'static/fr'
29+ target = 'static'
30+ lang = 'fr'
31+
32+
33+ [languages]
34+ [languages.en]
35+ languageName = "English"
36+ title = "Hugo Server Test"
37+ weight = 1
38+ [languages.fr]
39+ title = "Hugo Serveur Test"
40+ languageName = "Français"
41+ weight = 2
42+
43+ -- static/en/mystatic.txt --
44+ This is a static file in English.
45+ -- static/en/mystatic.txt --
46+ This is a static file in English.
2347-- layouts/index.html --
2448Title: {{ .Title }}|BaseURL: {{ site.BaseURL }}|
2549
You can’t perform that action at this time.
0 commit comments