Created
September 28, 2011 20:08
-
-
Save danmactough/1249107 to your computer and use it in GitHub Desktop.
Jade Issue #354
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html | |
body | |
h1 My Site | |
p Welcome to my super lame site. | |
include template.jqtl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies. | |
*/ | |
var jade = require('jade') | |
, path = __dirname + '/includes.jade' | |
, str = require('fs').readFileSync(path, 'utf8') | |
, fn = jade.compile(str, { filename: path, pretty: true }); | |
console.log(fn()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script id="template" type="text/x-jquery-tmpl"> | |
<div class="info"> | |
<a id="display" href="#">Switch to compact view</a></li> | |
<p class="updated">Updated <time datetime="${dateFormat(metadata.whenGMT, 'isoUtcDateTime')}">${dateFormat(metadata.whenGMT, 'timeDate')}</time></p> | |
</div> | |
{{each(f,feed) updatedFeeds.updatedFeed}} | |
<div class="section"> | |
<div class="header"> | |
<h2> | |
{{if feed.websiteUrl}}<a href="${feed.websiteUrl}">{{/if}}<img class="icon" src="${getFavicon(feed.websiteUrl)}" alt="">{{if feed.websiteUrl}}</a>{{/if}} | |
{{if feed.websiteUrl}}<a href="${feed.websiteUrl}">{{/if}}${feed.feedTitle}{{if feed.websiteUrl}}</a>{{/if}} | |
(<a href="${feed.feedUrl}" title="Subscribe to ${feed.feedTitle}">Feed</a>) | |
</h2> | |
<span class="time">${dateFormat(feed.whenLastUpdate, 'timeDate')}</span> | |
</div> | |
{{each(i,item) feed.item}} | |
<div class="article"> | |
<div class="header"> | |
<h3><a href="{{if item.permaLink}}${item.permaLink}{{else}}${item.link}{{/if}}" rel="external">{{if item.title}}${item.title}{{else}}${item.body}{{/if}}</a></h3> | |
</div> | |
{{if item.title}} | |
{{if item.body}} | |
<div class="description"> | |
{{each(t,thumbnail) item.thumbnail}} | |
<img class="thumbnail" src="${thumbnail.url}" width="${thumbnail.width}" height="${thumbnail.height}" alt=""> | |
{{/each}} | |
${getText(item.body)} | |
</div> | |
{{/if}} | |
{{/if}} | |
<div class="footer"> | |
<span class="time">${timeDifference(item.pubDate)}</span> | |
<ul class="actions"> | |
{{if item.comments}} | |
<li><a href="${item.comments}" rel="external nofollow" target="_blank">Comment</a></li> | |
{{/if}} | |
{{each(e,enclosure) item.enclosure}} | |
<li class="enclosure ${getEnclosureType(enclosure.type)}"><a href="${enclosure.url}">Download enclosure (${enclosure.type}, ${getEnclosureSize(enclosure.length)})</a></li> | |
{{/each}} | |
</ul> | |
</div> | |
</div> | |
{{/each}} | |
</div> | |
{{/each}} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment