Skip to content

Commit

Permalink
optimize wiki index
Browse files Browse the repository at this point in the history
  • Loading branch information
mzlogin committed Nov 9, 2021
1 parent cb31e69 commit 9b33b95
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions _includes/copyright.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if page.copyright != false %}
<div style="margin-top:2em;padding:0 1.5em;border:1px solid #d3d3d3;background-color:#deebf7">
<h3>文档信息</h3>
<ul>
Expand All @@ -6,3 +7,4 @@ <h3>文档信息</h3>
<li>版权声明:自由转载-非商用-非衍生-保持署名(<a href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.zh" target="_blank">创意共享3.0许可证</a></li>
</ul>
</div>
{% endif %}
2 changes: 1 addition & 1 deletion _wiki/kindle.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: wiki
title: Kindle
cate1: Devices
cate2: EBooks
cate2:
description: 我爱 Kindle
keywords: Kindle
---
Expand Down
2 changes: 1 addition & 1 deletion assets/js/jquery.toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$.fn.toc = function(options) {
var defaults = {
noBackToTopLinks: false,
title: '文章目录',
title: '目录',
minimumHeaders: 2,
headers: 'h1, h2, h3, h4, h5, h6',
listType: 'ul', // values: [ol|ul]
Expand Down
7 changes: 4 additions & 3 deletions pages/wiki.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: page
layout: wiki
title: Wiki
description: 人越学越觉得自己无知
keywords: 维基, Wiki
comments: false
copyright: false
menu: 维基
permalink: /wiki/
---
Expand Down Expand Up @@ -31,13 +32,13 @@ permalink: /wiki/

{% assign item_grouped = site.wiki | where_exp: 'item', 'item.title != "Wiki Template"' | group_by: 'cate1' | sort: 'name' %}
{% for group in item_grouped %}
<strong>{{ group.name }}</strong>
###### {{ group.name }}
{% assign cate_items = group.items | sort: 'title' %}
{% assign item2_grouped = cate_items | group_by: 'cate2' | sort: 'name' %}
{% for sub_group in item2_grouped %}
{% assign name_len = sub_group.name | size %}
{% if name_len > 0 -%}
{{ sub_group.name }}:
<i>{{ sub_group.name }}: <sup>{{ sub_group.items | size }}</sup></i>
{%- endif -%}
{%- assign item_count = sub_group.items | size -%}
{%- assign item_index = 0 -%}
Expand Down

0 comments on commit 9b33b95

Please sign in to comment.