diff --git a/_includes/details-map.md b/_includes/details-map.md index f69bac1..b7c2e09 100644 --- a/_includes/details-map.md +++ b/_includes/details-map.md @@ -1,10 +1,11 @@ {% comment %} - 引数: - data_list: データ +引数: なし (assignされたdata変数を参照) {% endcomment %} +{% comment %} +空のリストを作成 +{% endcomment %} {% assign details = "" | split: "|" %} -{% assign data = include.data_list %} {% comment %} リンク diff --git a/_includes/details-mod.md b/_includes/details-mod.md index 386534c..bf99ae1 100644 --- a/_includes/details-mod.md +++ b/_includes/details-mod.md @@ -1,10 +1,11 @@ {% comment %} - 引数: - data_list: データ +引数: なし (assignされたdata変数を参照) {% endcomment %} +{% comment %} +空のリストを作成 +{% endcomment %} {% assign details = "" | split: "|" %} -{% assign data = include.data_list %} {% comment %} リンク diff --git a/_includes/details-subgame.md b/_includes/details-subgame.md index 4630b06..da322fa 100644 --- a/_includes/details-subgame.md +++ b/_includes/details-subgame.md @@ -1,10 +1,11 @@ {% comment %} - 引数: - data_list: データ +引数: なし (assignされたdata変数を参照) {% endcomment %} +{% comment %} +空のリストを作成 +{% endcomment %} {% assign details = "" | split: "|" %} -{% assign data = include.data_list %} {% comment %} リンク diff --git a/_includes/details-texturepack.md b/_includes/details-texturepack.md index f69bac1..b7c2e09 100644 --- a/_includes/details-texturepack.md +++ b/_includes/details-texturepack.md @@ -1,10 +1,11 @@ {% comment %} - 引数: - data_list: データ +引数: なし (assignされたdata変数を参照) {% endcomment %} +{% comment %} +空のリストを作成 +{% endcomment %} {% assign details = "" | split: "|" %} -{% assign data = include.data_list %} {% comment %} リンク diff --git a/_includes/details-tool.md b/_includes/details-tool.md index 9644c88..0fcce50 100644 --- a/_includes/details-tool.md +++ b/_includes/details-tool.md @@ -1,10 +1,11 @@ {% comment %} - 引数: - data_list: データ +引数: なし (assignされたdata変数を参照) {% endcomment %} +{% comment %} +空のリストを作成 +{% endcomment %} {% assign details = "" | split: "|" %} -{% assign data = include.data_list %} {% comment %} リンク diff --git a/_includes/list-details.md b/_includes/list-details.md index 2e29674..d245945 100644 --- a/_includes/list-details.md +++ b/_includes/list-details.md @@ -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 %} diff --git a/wiki/mod-manuals/mod-manual-pipeworks.md b/wiki/mod-manuals/mod-manual-pipeworks.md index 33ad827..cec3ebc 100644 --- a/wiki/mod-manuals/mod-manual-pipeworks.md +++ b/wiki/mod-manuals/mod-manual-pipeworks.md @@ -10,6 +10,9 @@ date: # Pipeworksとは +{% assign data = site.data.mods-industry.pipeworks %} +{% include details-mod.md %} + アイテムや水を輸送することを目的としたModです。また、輸送されたアイテムを使用する機械なども含まれています。 MeseconsやTechnic等を組み合わせることにより様々なことが可能となるModです。 diff --git a/wiki/mod-manuals/mod-manual-technic.md b/wiki/mod-manuals/mod-manual-technic.md index ed3bf9a..9c6a45f 100644 --- a/wiki/mod-manuals/mod-manual-technic.md +++ b/wiki/mod-manuals/mod-manual-technic.md @@ -10,6 +10,9 @@ date: # Technicとは? +{% assign data = site.data.mods-industry.technic %} +{% include details-mod.md %} + 「Technic」はMinetestの工業化Modです。 『電力(EU)』という新しい仕組みを使って、いろいろな作業を自動化したり、新しい道具や機械を開発したりできます。