summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-05 08:44:14 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-05 08:52:58 +0200
commite2dc432fe287a280aeba94bafdcce85b7a8646c6 (patch)
treee71083131f60940840e9906cab7c671977dd93b4 /hugolib
parent950295516da882dcc51d83f70835dde230a0b4d6 (diff)
hugolib: Fix benchmark for YAML front matter
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/site_benchmark_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/hugolib/site_benchmark_test.go b/hugolib/site_benchmark_test.go
index 7fb46235d..8c5e07a52 100644
--- a/hugolib/site_benchmark_test.go
+++ b/hugolib/site_benchmark_test.go
@@ -195,8 +195,7 @@ tags = %s
pageTemplateYAML := `---
title: "%s"
-tags:
-%s
+tags: %s
---
%s
@@ -255,8 +254,6 @@ weight = %d
tags[i] = fmt.Sprintf("Hugo %d", i+1)
}
- var tagsStr string
-
if cfg.Shortcodes {
contentPagesContent = [3]string{
someMarkdown,
@@ -302,6 +299,8 @@ weight = %d
tagsSlice = tags[tagsStart : tagsStart+cfg.TagsPerPage]
}
+ var tagsStr string
+
if cfg.Frontmatter == "TOML" {
pageTemplate = pageTemplateTOML
tagsStr = "[]"
@@ -321,9 +320,11 @@ weight = %d
contentFilename := fmt.Sprintf("page%d%s.md", j, fileLangCodeID)
writeSource(b, fs, filepath.Join("content", fmt.Sprintf("sect%d", i), contentFilename), content)
+
}
content := fmt.Sprintf(pageTemplate, fmt.Sprintf("Section %d", i), "[]", contentPagesContent[rand.Intn(3)])
+
indexContentFilename := fmt.Sprintf("_index%s.md", fileLangCodeID)
writeSource(b, fs, filepath.Join("content", fmt.Sprintf("sect%d", i), indexContentFilename), content)
}