samhuri.net/templates/blog/post.html
2010-12-15 07:38:56 -08:00

86 lines
2.6 KiB
HTML

<!doctype html>
<meta charset=utf-8>
<meta name=viewport content=width=device-width>
<title>{{title}} :: samhuri.net</title>
<link rel=stylesheet href=../assets/blog.css>
<script>
var _gaq = _gaq || [];
_gaq.push( ['_setAccount', 'UA-214054-5']
, ['_trackPageview']
);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
{{#comments}}
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', ready, false)
} else if (window.attachEvent) {
window.attachEvent('onload', ready)
}
function ready() {
function html(id, h) {
document.getElementById(id).innerHTML = h
}
var discussion = document.getElementById('discussion')
, discussionToggle = document.getElementById('discussion-toggle')
, hidden = true
discussionToggle.onclick = function() {
hidden = !hidden
discussion.style.display = hidden ? 'none' : 'block'
discussionToggle.innerHTML = hidden ? '&darr; show discussion &darr;' : '&uarr; hide discussion &uarr;'
SJS.request({uri: 'http://bohodev.net:8000/comments/{{filename}}'}, function(err, body) {
html('comments', body)
})
}
}
{{/comments}}
</script>
<header>
<h1><a href=index.html>sjs' blog</a></h1>
</header>
<nav id=breadcrumbs><a href=../>samhuri.net</a> &rarr; <a href=index.html>blog</a></nav>
<div id=posts>
{{! TODO extract a post partial used here and in index.html }}
<article>
{{#post}}
<header>
<h1><a href={{filename}}>{{title}}</a></h1>
<time>{{date}}</time>
</header>
{{{body}}}
{{/post}}
</article>
</div>
<div id=around>
{{#previous}}
<a id=prev href={{filename}}>&larr; {{title}}</a>
{{/previous}}
{{#next}}
<a id=next href={{filename}}>{{title}} &rarr;</a>
{{/next}}
<br style=clear:both>
</div>
<div class=center><a id=discussion-toggle href=#>&darr; show discussion &darr;</a></div>
{{#comments}}
<div id=discussion>
<div id=comment-form>
<form method=post action=http://bohodev.net:8000/comment>
<input name=from type=hidden value={{#post}}{{filename}}{{/post}}>
<p>Name: <input name=name size=30></p>
<p>URL: <input name=url size=30></p>
<p>Thoughts: <textarea name=body cols=40 rows=5></textarea></p>
<p><input type=submit value=Add to discussion></p>
</form>
</div>
<div id=comments>
<img id=discussion-spinner src=../assets/spinner.gif>
</div>
</div>
{{/comments}}
<footer>
<a href=https://twitter.com/_sjs>@_sjs</a>
</footer>