From 8063067f53d1a9370700d9b5ebfbc30a1b65e168 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Sun, 10 May 2020 20:16:34 +0200 Subject: Rework css --- render.js | 2 +- src/_layout.pug | 2 +- src/_mixin/menu.pug | 8 ++++---- src/css/main.css | 15 +++++++++++++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/render.js b/render.js index d10f5b1..c7cdbf1 100644 --- a/render.js +++ b/render.js @@ -193,8 +193,8 @@ const do_pug = (prt, root) => async tree => { if (tree.generate && tree.generate.cmd == 'pug') { const html = pug.renderFile(tree.generate.src, { markdown: tree.generate.markdown ? marked(await fs.readFile(tree.generate.markdown, 'utf-8')) : null, - prt: prt, root: root, + prt: prt, element: tree }) await fs.writeFile(tree.generate.out, html) diff --git a/src/_layout.pug b/src/_layout.pug index d52ace6..6dc80a1 100644 --- a/src/_layout.pug +++ b/src/_layout.pug @@ -22,7 +22,7 @@ block root img(src="/img/flower.svg", width="40") | img(src="/img/flower.svg", width="40") - +menu(root) + +menu(root, element) main block content diff --git a/src/_mixin/menu.pug b/src/_mixin/menu.pug index 462d06f..037b1aa 100644 --- a/src/_mixin/menu.pug +++ b/src/_mixin/menu.pug @@ -1,13 +1,13 @@ -mixin menu(o) +mixin menu(o, element) ul each val in o.children - if (val.type == 'folder' && val.tags.includes('document')) li - if (val.tags.includes('has_index')) - a(href=val.url)= val.nice_name + a(href=val.url, class=val.index.url == element.url ? 'selected' : null)= val.nice_name - else span= val.nice_name - +menu(val) + +menu(val, element) - else if (val.type == 'file' && val.tags.includes('document') && !val.tags.includes('is_index')) li - a(href=val.url)= val.nice_name + a(href=val.url, class=val.url == element.url ? 'selected' : null)= val.nice_name diff --git a/src/css/main.css b/src/css/main.css index 1db711b..47dcf8b 100644 --- a/src/css/main.css +++ b/src/css/main.css @@ -31,7 +31,7 @@ body { */ .mobile_block, .mobile_inline { display: none } -@media screen and (max-width: 640px) { +@media screen and (max-width: 800px) { body { flex-direction: column } .computer_block { display: none } .mobile_block { display: block } @@ -62,11 +62,21 @@ body > header a { text-decoration: none; } +body > header > nav ul { + list-style-type: none; + padding-left: 1em; +} +body > header > nav > ul { padding-left: 0px } +body > header > nav a:hover { text-decoration: underline } +body > header > nav .selected { font-weight: bold } +body > header > nav .selected::before { content: "ยป " } + body > main { padding: 1.5rem; max-width: 1200px; } + /* * TEXT CORE (think markdown) */ @@ -77,7 +87,8 @@ h3 { font-size: 1.75rem } h4 { font-size: 1.50rem } h5 { font-size: 1.25rem } h6 { font-size: 1.10rem } -section, p { margin-bottom: 1rem } +section, p, ul, ol { margin-bottom: 1rem } +ul, ol { padding-left: 1.5em } /* * UTILS -- cgit v1.2.3