git ssb


1+

jake / doge.haus



Commit b92fe929130f0e06be1cce8bb003f55c8a425681

add a link back home if on article page

jekrb committed on 2/21/2017, 5:13:59 PM
Parent: ec89f813353906998ae99c0d133b6585ef215b46

Files changed

index.jschanged
index.jsView
@@ -67,9 +67,9 @@
6767 var placeholder = html`<div></div>`
6868 placeholder.innerHTML = article
6969 var content = html`
7070 <main>
71- ${nav(state)}
71+ ${nav(state, prev, send, true)}
7272 <div>
7373 ${placeholder}
7474 </div>
7575 </main>
@@ -77,18 +77,24 @@
7777 return content
7878 }
7979 }
8080
81-function nav (state, prev, send) {
81+function nav (state, prev, send, slashHome) {
8282 var articles = state.articles
8383 if (articles) {
8484 var keys = Object.keys(articles)
85+ var slash = slashHome
86+ ? html`<li><a href='/'>./</a></li>`
87+ : ''
88+
8589 return html`
8690 <ul>
91+ ${slash}
8792 ${keys.map(function (key) {
8893 var article = articles[key]
8994 var title = article.data.title
90- var created = new Date(Date.parse(article.created))
95+ var timestamp = Date.parse(article.created)
96+ var created = new Date(timestamp)
9197 var date = strftime('%d %B %Y', created)
9298 return html`<li>
9399 <a href='/${key}'>
94100 <strong>${title}</strong>

Built with git-ssb-web