Merge pull request #29 from brain-hackers/update

_posts を collections へ移動 etc.
This commit is contained in:
佐桜 彩斗 2022-12-14 20:40:21 +09:00 committed by GitHub
commit 3c2d36cce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 164 additions and 137 deletions

5
.editorconfig Normal file
View File

@ -0,0 +1,5 @@
root = true
[*.html]
charset = utf-8
indent_size = 2

View File

@ -1 +1 @@
_posts/2021-12-04-linux-package-list.md
collections/_linux/package-list.md

View File

@ -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

View File

@ -1,6 +1,6 @@
main:
- title: "初めての方へ"
url: /for%20beginners/beginner-get-started/
url: /beginners/get-started/
- title: "タグ一覧"
url: /tags/
- title: "この Wiki について"

View File

@ -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 %}
<img src="/assets/images/top.jpg">
<h3>カテゴリ一覧</h3>
<ul class="taxonomy__index">
{% 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 %}
<!--<p>category[0] = `{{ category[0]}}`, stay = `{{ stay }}`</p>-->
{% if category[0] == stay %}
{% for label in site.collections_order %}
{% assign collection = site.collections | where: "label", label | first %}
<li>
<!-- Stay on top -->
<a href="#{{ category[0] | slugify }}">
<strong>{{ category[0] }}</strong>
</a>
</li>
{% 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 %}
<li>
<a href="#{{ category[0] | slugify }}">
<strong>{{ category[0] }}</strong> <span class="taxonomy__count">{{ i }}</span>
<a href="#{{ collection.label | slugify | downcase }}">
<strong>{{ collection.name }}</strong> <span class="taxonomy__count">{{ i }}</span>
</a>
</li>
{% endfor %}
</ul>
{% assign entries_layout = page.entries_layout | default: 'list' %}
{% for category in site.categories %}
{% for stay in stay_on_top %}
{% if category[0] == stay %}
<section id="{{ category[0] | slugify | downcase }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ category[0] }}</h2>
<div class="entries-{{ entries_layout }}">
{% for post in category.last %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
</section>
{% 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 %}
{% assign entries_layout = page.entries_layout | default: 'list' %}
{% for label in site.collections_order %}
{% assign collection = site.collections | where: "label", label | first %}
<section id="{{ collection.label | slugify | downcase }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ collection.name }}</h2>
<div class="entries-{{ 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 %}
<p style="color: #ff0000; font-weight: bolder">{{docpath}} not found!</p>
{% endif %}
{% endfor %}
{% if skip %}
{% continue %}
{% endif %}
<section id="{{ category[0] | slugify | downcase }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ category[0] }}</h2>
<div class="entries-{{ entries_layout }}">
{% for post in category.last %}
{% 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 %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>

76
_layouts/tags.html Normal file
View File

@ -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 %}
<ul class="taxonomy__index">
{% for i in (1..tags_max) reversed %}
{% for tag in unique_tags %}
{% if tags_count[forloop.index0] == i %}
<li>
<a href="#{{ tag | slugify | downcase }}">
<strong>{{ tag }}</strong> <span class="taxonomy__count">{{ i }}</span>
</a>
</li>
{% endif %}
{% endfor %}
{% endfor %}
</ul>
{% 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 %}
<section id="{{ tag | slugify | downcase }}" class="taxonomy__section">
<h2 class="archive__subtitle">{{ tag }}</h2>
<div class="entries-{{ entries_layout }}">
{% for post in tagged_docs[forloop.index0] %}
{% include archive-single.html type=entries_layout %}
{% endfor %}
</div>
<a href="#page-title" class="back-to-top">{{ site.data.ui-text[site.locale].back_to_top | default: 'Back to Top' }} &uarr;</a>
</section>
{% endif %}
{% endfor %}
{% endfor %}

View File

@ -1,7 +1,5 @@
---
title: 初めての方へ ─ とりあえず動かす
categories:
- For Beginners
tags:
- For Beginners
- 沼の入り口

View File

@ -1,8 +1,5 @@
---
title: ハードウェア対応状況とロードマップ
categories:
- Linux
- U-Boot
tags:
- Linux
- U-Boot

View File

@ -1,7 +1,5 @@
---
title: SD カードへのコピー
categories:
- Linux
tags:
- Linux
- 自力ビルド

View File

@ -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/)に続く…

View File

@ -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/)に続く…

View File

@ -1,7 +1,5 @@
---
title: brain-config
categories:
- Linux
tags:
- Linux
---

View File

@ -1,7 +1,5 @@
---
title: パッケージ一覧
categories:
- Linux
tags:
- Linux
toc: false

View File

@ -1,7 +1,5 @@
---
title: Xorg
categories:
- Linux
tags:
- Linux
- GUI

View File

@ -1,7 +1,5 @@
---
title: Wiki の編集方法とルール
categories:
- Meta
tags:
- Wiki
- メンバー向け

View File

@ -1,7 +1,5 @@
---
title: OTG ケーブル
categories:
- Tips
tags:
- 周辺機器
- USB

View File

@ -1,8 +1,5 @@
---
title: Swap 領域
categories:
- Tips
- Linux
tags:
- Linux
excerpt: ""

View File

@ -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

View File

@ -1,8 +1,5 @@
---
title: USB Ethernet Gadget
categories:
- Tips
- Linux
tags:
- Linux
- USB

View File

@ -1,8 +1,5 @@
---
title: Web ブラウザ
categories:
- Tips
- Linux
tags:
- Linux
- GUI

View File

@ -1,7 +1,5 @@
---
title: EBOOT を介した起動
categories:
- U-Boot
tags:
- U-Boot
- EBOOT

View File

@ -1,7 +1,5 @@
---
title: USB Recovery を介した起動
categories:
- U-Boot
tags:
- U-Boot
# excerpt: "記事が書けたらこの行をアンコメントして記入してください"

View File

@ -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/**/*"
}
}