From 0b7acadd60aa32ece550b2177fcd10cadc29f0e3 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 2 Jun 2023 00:18:06 -0400 Subject: [PATCH] Add main turbo-frame Nav link navigations now only replace the main content area while leaving the header in place. --- src/partials/header.rs | 4 ++-- src/partials/layout.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/partials/header.rs b/src/partials/header.rs index 3e188d1..4e0ec03 100644 --- a/src/partials/header.rs +++ b/src/partials/header.rs @@ -4,9 +4,9 @@ pub fn header() -> Markup { html! { header { nav { - h1 { a href="/" { "crawlnicle" } } + h1 { a href="/" data-turbo-frame="main" { "crawlnicle" } } ul { - li { a href="/feeds" { "feeds" } } + li { a href="/feeds" data-turbo-frame="main" { "feeds" } } } } } diff --git a/src/partials/layout.rs b/src/partials/layout.rs index 63205ca..80cfc41 100644 --- a/src/partials/layout.rs +++ b/src/partials/layout.rs @@ -45,7 +45,9 @@ impl Layout { } body { (header()) - (template) + turbo-frame id="main" { + (template) + } } } }