加上侧边栏的友情链接

This commit is contained in:
alsotang 2014-08-06 11:29:52 +08:00
parent 48ee0a3e90
commit a3da97bfc9
3 changed files with 27 additions and 11 deletions

View File

@ -57,21 +57,17 @@ var config = {
// site links
site_links: [
{
'text': 'Node',
'url': 'http://nodejs.org/'
'text': 'Node.js 官网',
'url': 'http://nodejs.org/',
},
{
'text': 'Node Party',
'url': 'http://party.cnodejs.net/'
text: 'Ruby-China',
url: 'https://ruby-china.org/',
},
{
'text': 'Node 入门',
'url': 'http://nodebeginner.org/index-zh-cn.html'
text: 'Golang中国',
url: 'http://golangtc.com/',
},
{
'text': 'Node 中文文档',
'url': 'http://docs.cnodejs.net/cman/'
}
],
// sidebar ads

View File

@ -41,7 +41,8 @@ exports.index = function (req, res, next) {
list_topic_count: limit,
tops: tops,
no_reply_topics: no_reply_topics,
pages: pages
pages: pages,
site_links: config.site_links,
});
});
proxy.fail(next);

View File

@ -69,4 +69,23 @@
</div>
<% } %>
<% if (typeof(site_links) !== 'undefined') { %>
<div class='panel'>
<div class='header'>
<span class='col_fade'>友情链接</span>
</div>
<div class='inner'>
<% if (site_links.length > 0) { %>
<ol>
<%site_links.forEach(function (link) {%>
<li><a href="<%-link.url%>"><%-link.text%></li>
<%})%>
</ol>
<% } else { %>
<p></p>
<% } %>
</div>
</div>
<% } %>
</div>