mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-24 12:41:06 +00:00
40d05f12a7
* Add `.Truncated` bool to each page; will be set true if the `.Summary` is truncated and it's worth showing a "more" link of some kind. * Add `Params` to the site config, defining `.Site.Params` accessible to each page; this lets the site maintainer associate arbitrary data with names, on a site-wide basis. * Provide a `First` function to templates: * Use-case: `{{range First 5 .Site.Recent}}` or anything else which is a simple iterable provided by hugolib * Tests by me for `.Truncated` and `First` Also @noahcampbell contributed towards this: * Add UnitTest for `.Site.Params`: > Digging into this test case a bit more, I'm realizing that we need > to create a param test case to ensure that for each type we render > (page, index, homepage, rss, etc.) that the proper fields are > represented. This will help us refactor without fear in the > future. Sample config.yaml: ```yaml title: "Test site" params: Subtitle: "More tests always good" AuthorName: "John Doe" SidebarRecentLimit: 5 ``` Signed-off-by: Noah Campbell <noahcampbell@gmail.com> |
||
---|---|---|
.. | ||
benchmark_test.go | ||
config.go | ||
index.go | ||
indexing_test.go | ||
metadata.go | ||
node.go | ||
page.go | ||
page_index_test.go | ||
page_permalink_test.go | ||
page_test.go | ||
page_time_integration_test.go | ||
path.go | ||
path_seperators_test.go | ||
planner.go | ||
redis.cn.md | ||
rss_test.go | ||
shortcode.go | ||
site.go | ||
site_show_plan_test.go | ||
site_test.go | ||
site_url_test.go | ||
siteinfo_test.go | ||
summary.go |