diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..566b73c
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,5 @@
+root = true
+
+[*.html]
+charset = utf-8
+indent_size = 2
diff --git a/.textlintignore b/.textlintignore
index 2baaf48..03d61cc 100644
--- a/.textlintignore
+++ b/.textlintignore
@@ -1 +1 @@
-_posts/2021-12-04-linux-package-list.md
+collections/_linux/package-list.md
diff --git a/_config.yml b/_config.yml
index 2149cf2..0006a6a 100644
--- a/_config.yml
+++ b/_config.yml
@@ -62,10 +62,6 @@ atom_feed:
og_image: "assets/images/og_image.jpg"
-stay_on_top_categories:
- - 初めての方へ
- - a
-
footer:
links:
- label: "Twitter"
@@ -82,7 +78,6 @@ defaults:
# _posts
- scope:
path: ""
- type: posts
values:
layout: single
author_profile: false
@@ -90,18 +85,49 @@ defaults:
show_date: false
toc: true
toc_sticky: true
- # _pages
- - scope:
- path: "_pages"
- type: pages
- values:
- layout: single
- author_profile: false
- show_date: false
-category_archive:
- type: liquid
- path: /categories/
tag_archive:
type: liquid
path: /tags/
+
+collections_dir: collections
+
+collections_order:
+ - beginners
+ - build
+ - u-boot
+ - linux
+ - tips
+ - meta
+
+collections:
+ beginners:
+ output: true
+ name: For Beginners
+ order:
+ - get-started.md
+ - roadmap.md
+ build:
+ output: true
+ name: Build
+ order:
+ - uboot.md
+ - linux.md
+ - copy-sd-card.md
+ u-boot:
+ output: true
+ name: U-Boot
+ order:
+ - boot-eboot.md
+ - boot-usb.md
+ linux:
+ output: true
+ name: Linux
+ order:
+ - package-list.md
+ tips:
+ output: true
+ name: Tips
+ meta:
+ output: true
+ name: Meta
diff --git a/_data/navigation.yml b/_data/navigation.yml
index 086b092..d1f95b0 100644
--- a/_data/navigation.yml
+++ b/_data/navigation.yml
@@ -1,7 +1,7 @@
main:
- title: "初めての方へ"
- url: /for%20beginners/beginner-get-started/
+ url: /beginners/get-started/
- title: "タグ一覧"
url: /tags/
- title: "この Wiki について"
- url: /about/
\ No newline at end of file
+ url: /about/
diff --git a/_layouts/categories.html b/_layouts/categories.html
index 4dd3b40..e7226ba 100644
--- a/_layouts/categories.html
+++ b/_layouts/categories.html
@@ -4,88 +4,52 @@ layout: archive
{{ content }}
-{% assign stay_on_top = site.stay_on_top_categories %}
-
-{% assign categories_max = 0 %}
-{% for category in site.categories %}
- {% if category[1].size > categories_max %}
- {% assign categories_max = category[1].size %}
- {% endif %}
-{% endfor %}
-
カテゴリ一覧
- {% comment %} Iterate the Stay-on-Top list and all categories and render matched categories {% endcomment %}
-
- {% for category in site.categories %}
- {% for stay in stay_on_top %}
-
- {% if category[0] == stay %}
- -
-
-
- {{ category[0] }}
-
-
- {% endif %}
- {% endfor %}
- {% endfor %}
-
- {% comment %} Iterate the Stay-on-Top list and all categories and render unmatched categories {% endcomment %}
-
- {% for category in site.categories %}
- {% assign skip = false %}
- {% for stay in stay_on_top %}
- {% if category[0] == stay %}
- {% assign skip = true %}
- {% endif %}
- {% endfor %}
- {% if skip %}
- {% continue %}
- {% endif %}
+ {% for label in site.collections_order %}
+ {% assign collection = site.collections | where: "label", label | first %}
-
-
- {{ category[0] }} {{ i }}
+
+ {{ collection.name }} {{ i }}
{% endfor %}
-{% assign entries_layout = page.entries_layout | default: 'list' %}
-{% for category in site.categories %}
- {% for stay in stay_on_top %}
- {% if category[0] == stay %}
-
- {% endif %}
- {% endfor %}
-{% endfor %}
+{% comment %} Make sure that all collections are listed in the _config.yml. {% endcomment %}
-{% for category in site.categories %}
- {% assign skip = false %}
- {% for stay in stay_on_top %}
- {% if category[0] == stay %}
- {% assign skip = true %}
- {% endif %}
- {% endfor %}
- {% if skip %}
- {% continue %}
- {% endif %}
-
- {{ category[0] }}
+{% assign entries_layout = page.entries_layout | default: 'list' %}
+{% for label in site.collections_order %}
+ {% assign collection = site.collections | where: "label", label | first %}
+
+ {{ collection.name }}
- {% for post in category.last %}
- {% include archive-single.html type=entries_layout %}
+ {% comment %} First, render ordered pages {% endcomment %}
+
+ {% assign ordered_post = "" | split: "" %}
+ {% if collection.order %}
+ {% for file in collection.order %}
+ {% assign docpath = "_" | append: collection.label | append: "/" | append: file %}
+ {% assign post = collection.docs | where: "path", docpath | first %}
+ {% if post %}
+ {% include archive-single.html type=entries_layout %}
+ {% assign ordered_post = ordered_post | push: docpath %}
+ {% else %}
+
{{docpath}} not found!
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+ {% comment %} Second, render pages not listed in the order array {% endcomment %}
+
+ {% for post in collection.docs %}
+ {% assign already_rendered = ordered_post | where_exp: "path", "path == post.path" | size %}
+ {% if already_rendered == 0 %}
+ {% include archive-single.html type=entries_layout %}
+ {% endif %}
{% endfor %}
{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} ↑
diff --git a/_layouts/tags.html b/_layouts/tags.html
new file mode 100644
index 0000000..a150506
--- /dev/null
+++ b/_layouts/tags.html
@@ -0,0 +1,76 @@
+---
+layout: archive
+---
+
+{{ content }}
+
+{% comment %} Flatten all documents in all categories {% endcomment %}
+
+{% assign docs = "" | split: "" %}
+{% for collection in site.collections %}
+ {% assign docs = docs | concat: collection.docs %}
+{% endfor %}
+
+{% comment %} Extract all tags {% endcomment %}
+
+{% for doc in docs %}
+ {% assign all_tags = all_tags | concat: doc.tags %}
+{% endfor %}
+
+{% assign unique_tags = all_tags | uniq %}
+
+{% assign tags_count = "" | split: "" %}
+{% assign tagged_docs = "" | split: "" %}
+{% assign tags_max = 0 %}
+
+{% for tag in unique_tags %}
+ {% comment %} Count the number of tag occurrence in all docs {% endcomment %}
+
+ {% assign count = 0 %}
+ {% for t in all_tags %}
+ {% if t == tag %}
+ {% assign count = count | plus: 1 %}
+ {% endif %}
+ {% endfor %}
+ {% assign tags_count = tags_count | push: count %}
+
+ {% comment %} Group docs by tags {% endcomment %}
+
+ {% assign found = docs | where_exp: "item", "item.tags contains tag" %}
+ {% assign tagged_docs = tagged_docs | push: found %}
+
+ {% if count > tags_max %}
+ {% assign tags_max = count %}
+ {% endif %}
+{% endfor %}
+
+
+ {% for i in (1..tags_max) reversed %}
+ {% for tag in unique_tags %}
+ {% if tags_count[forloop.index0] == i %}
+ -
+
+ {{ tag }} {{ i }}
+
+
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+
+
+{% assign entries_layout = page.entries_layout | default: 'list' %}
+{% for i in (1..tags_max) reversed %}
+ {% for tag in unique_tags %}
+ {% if tags_count[forloop.index0] == i %}
+
+ {% endif %}
+ {% endfor %}
+{% endfor %}
diff --git a/_posts/2021-12-04-beginner-get-started.md b/collections/_beginners/get-started.md
similarity index 99%
rename from _posts/2021-12-04-beginner-get-started.md
rename to collections/_beginners/get-started.md
index 51ee4c7..06247eb 100644
--- a/_posts/2021-12-04-beginner-get-started.md
+++ b/collections/_beginners/get-started.md
@@ -1,7 +1,5 @@
---
title: 初めての方へ ─ とりあえず動かす
-categories:
- - For Beginners
tags:
- For Beginners
- 沼の入り口
diff --git a/_posts/2021-12-04-roadmap.md b/collections/_beginners/roadmap.md
similarity index 98%
rename from _posts/2021-12-04-roadmap.md
rename to collections/_beginners/roadmap.md
index 1198d9f..15bb653 100644
--- a/_posts/2021-12-04-roadmap.md
+++ b/collections/_beginners/roadmap.md
@@ -1,8 +1,5 @@
---
title: ハードウェア対応状況とロードマップ
-categories:
- - Linux
- - U-Boot
tags:
- Linux
- U-Boot
diff --git a/_posts/2021-12-04-linux-copy-sd-card.md b/collections/_build/copy-sd-card.md
similarity index 99%
rename from _posts/2021-12-04-linux-copy-sd-card.md
rename to collections/_build/copy-sd-card.md
index f2a9098..7ccd548 100644
--- a/_posts/2021-12-04-linux-copy-sd-card.md
+++ b/collections/_build/copy-sd-card.md
@@ -1,7 +1,5 @@
---
title: SD カードへのコピー
-categories:
- - Linux
tags:
- Linux
- 自力ビルド
diff --git a/_posts/2021-12-04-linux-build.md b/collections/_build/linux.md
similarity index 96%
rename from _posts/2021-12-04-linux-build.md
rename to collections/_build/linux.md
index ea3763b..0c07db2 100644
--- a/_posts/2021-12-04-linux-build.md
+++ b/collections/_build/linux.md
@@ -1,7 +1,5 @@
---
title: Linux のビルド
-categories:
- - Linux
tags:
- Linux
- 自力ビルド
@@ -75,4 +73,4 @@ Linuxのカーネルの準備ができたら、カーネルの上で動くアプ
+ 52 apt install -y fbterm uim-fep uim-mozc
```
-[SD カードへのコピー](/linux/linux-copy-sd-card/)に続く…
+[SD カードへのコピー](/build/copy-sd-card/)に続く…
diff --git a/_posts/2021-12-04-u-boot-build.md b/collections/_build/uboot.md
similarity index 94%
rename from _posts/2021-12-04-u-boot-build.md
rename to collections/_build/uboot.md
index f7f9f26..891f216 100644
--- a/_posts/2021-12-04-u-boot-build.md
+++ b/collections/_build/uboot.md
@@ -1,7 +1,5 @@
---
title: U-Boot のビルド
-categories:
- - U-Boot
tags:
- U-Boot
- 自力ビルド
@@ -56,4 +54,4 @@ git clone --recursive https://github.com/brain-hackers/buildbrain.git
5. `make nk.bin` を実行します
-[Linux のビルド](/linux/linux-build/)に続く…
+[Linux のビルド](/build/linux/)に続く…
diff --git a/_posts/2021-12-04-brain-config.md b/collections/_linux/brain-config.md
similarity index 97%
rename from _posts/2021-12-04-brain-config.md
rename to collections/_linux/brain-config.md
index caa4410..00b8fd1 100644
--- a/_posts/2021-12-04-brain-config.md
+++ b/collections/_linux/brain-config.md
@@ -1,7 +1,5 @@
---
title: brain-config
-categories:
- - Linux
tags:
- Linux
---
diff --git a/_posts/2021-12-04-linux-package-list.md b/collections/_linux/package-list.md
similarity index 98%
rename from _posts/2021-12-04-linux-package-list.md
rename to collections/_linux/package-list.md
index 6a42918..4e5b00a 100644
--- a/_posts/2021-12-04-linux-package-list.md
+++ b/collections/_linux/package-list.md
@@ -1,7 +1,5 @@
---
title: パッケージ一覧
-categories:
- - Linux
tags:
- Linux
toc: false
diff --git a/_posts/2021-12-04-linux-xorg.md b/collections/_linux/xorg.md
similarity index 93%
rename from _posts/2021-12-04-linux-xorg.md
rename to collections/_linux/xorg.md
index d06c1c1..98ce808 100644
--- a/_posts/2021-12-04-linux-xorg.md
+++ b/collections/_linux/xorg.md
@@ -1,7 +1,5 @@
---
title: Xorg
-categories:
- - Linux
tags:
- Linux
- GUI
diff --git a/_posts/2021-12-04-meta-how-to-edit-wiki.md b/collections/_meta/how-to-edit-wiki.md
similarity index 99%
rename from _posts/2021-12-04-meta-how-to-edit-wiki.md
rename to collections/_meta/how-to-edit-wiki.md
index 3a7b177..9f88177 100644
--- a/_posts/2021-12-04-meta-how-to-edit-wiki.md
+++ b/collections/_meta/how-to-edit-wiki.md
@@ -1,7 +1,5 @@
---
title: Wiki の編集方法とルール
-categories:
- - Meta
tags:
- Wiki
- メンバー向け
diff --git a/_posts/2021-12-04-tips-otg.md b/collections/_tips/otg.md
similarity index 97%
rename from _posts/2021-12-04-tips-otg.md
rename to collections/_tips/otg.md
index 1981f08..974ae91 100644
--- a/_posts/2021-12-04-tips-otg.md
+++ b/collections/_tips/otg.md
@@ -1,7 +1,5 @@
---
title: OTG ケーブル
-categories:
- - Tips
tags:
- 周辺機器
- USB
diff --git a/_posts/2021-12-04-tips-swap.md b/collections/_tips/swap.md
similarity index 97%
rename from _posts/2021-12-04-tips-swap.md
rename to collections/_tips/swap.md
index 41df926..3d27add 100644
--- a/_posts/2021-12-04-tips-swap.md
+++ b/collections/_tips/swap.md
@@ -1,8 +1,5 @@
---
title: Swap 領域
-categories:
- - Tips
- - Linux
tags:
- Linux
excerpt: ""
diff --git a/_posts/2021-12-04-tips-touch-panel.md b/collections/_tips/touch-panel.md
similarity index 91%
rename from _posts/2021-12-04-tips-touch-panel.md
rename to collections/_tips/touch-panel.md
index 2460b2c..434f5e7 100644
--- a/_posts/2021-12-04-tips-touch-panel.md
+++ b/collections/_tips/touch-panel.md
@@ -1,8 +1,5 @@
---
title: タッチパネル
-categories:
- - Tips
- - Linux
tags:
- Linux
- GUI
@@ -11,13 +8,6 @@ excerpt: タッチパネルのキャリブレーション(Brainux に同梱さ
---
-# 事前に
-
-Xorgの設定ファイル ( xorg.conf )を設定していない場合は、下記のWikiを参照して設定してください。
-
-[Xorg](/linux/linux-xorg/)
-
-
# 必要なパッケージのインストール
```sh
diff --git a/_posts/2021-12-04-tips-usb-ethernet-gadget.md b/collections/_tips/usb-ethernet-gadget.md
similarity index 99%
rename from _posts/2021-12-04-tips-usb-ethernet-gadget.md
rename to collections/_tips/usb-ethernet-gadget.md
index d9ac9f8..a582dcc 100644
--- a/_posts/2021-12-04-tips-usb-ethernet-gadget.md
+++ b/collections/_tips/usb-ethernet-gadget.md
@@ -1,8 +1,5 @@
---
title: USB Ethernet Gadget
-categories:
- - Tips
- - Linux
tags:
- Linux
- USB
diff --git a/_posts/2021-12-04-tips-web-browser.md b/collections/_tips/web-browser.md
similarity index 97%
rename from _posts/2021-12-04-tips-web-browser.md
rename to collections/_tips/web-browser.md
index 7ead026..3c22414 100644
--- a/_posts/2021-12-04-tips-web-browser.md
+++ b/collections/_tips/web-browser.md
@@ -1,8 +1,5 @@
---
title: Web ブラウザ
-categories:
- - Tips
- - Linux
tags:
- Linux
- GUI
diff --git a/_posts/2021-12-04-u-boot-boot-eboot.md b/collections/_u-boot/boot-eboot.md
similarity index 89%
rename from _posts/2021-12-04-u-boot-boot-eboot.md
rename to collections/_u-boot/boot-eboot.md
index 2bb0a41..b997fd8 100644
--- a/_posts/2021-12-04-u-boot-boot-eboot.md
+++ b/collections/_u-boot/boot-eboot.md
@@ -1,7 +1,5 @@
---
title: EBOOT を介した起動
-categories:
- - U-Boot
tags:
- U-Boot
- EBOOT
diff --git a/_posts/2021-12-04-u-boot-boot-usb.md b/collections/_u-boot/boot-usb.md
similarity index 88%
rename from _posts/2021-12-04-u-boot-boot-usb.md
rename to collections/_u-boot/boot-usb.md
index fa722b8..483939e 100644
--- a/_posts/2021-12-04-u-boot-boot-usb.md
+++ b/collections/_u-boot/boot-usb.md
@@ -1,7 +1,5 @@
---
title: USB Recovery を介した起動
-categories:
- - U-Boot
tags:
- U-Boot
# excerpt: "記事が書けたらこの行をアンコメントして記入してください"
diff --git a/package.json b/package.json
index bd4c2fe..4254eab 100644
--- a/package.json
+++ b/package.json
@@ -8,8 +8,8 @@
"textlint-rule-prh": "^5.3.0"
},
"scripts": {
- "textlint": "textlint '_posts/*'",
- "textlint-fix": "textlint --fix '_posts/*'",
- "mdlint": "./node_modules/markdownlint-cli/markdownlint.js _posts"
+ "textlint": "textlint 'collections/**/*'",
+ "textlint-fix": "textlint --fix 'collections/**/*'",
+ "mdlint": "./node_modules/markdownlint-cli/markdownlint.js collections/**/*"
}
}