Flattr Extension
Flattr is way for content producers to be paid by content consumers.
Get paid for your work
A must-have for bloggers, developers, designers and other creators. Just add a button to your blog or website and wait for people to click. When they do, you get paid.
Support creators
Give to creators with just one click. We all wish there was an easy way to give to those who serve us with free content. Flattr is just that!
Install
To use the Flattr integration, you simply need add an extension to the
pipeline in your _ext/pipeline.rb file.
Awestruct::Extensions::Pipeline.new do
extension Awestruct::Extensions::Flattr.new
end
Configure
Your _config/site.yml needs to include the property flattr_username
with your account identifier.
| Property | Description |
|---|---|
| flattr_username | The Flattr username receiving flattrs |
Use the extension
The extension adds three methods to every page within the site.
page.flattr_javascript
This will emit the javascript necessary to provide Flattr button integration. This should be used once and only once per page hosting a Flattr button. Put it for example in the footer area.
.content
= page.content
.footer
= page.flattr_javascript
page.flattr_large_counter
This will emit a large Flattr button like this one.
This is okay to invoke it several times per page and ie put several Flattr buttons.
By default, the Flattr button will be associated with
- the page URL eg http://awestruct.org/extensions/flattr
- the page title as Flattr title
- the Flattr text category
You can override these however passing respectively the url, title and
category parameters. You can even associate a set of comma separated tags
via the tags property.
.sidebar
= page.flattr_large_counter
.content
.externalresource
.abstract
= page.flattr_large_counter((
:url=>"http://example.com/",
:title=>"Emmanuel Bernard",
:tags=>"goodstuff,photo,bacon")
page.flattr_compact_counter
This will emit a compact Flattr button. Otherwise, everything is like
page.flattr_large_counter.
Happy coding and don't forget to Flattr.