From a86c62d65854db9eaf0876b39ef24df9005be33d Mon Sep 17 00:00:00 2001 From: Adam Schmideg Date: Thu, 21 Feb 2019 12:56:43 +0100 Subject: [PATCH] Automatically collect all files in the doc folder --- _config.yml | 4 ++++ _layouts/sidebar.html | 25 +++++++++++++++++-------- doc.md | 7 +++++++ 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 doc.md diff --git a/_config.yml b/_config.yml index 27791b864c..f3e58d43d6 100644 --- a/_config.yml +++ b/_config.yml @@ -36,3 +36,7 @@ collections: output: true caption: Developers sidebar_index: 5 + doc: + output: true + caption: Other + sidebar_index: 6 diff --git a/_layouts/sidebar.html b/_layouts/sidebar.html index e0291eda83..7ca4aa361e 100644 --- a/_layouts/sidebar.html +++ b/_layouts/sidebar.html @@ -7,14 +7,23 @@ layout: default {% assign collections = site.collections | sort: "sidebar_index" %} {% for coll in collections %} {% if coll.sidebar_index %} -
- {{ coll.caption }} - {% for doc in coll.docs %} - - {% include title.html doc=doc coll=coll %} - {% endfor %} -
+ {% assign count = coll.docs | size %} + {% if count <= 5 %} +
+ {{ coll.caption }} + {% for doc in coll.docs %} + + {% include title.html doc=doc coll=coll %} + {% endfor %} +
+ {% else %} + {% capture url %}../{{ coll.label }}{% endcapture %} +
+ {{ coll.caption }} +
+ {% endif %} {% endif %} {% endfor %} diff --git a/doc.md b/doc.md new file mode 100644 index 0000000000..cb91264512 --- /dev/null +++ b/doc.md @@ -0,0 +1,7 @@ +--- +title: Other documents +--- + +{% for p in site.doc %} +* [{{ p.title }}]({% include link.html url=p.url %}) +{% endfor %} \ No newline at end of file