From 6d887da5cd9de6599ca579b17d6f726ef789dd18 Mon Sep 17 00:00:00 2001 From: liquidev Date: Wed, 7 Feb 2024 13:32:47 +0100 Subject: [PATCH] display page title a bit more proudly --- crates/treehouse/src/cli/generate.rs | 4 ++++ static/css/main.css | 19 +++++++++++++++++-- template/tree.hbs | 18 ++++++++++++------ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/crates/treehouse/src/cli/generate.rs b/crates/treehouse/src/cli/generate.rs index fa368d4..fb7b52c 100644 --- a/crates/treehouse/src/cli/generate.rs +++ b/crates/treehouse/src/cli/generate.rs @@ -198,6 +198,7 @@ impl Generator { pub struct Page { pub title: String, pub breadcrumbs: String, + pub tree_path: Option, pub tree: String, } @@ -211,6 +212,9 @@ impl Generator { page: Page { title: roots.attributes.title.clone(), breadcrumbs, + tree_path: treehouse + .tree_path(parsed_tree.file_id) + .map(|s| s.to_owned()), tree, }, }; diff --git a/static/css/main.css b/static/css/main.css index 12b7119..baef92b 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -313,13 +313,19 @@ th { display: none; } -/* Give the logo on the top some nicer looks */ +/* Style the navigation bar. */ nav { display: flex; align-items: center; } +nav .nav-page { + display: flex; + flex-direction: column; +} + +/* Give the logo on the top some nicer looks */ nav .logo { width: 48px; height: 48px; @@ -329,6 +335,15 @@ nav .logo { color: var(--text-color); } +/* Style page titles */ +h1.page-title { + --recursive-wght: 800; + margin-top: 0; + margin-bottom: 0; + margin-left: 32px; + font-size: 1.25rem; +} + /* Style emojis to be readable */ img[is="th-emoji"] { @@ -406,4 +421,4 @@ img[is="th-emoji"] { #index\:treehouse>details:not([open])>summary .oops-you-seem-to-have-gotten-stuck { display: inline; animation: 4s hello-there forwards; -} +} \ No newline at end of file diff --git a/template/tree.hbs b/template/tree.hbs index 1637afc..0312931 100644 --- a/template/tree.hbs +++ b/template/tree.hbs @@ -41,11 +41,17 @@ - {{#if page.breadcrumbs}} - - {{/if}} +