Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jade template for tag page
- var tagsForPosts = function() {
- var data = public.posts.data;
- var tags = {};
- for (var name in data) {
- if (name[0] != '_') {
- var ts = data[name].tags;
- for (var i in ts) {
- tag = ts[i];
- tags[tag] = tags[tag] || []
- tags[tag].push (name);
- }
- }
- }
- return tags;
- }
h1 Posts tagged with 
span#tagName
each posts, tag in tagsForPosts()
ul.posts(id=tag, style="display: none")
each name in posts
li
- var teaser = teaserForPost(name);
+postTeaser(teaser)
script.
var tag = window.location.hash.substr (1);
document.getElementById ("tagName").innerText = tag;
document.getElementById (tag).style.display = "block";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.