From 191d4f19bf5170ae8eef7479b8b1320818f799c3 Mon Sep 17 00:00:00 2001 From: Wout Date: Thu, 19 Oct 2023 15:03:30 +0200 Subject: [PATCH] fix: wrap links in current_page? example in
  • tags --- src/actions/guides/frontend/rendering_html.cr | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/actions/guides/frontend/rendering_html.cr b/src/actions/guides/frontend/rendering_html.cr index 658e4383..7ed55f74 100644 --- a/src/actions/guides/frontend/rendering_html.cr +++ b/src/actions/guides/frontend/rendering_html.cr @@ -466,20 +466,19 @@ class Guides::Frontend::RenderingHtml < GuideAction ```crystal nav do ul do - link "Home", - to: Home::Index, - data_selected: current_page?(Home::Index) + li data_current: current_page?(Home::Index) do + link "Home", to: Home::Index, + end - link "Your dashboard", - to: Dashboard::Index, - data_selected: current_page?(Dashboard::Index) + li data_current: current_page?(Dashboard::Index) do + link "Your dashboard", to: Dashboard::Index, + end - link "Your profile", - to: Me::Show, - data_selected: current_page?(Me::Show) + li data_current: current_page?(Me::Show) do + link "Your profile", to: Me::Show + end end end - ``` ### Advanced usage