From ef35a40059be533bfc66c39bfdfb6ba22c0a672f Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sat, 18 Apr 2020 12:00:23 +0200 Subject: Improve render.js code --- src/Documentation/_markdown.pug | 8 -------- src/_layout.pug | 2 ++ src/_mixin/menu.pug | 7 +++++++ 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 src/_mixin/menu.pug (limited to 'src') diff --git a/src/Documentation/_markdown.pug b/src/Documentation/_markdown.pug index ea23f15..b5dcdf4 100644 --- a/src/Documentation/_markdown.pug +++ b/src/Documentation/_markdown.pug @@ -3,14 +3,6 @@ extends ../_layout.pug prepend root - title = element.nice_path[element.nice_path.length - 1] -mixin menu(o) - ul - each val in o.children - - if (val.type == 'folder') - li - a(href=val.url)= val.nice_name - +menu(val) - block content .container.spacing nav diff --git a/src/_layout.pug b/src/_layout.pug index ffc905e..0a7f697 100644 --- a/src/_layout.pug +++ b/src/_layout.pug @@ -1,3 +1,5 @@ +include _mixin/menu.pug + block root doctype html head diff --git a/src/_mixin/menu.pug b/src/_mixin/menu.pug new file mode 100644 index 0000000..09794c6 --- /dev/null +++ b/src/_mixin/menu.pug @@ -0,0 +1,7 @@ +mixin menu(o) + ul + each val in o.children + - if (val.type == 'folder') + li + a(href=val.url)= val.nice_name + +menu(val) -- cgit v1.2.3