diff options
author | Jacob Fenton <jacob+github@dfenton.xyz> | 2024-04-01 07:56:45 -0500 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-04-03 15:59:40 +0100 |
commit | f529be158c97086e122e058bda398f85859d2be1 (patch) | |
tree | 3756c605fa88670d75ae10b7fb0103d7087c02e9 | |
parent | a1d26bafbe59981b69770b8b9a8bca02b1b73aff (diff) | |
download | tour-f529be158c97086e122e058bda398f85859d2be1.tar.gz tour-f529be158c97086e122e058bda398f85859d2be1.zip |
Put nav at the bottom of the page, so it doesn't move around from lesson to lesson.
-rw-r--r-- | src/tour.gleam | 26 | ||||
-rw-r--r-- | static/css/pages/lesson.css | 6 |
2 files changed, 20 insertions, 12 deletions
diff --git a/src/tour.gleam b/src/tour.gleam index b1c13d1..3948ba5 100644 --- a/src/tour.gleam +++ b/src/tour.gleam @@ -648,17 +648,20 @@ fn lesson_page_render(lesson: Lesson) -> String { static_content: [render_navbar()], content: [ h("article", [#("id", "playground")], [ - h("section", [#("id", "left")], [ - h("h2", [], [text(lesson.name)]), - htmb.dangerous_unescaped_fragment(string_builder.from_string( - lesson.text, - )), - h("nav", [#("class", "prev-next")], [ - navlink("Back", lesson.previous), - text(" — "), - h("a", [#("href", path_table_of_contents)], [text("Contents")]), - text(" — "), - navlink("Next", lesson.next), + h("section", [#("id", "left"), #("class", "content-nav")], [ + h("div", [], [ + h("h2", [], [text(lesson.name)]), + htmb.dangerous_unescaped_fragment(string_builder.from_string( + lesson.text, + )), + ]), + h("nav", [#("class", "prev-next")], [ + navlink("Back", lesson.previous), + text(" — "), + h("a", [#("href", path_table_of_contents)], [text("Contents")]), + text(" — "), + navlink("Next", lesson.next), + ]), ]), ]), h("section", [#("id", "right")], [ @@ -667,7 +670,6 @@ fn lesson_page_render(lesson: Lesson) -> String { ]), h("aside", [#("id", "output")], []), ]), - ]), ], scripts: ScriptConfig( body: [ diff --git a/static/css/pages/lesson.css b/static/css/pages/lesson.css index 492c1fe..4468d56 100644 --- a/static/css/pages/lesson.css +++ b/static/css/pages/lesson.css @@ -92,4 +92,10 @@ .mb-0 { margin-bottom: 0; +} + +.content-nav { + display: flex; + flex-direction: column; + justify-content: space-between; }
\ No newline at end of file |