Skip to content

Instantly share code, notes, and snippets.

@jonbullock
Created October 30, 2014 13:10
Show Gist options
  • Save jonbullock/5a380cf7f9a37a8cec48 to your computer and use it in GitHub Desktop.
Save jonbullock/5a380cf7f9a37a8cec48 to your computer and use it in GitHub Desktop.

Revisions

  1. jonbullock created this gist Oct 30, 2014.
    7 changes: 7 additions & 0 deletions asciidoc.adoc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    = Asciidoc Feed
    Jonathan Bullock
    2014-10-30
    :jbake-type: customfeed
    :jbake-status: published

    This file is created just to trigger the rendering of a file using the template file customfeed.ftl which wouldn't use any of the content in this file.
    29 changes: 29 additions & 0 deletions customfeed.ftl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    <?xml version="1.0"?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
    <title>JBake</title>
    <link>${config.site_host}</link>
    <atom:link href="${config.site_host}/${config.feed_file}" rel="self" type="application/rss+xml" />
    <description>JBake Bootstrap Template</description>
    <language>en-gb</language>
    <pubDate>${published_date?string("EEE, d MMM yyyy HH:mm:ss Z")}</pubDate>
    <lastBuildDate>${published_date?string("EEE, d MMM yyyy HH:mm:ss Z")}</lastBuildDate>

    <#list published_posts as post>
    <#if post.tags?seq_contains('asciidoc')>
    <item>
    <title><#escape x as x?xml>${post.title}</#escape></title>
    <link>${config.site_host}/${post.uri}</link>
    <pubDate>${post.date?string("EEE, d MMM yyyy HH:mm:ss Z")}</pubDate>
    <guid isPermaLink="false">${post.uri}</guid>
    <description>
    <#escape x as x?xml>
    ${post.body}
    </#escape>
    </description>
    </item>
    </#if>
    </#list>

    </channel>
    </rss>
    6 changes: 6 additions & 0 deletions jbake.properties
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    site.host=http://jbake.org
    render.tags=false
    render.sitemap=true
    template.customfeed.file=customfeed.ftl
    # this next line is what would allow a custom extension
    template.customfeed.extension=.xml