From 67b27cc0d9f9b27f460e022449a43b61ddb05a0b Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Sat, 15 Sep 2018 13:17:56 +0200 Subject: [PATCH] Render functions in proper order despite the YAML order --- _data/functions.yml | 2 ++ _includes/function_list.html | 8 +++++--- _layouts/bin.html | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/_data/functions.yml b/_data/functions.yml index 98282a9..f03bc26 100644 --- a/_data/functions.yml +++ b/_data/functions.yml @@ -1,4 +1,6 @@ --- +# this is the rendering order of functions + execute-interactive: label: Interactive execute description: | diff --git a/_includes/function_list.html b/_includes/function_list.html index 11bb9ea..d2baa55 100644 --- a/_includes/function_list.html +++ b/_includes/function_list.html @@ -1,6 +1,8 @@ diff --git a/_layouts/bin.html b/_layouts/bin.html index 19b6039..ce7ae5e 100644 --- a/_layouts/bin.html +++ b/_layouts/bin.html @@ -10,10 +10,10 @@ layout: common {{ page.description | markdownify }} -{% for function in page.functions %} - +{% for function in site.data.functions %} {% assign function_name = function[0] %} -{% assign examples = function[1] %} +{% assign examples = page.functions[function_name] %} +{% if examples %}

{{- site.data.functions[function_name].label -}} @@ -46,4 +46,5 @@ sudo setcap cap_setuid+ep {{ bin_name }} +{% endif %} {% endfor %}