Hey
I have now spend the last couple of days building my website in docpad. It is everything I could ever wish for. I am so happy. I only have one problem:
I have implemented feedr with a twitter rss feed. This is working great, but as far as I understand it will not update automatically since the pages are static? My ideal scenario is to have the docpad autogenerate the frontpage page once every 10 minutes. I have been trying to look for different ways to solve this without luck. Alternatively I can make the page dynamic (which means, as far as I understand, that it will be generated at every request). This is overkill, but good enough. Except I get an error when I try to use @feedr.feeds or @documents. I am writing here because I am not sure it is a bug or me doing something wrong?
As a side comment: would it be possible to make a dynamic: [insert minutes here]. Then if the requested page is older than the minutes it will be regenerated. This would enable it to be dynamic and still handle loads of requests.
Here are the details:
Code (index.html.eco - bootstrap skeleton):
<h1 style="margin-bottom:10px;">Twitter: What people say about the projects I am involved in</h1>
<div class="row" style="text-align:left;">
<% for m in @feedr.feeds.twit23.entry: %>
<div class="span2" style="height:200px;">
<a style="font-weight:bold;" target="_blank" href="<%=m.link[0]['@'].href%>" title="View on Twitter">
<%-m.author['name']%>
</a><br/>
<%-m.content['#']%>
</div>
<% end %>
</div>
Error:
In browser: Cannot read property 'feeds' of undefined
Terminal:
warning: Something went wrong while rendering: index.html.eco
error: An error occured: Cannot read property 'feeds' of undefined TypeError: Cannot read property 'feeds' of undefined
at Object.<anonymous> (eval at <anonymous> (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-eco/node_modules/eco/lib/compiler.js:19:12))
at Object.<anonymous> (eval at <anonymous> (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-eco/node_modules/eco/lib/compiler.js:19:12))
at eval at <anonymous> (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-eco/node_modules/eco/lib/compiler.js:19:12)
at Function.render (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-eco/node_modules/eco/lib/index.js:26:24)
at EcoPlugin.render (/Users/madshobye/Dropbox/nodeLive/hobyedk_docpad5/node_modules/docpad-plugin-eco/eco.plugin.coffee:24:30)
at /usr/local/lib/node_modules/docpad/lib/plugin.js:43:34
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/events.js:274:18
at _Class.nextTask (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.js:117:11)
at _Class.complete (/usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.js:154:20)
at /usr/local/lib/node_modules/docpad/node_modules/bal-util/lib/flow.js:166:33
Hope somebody could answer this.
m