hugo/hugolib
Phil Pennock 40d05f12a7 Truncated; .Site.Params; First function
* 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>
2013-11-12 22:49:54 +00:00
..
benchmark_test.go Remove page module dependence on opening files 2013-09-04 19:36:06 -07:00
config.go Truncated; .Site.Params; First function 2013-11-12 22:49:54 +00:00
index.go More work on indexes 2013-10-31 09:49:29 -04:00
indexing_test.go Formatting cleanup 2013-08-17 23:52:16 -04:00
metadata.go Adding support for date field in front matter as date (as TOML provides) 2013-10-24 15:18:57 -07:00
node.go simplified buildSite & better error handling around it 2013-10-09 19:14:26 -04:00
page.go Truncated; .Site.Params; First function 2013-11-12 22:49:54 +00:00
page_index_test.go Big index overhaul. Now supporting ordering tokens by count or alphabetically. Also made full indexes available to the Site variable. 2013-10-25 18:40:55 -04:00
page_permalink_test.go Permalink to include multiple directories levels 2013-10-08 18:44:15 +02:00
page_test.go Truncated; .Site.Params; First function 2013-11-12 22:49:54 +00:00
page_time_integration_test.go Adding support for date field in front matter as date (as TOML provides) 2013-10-24 15:18:57 -07:00
path.go Code reorg, helpers.go has been decomposed. 2013-09-03 16:16:07 -07:00
path_seperators_test.go Refactor layout selection code 2013-10-08 18:44:15 +02:00
planner.go Refactor layout selection code 2013-10-08 18:44:15 +02:00
redis.cn.md Adding benchmark for parsing pages using unicode. 2013-08-09 17:36:32 -07:00
rss_test.go Adding RSS test case. 2013-11-05 07:03:02 +00:00
shortcode.go Code reorg, helpers.go has been decomposed. 2013-09-03 16:16:07 -07:00
site.go Truncated; .Site.Params; First function 2013-11-12 22:49:54 +00:00
site_show_plan_test.go Section is determined by the source, not the url 2013-09-20 17:03:43 -07:00
site_test.go Remove the hugo-nav function 2013-11-05 22:28:06 +00:00
site_url_test.go Remove the hugo-nav function 2013-11-05 22:28:06 +00:00
siteinfo_test.go Truncated; .Site.Params; First function 2013-11-12 22:49:54 +00:00
summary.go Code reorg, helpers.go has been decomposed. 2013-09-03 16:16:07 -07:00