list-details.md: クリーンアップ

gh-pages
Rui 2018-04-04 22:55:13 +09:00
parent 85e32a6b6f
commit 59a732798a
8 changed files with 27 additions and 65 deletions

View File

@ -1,11 +1,10 @@
{% comment %}
引数: なし (assignされたdata変数を参照)
引数:
data_list: データ
{% endcomment %}
{% comment %}
空のリストを作成
{% endcomment %}
{% assign details = "" | split: "|" %}
{% assign data = include.data_list %}
{% comment %}
リンク

View File

@ -1,11 +1,10 @@
{% comment %}
引数: なし (assignされたdata変数を参照)
引数:
data_list: データ
{% endcomment %}
{% comment %}
空のリストを作成
{% endcomment %}
{% assign details = "" | split: "|" %}
{% assign data = include.data_list %}
{% comment %}
リンク

View File

@ -1,11 +1,10 @@
{% comment %}
引数: なし (assignされたdata変数を参照)
引数:
data_list: データ
{% endcomment %}
{% comment %}
空のリストを作成
{% endcomment %}
{% assign details = "" | split: "|" %}
{% assign data = include.data_list %}
{% comment %}
リンク

View File

@ -1,11 +1,10 @@
{% comment %}
引数: なし (assignされたdata変数を参照)
引数:
data_list: データ
{% endcomment %}
{% comment %}
空のリストを作成
{% endcomment %}
{% assign details = "" | split: "|" %}
{% assign data = include.data_list %}
{% comment %}
リンク

View File

@ -1,11 +1,10 @@
{% comment %}
引数: なし (assignされたdata変数を参照)
引数:
data_list: データ
{% endcomment %}
{% comment %}
空のリストを作成
{% endcomment %}
{% assign details = "" | split: "|" %}
{% assign data = include.data_list %}
{% comment %}
リンク

View File

@ -1,53 +1,26 @@
{% comment %}
引数:
type: 表示するdetailsの種類
list: 表示するデータのリスト
キー: アンカー名
値: データ:
name: データ名
引数:
type: 表示するdetailsの種類
list: 表示するデータのリスト
キー: アンカー名
値: データ:
'name': データ名
{% endcomment %}
{% comment %}
アンカー名でソートする
{% endcomment %}
{% comment %}
全てのアンカー名を一つの文字列にする
{% endcomment %}
{% capture template_name %}details-{{ include.type }}.md{% endcapture %}
{% capture keys %}
{% for data in include.list %}
{{ data[0] }}
{% endfor %}
{% endcapture %}
{% comment %}
アンカー名を空白で区切ってソートする
{% endcomment %}
{% assign sorted_keys = (keys | split: " " | sort) %}
{% comment %}
使用するテンプレートファイル名
{% endcomment %}
{% capture template %}details-{{ include.type }}.md{% endcapture %}
{% comment %}
ソートしたアンカーリストでFor実行
{% endcomment %}
{% assign sorted_keys = keys | split: " " | sort %}
{% for key in sorted_keys %}
{% comment %}
assignした変数はinclude先でも参照できる
アンカー名で参照
{% endcomment %}
{% assign data = include.list[key] %}
{% assign data = include.list[key] %}
{% comment %}
Markdownはインデント不可
{% endcomment %}
# {{ data.name }} {#{{ key }}}
{% comment %}
テンプレートを表示
同じくインデント不可
{% endcomment %}
{% include {{ template }} %}
{% include {{ template_name }}
data_list = include.list[key]
%}
{% endfor %}

View File

@ -10,9 +10,6 @@ date:
# Pipeworksとは
{% assign data = site.data.mods-industry.pipeworks %}
{% include details-mod.md %}
アイテムや水を輸送することを目的としたModです。また、輸送されたアイテムを使用する機械なども含まれています。
MeseconsやTechnic等を組み合わせることにより様々なことが可能となるModです。

View File

@ -10,9 +10,6 @@ date:
# Technicとは
{% assign data = site.data.mods-industry.technic %}
{% include details-mod.md %}
「Technic」はMinetestの工業化Modです。
『電力(EU)』という新しい仕組みを使って、いろいろな作業を自動化したり、新しい道具や機械を開発したりできます。