wiki/_includes/list-contents.md

961 B

{% comment %} 引数: type: 表示するコンテンツの種類 list: 表示するデータのリスト キー: アンカー名 値: データ: name: データ名 {% endcomment %}

{% capture anchors %} {% for data in include.list %} {{ data[0] }} {% endfor %} {% endcapture %}

{% assign sorted-anchors = anchors | split: " " | sort %}

{% capture template-name %}content-{{ include.type }}.md{% endcapture %}

{% for anchor in sorted-anchors %} {% assign content-data = include.list[anchor] %}

{{ content-data.name }} {#{{ anchor }}}

{% include {{ template-name }} data=content-data %} {% endfor %}