ref: e2dc432fe287a280aeba94bafdcce85b7a8646c6
parent: 950295516da882dcc51d83f70835dde230a0b4d6
author: Bjørn Erik Pedersen <[email protected]>
date: Fri Apr 5 04:44:14 EDT 2019
hugolib: Fix benchmark for YAML front matter
--- a/hugolib/site_benchmark_test.go
+++ b/hugolib/site_benchmark_test.go
@@ -195,8 +195,7 @@
pageTemplateYAML := `---
title: "%s"
-tags:
-%s
+tags: %s
---
%s
@@ -255,8 +254,6 @@
tags[i] = fmt.Sprintf("Hugo %d", i+1)
}
- var tagsStr string
-
if cfg.Shortcodes {
contentPagesContent = [3]string{
someMarkdown,
@@ -302,6 +299,8 @@
tagsSlice = tags[tagsStart : tagsStart+cfg.TagsPerPage]
}
+ var tagsStr string
+
if cfg.Frontmatter == "TOML" {
pageTemplate = pageTemplateTOML
tagsStr = "[]"
@@ -321,9 +320,11 @@
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)
}