summaryrefslogtreecommitdiffstats
path: root/hugolib/hugo_sites_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-08-07 14:03:03 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-06 18:32:17 +0300
commit2079a23dd89734cea39e523faf46e44201151279 (patch)
tree5b5163a12cf874863eea889685d65a3c5b56515c /hugolib/hugo_sites_test.go
parent596e0e98e4483d2a0a709412a338ceddb6538757 (diff)
Make it possible to configure Blackfroday per language
See #2309
Diffstat (limited to 'hugolib/hugo_sites_test.go')
-rw-r--r--hugolib/hugo_sites_test.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/hugolib/hugo_sites_test.go b/hugolib/hugo_sites_test.go
index 158b65124..9ccfed054 100644
--- a/hugolib/hugo_sites_test.go
+++ b/hugolib/hugo_sites_test.go
@@ -137,6 +137,12 @@ func TestMultiSitesBuild(t *testing.T) {
require.NotNil(t, frTags["frtag1"])
readDestination(t, "public/fr/plaques/frtag1/index.html")
readDestination(t, "public/en/tags/tag1/index.html")
+
+ // Check Blackfriday config
+ assert.True(t, strings.Contains(string(doc1fr.Content), "&laquo;"), string(doc1fr.Content))
+ assert.False(t, strings.Contains(string(doc1en.Content), "&laquo;"), string(doc1en.Content))
+ assert.True(t, strings.Contains(string(doc1en.Content), "&ldquo;"), string(doc1en.Content))
+
}
func TestMultiSitesRebuild(t *testing.T) {
@@ -326,7 +332,6 @@ title = "Norsk"
// Watching does not work with in-memory fs, so we trigger a reload manually
require.NoError(t, viper.ReadInConfig())
-
err = sites.Build(BuildCfg{CreateSitesFromConfig: true})
if err != nil {
@@ -370,7 +375,10 @@ paginate = 2
DefaultContentLanguage = "fr"
[permalinks]
- other = "/somewhere/else/:filename"
+other = "/somewhere/else/:filename"
+
+[blackfriday]
+angledQuotes = true
[Taxonomies]
tag = "tags"
@@ -379,6 +387,8 @@ tag = "tags"
[Languages.en]
weight = 10
title = "English"
+[Languages.en.blackfriday]
+angledQuotes = false
[Languages.fr]
weight = 20
@@ -441,7 +451,7 @@ tags:
publishdate: "2000-01-01"
---
# doc1
-*some content*
+*some "content"*
NOTE: slug should be used as URL
`)},
{filepath.FromSlash("sect/doc1.fr.md"), []byte(`---
@@ -452,7 +462,7 @@ plaques:
publishdate: "2000-01-04"
---
# doc1
-*quelque contenu*
+*quelque "contenu"*
NOTE: should be in the 'en' Page's 'Translations' field.
NOTE: date is after "doc3"
`)},