Skip to content

Commit ee6bc52

Browse files
author
fmoronzirfas
committed
feat(order of menu): added order property to pages of menu for sorting
close #33
1 parent 0bae077 commit ee6bc52

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

_includes/aside-left.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
include all default and the reference
1010
exclude the root path
1111
-->
12-
{% for item in site.pages %}{% if item.layout != 'entry' %}{%if item.layout == 'default' or item.layout == 'reference' %}{% if item.url != '/' %}
12+
{% assign pages = site.pages | sort: 'order' %}
13+
{% for item in pages %}{% if item.layout != 'entry' %}{%if item.layout == 'default' or item.layout == 'reference' %}{% if item.url != '/' %}
1314
<li class="menu-item {% if item.title == page.title %}active{% endif %}"><a href="{{item.url}}">{{item.title}}</a></li>
1415
{% endif %}{% endif %}{% endif %}{% endfor %}
1516

1617
</ul>
17-
<div class="tweet">
18-
</div>
19-
<div class="fhnw-logo">
20-
<a href="http://www.fhnw.ch/hgk/ivk"><img src="assets/images/fhnwlogo.png" alt="FHNW logo and link"></a>
21-
</div>
22-
</nav>
18+
</nav>
19+
<div class="tweet">
20+
</div>
21+
<div class="fhnw-logo">
22+
<a href="http://www.fhnw.ch/hgk/ivk"><img src="/assets/images/fhnwlogo.png" alt="FHNW logo and link"></a>
23+
</div>
2324
</aside>

about/index.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
author: admin
33
layout: default
44
originallink: http://basiljs.ch/about/
5-
title: About
5+
title: about
6+
order: 0
67
---
78

89
![](http://basiljs.ch/wp-content/uploads/2013/01/aboutpage.jpg)

download/index.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ comments: false
44
date: 2012-11-13 23:35:22+00:00
55
layout: default
66
originallink: http://basiljs.ch/download/
7-
title: Download
7+
title: download
8+
order: 1
89
---
910

1011
## Download basil.js

gallery/index.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
author: admin
33
layout: default
44
originallink: http://basiljs.ch/gallery/
5-
title: Gallery
5+
title: gallery
6+
order: 6
67
---
78

89
{% for page in site.pages %}

reference/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
author: admin
33
layout: reference
4-
title: Reference
4+
title: reference
5+
order: 3
56
---
67

78
<div class="index">
@@ -45,5 +46,5 @@ <h3 id="{{id}}">{{item.cat}}</h3>
4546
<div class="totop-shadow"><a href="#">☝︎ back to index</a>
4647
</div>
4748
<script type="text/javascript">
48-
var searchindex = {{site.data.categories | jsonify}};
49+
var searchindex = {{ site.data.categories | jsonify }};
4950
</script>

support/index.markdown

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
author: admin
33
layout: default
44
originallink: http://basiljs.ch/support/
5-
title: Support
5+
title: support
6+
order: 5
67
---
78

89
## Check the reference and provided material

tutorials/index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
author: admin
33
layout: default
44
originallink: http://basiljs.ch/tutorials/
5-
title: Tutorials
5+
title: tutorials
6+
order: 4
67
---
78

89
<ul>
9-
{% for page in site.pages %}
10+
{% assign tutos = site.pages | sort : 'url' %}
11+
{% for page in tutos %}
1012
{% if page.layout == 'tutorial' %}
1113
{% if page.title != 'example tutorial page'%}
1214
<li><a href="{{page.url}}">{{page.title}}</a></li>

0 commit comments

Comments
 (0)