shithub: hugo

Download patch

ref: a19563910eec5fed08f3b02563b9a7b38026183d
parent: 0432c64dd22e4610302162678bb93661ba68d758
author: Bjørn Erik Pedersen <[email protected]>
date: Wed Jan 24 04:08:26 EST 2018

Add a GetPage to the site benchmarks

--- a/hugolib/site_benchmark_test.go
+++ b/hugolib/site_benchmark_test.go
@@ -275,8 +275,8 @@
 		// Maybe consider reusing the Source fs
 		mf := afero.NewMemMapFs()
 		th, h := newTestSitesFromConfig(b, mf, siteConfig,
-			"layouts/_default/single.html", `Single HTML|{{ .Title }}|{{ .Content }}|{{ partial "myPartial" . }} `,
-			"layouts/_default/list.html", `List HTML|{{ .Title }}|{{ .Content }}`,
+			"layouts/_default/single.html", `Single HTML|{{ .Title }}|{{ .Content }}|{{ partial "myPartial" . }}`,
+			"layouts/_default/list.html", `List HTML|{{ .Title }}|{{ .Content }}|GetPage: {{ with .Site.GetPage "page" "sect3/page3.md" }}{{ .Title }}{{ end }}`,
 			"layouts/partials/myPartial.html", `Partial: {{ "Hello **world**!" | markdownify }}`,
 			"layouts/shortcodes/myShortcode.html", `<p>MyShortcode</p>`)