Permalink
Browse files

fix the theme for nico 0.3

  • Loading branch information...
1 parent d04d96c commit 7eccf22b801ced359af1020e8d3d2b0729fdced8 Hsiaoming Yang committed Mar 17, 2013
Showing with 10 additions and 7 deletions.
  1. +2 −1 _theme/static/one.css
  2. +2 −2 _theme/templates/post.html
  3. +6 −4 _theme/theme.js
View
3 _theme/static/one.css
@@ -61,7 +61,8 @@ li {
li ul, li ol {
margin-top: 0;
margin-bottom: 0;
- margin-left: 1em;
+ margin-left: 0;
+ padding-left: 2em;
}
li ul {
list-style: disc;
View
4 _theme/templates/post.html
@@ -5,8 +5,8 @@
<div class="sidebar">
<h2 class="sidebar-title">Documentation</h2>
<ul>
- {%- for item in resource.publicPosts|directory(post.directory) %}
- <li{%if item.id == post.id%} class="active"{%endif%}><a href="{{permalink_url(item)}}">{{item.title}}</a></li>
+ {%- for item in resource.posts|directory(post.directory) %}
+ <li{%if item.id == post.id%} class="active"{%endif%}><a href="./{{item.meta.filename}}">{{item.title}}</a></li>
{%- endfor %}
</ul>
</div>
View
10 _theme/theme.js
@@ -7,13 +7,15 @@ exports.filters = {
},
directory: function(posts, dir) {
- posts = posts.filter(function(item) {
- return item.directory === dir;
- });
- return posts.sort(function(a, b) {
+ var ret = Object.keys(posts).map(function(key) {
+ return posts[key];
+ }).filter(function(item) {
+ return item.meta.directory === dir;
+ }).sort(function(a, b) {
var aIndex = parseInt(a.meta.index || 100, 10);
var bIndex = parseInt(b.meta.index || 100, 10);
return aIndex - bIndex;
});
+ return ret;
}
};

0 comments on commit 7eccf22

Please sign in to comment.