$ npm install handlebars-helper-feed
Handlebars helper for generating entries for RSS or atom feeds.
If you find a bug or have a feature request, please create an issue.
Use npm to install the package:
npm i handlebars-helper-feed --save-dev
Use bower to install the package:
bower install handlebars-helper-feed --save-dev
With the helper registered, you may now begin using it in your templates:
<entry>
<title></title>
<link href="//"/>
<updated></updated>
<id>/</id>
<content type="html"></content>
</entry>
This example also makes use of handlebars-helper-datetime (npm i handlebars-helper-datetime --save):
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<link type="application/atom+xml" href="http://asemble.io/feed/" rel="self"/>
<link href="{{site.homepage}}/atom.xml" rel="self"/>
<link href="{{site.homepage}}/"/>
<title>{{site.title}}</title>
<updated>{{datetime}}</updated>
<id>{{site.homepage}}</id>
<author>
<name>{{pkg.author.name}}</name>
<email>{{pkg.author.email}}</email>
</author>
<rights>Copyright (c) 2012-{{now '%Y'}}, {{pkg.author.name}}. All rights reserved.</rights>
<!-- feed entries -->
{{#feed src="pages/*.hbs"}}
<entry>
<title>{{@title}}</title>
<link href="{{site.homepage}}/{{@slug}}/"/>
<updated>{{@date}}</updated>
<id>{{site.homepage}}/{{@slug}}</id>
<content type="html"></content>
</entry>
{{/feed}}
</feed>
The easiest way to register the helper with Assemble is to add the module to both devDependencies and keywords in your project's package.json:
{
"devDependencies": {
"handlebars-helper-feed": "*"
},
"keywords": [
"handlebars-helper-feed"
]
}
Alternatively, to register the helper explicitly in the Gruntfile:
grunt.initConfig({
assemble: {
options: {
// the 'handlebars-helper-feed' npm module must also be listed in
// devDependencies for assemble to automatically resolve the helper
helpers: ['handlebars-helper-feed', 'foo/*.js']
},
files: {
'dist/': ['src/templates/*.hbs']
}
}
});
Besides the handlebars-helpers library, which includes more than 120 helpers, Here are some related projects you might be interested in from the Assemble core team.
<br> tags to generated HTML. Great for prototyping.<style>...</style> tags of the rendered HTML, but you may alternatively define a destination path using the dest hash option of the helper.Visit assemble.io/plugins for more information about Assemble plugins.
(List of related projects was generated by grunt-repos and grunt-readme).
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt, and build the documentation with grunt-readme.
Jon Schlinkert
Brian Woodward
Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license
This file was generated by grunt-readme on Wednesday, February 5, 2014.