"list-details.md: クリーンアップ"を元に戻す

gh-pages
Rui 2018-04-04 23:23:29 +09:00
parent 59a732798a
commit 12a064eed3
8 changed files with 66 additions and 28 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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