2007-12-31: Minor release with feature enhancements. More...
2007-09-08: Small bug fix release. More...
2007-06-29: Some bug fixes and one small feature enhancement. More...
Plugin name: | Tag/News (Tag/Default) |
---|---|
Author: | Jeremy Hinegardner |
Summary: | Process a news file and format it on a page. |
Parameters: | contentFormat: "textile" contentTag: nil dateFormat: "%Y-%m-%d" dateTag: "h2" filename (=default mandatory parameter): "news.yaml" options: {} |
Handled tags: | news |
This plugin creates a ‘news’ tag which can be used to display the contents of a news file.
The news file by default is ‘news.yaml’ and placed in the root of the webgen website directory. This can be changed with the ‘filename’ parameter.
The yaml file has the basic format of
date: content
date: content
Where the date has the format indicated by the ‘dateFormat’ parmater which by default is YYYY-MM-DD. The content is formated according to the ‘contentFormat’ parameter and is textile by default. I recommend using the ’|’ version of block text for the content. For example:
2007-03-20: | h2. this is an entry This is some content
When utilized in a template the ‘news’ tag can optionally take to additional parameters ‘maxEntries’ and ‘maxParagraphs’.
So the following usage of the news tag would disply the first paragraph of the most recent item in the news.yaml file.
{news: {options: {maxEntries: 1, maxParagraphs: 1}}}
While this usage would display all the contents of the news.yaml file sorted in reverse chronological order and displayed fully.
{news: }