From 262faca90e0de5d8fb1d4899851e70a07c38bf62 Mon Sep 17 00:00:00 2001 From: James Brechtel Date: Tue, 19 May 2026 15:31:12 -0400 Subject: [PATCH] =?UTF-8?q?Render=20source=20metadata=20as=20'=E2=86=97=20?= =?UTF-8?q?Original=20recipe'=20link=20next=20to=20title?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - When recipe has a source: field in YAML metadata, shows a link to the right of the recipe title - Link opens in new tab with ↗ icon and 'Original recipe' text - Hidden when no source is present - Title row uses flexbox: title on left, source link on right --- src/Roux/Html.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Roux/Html.hs b/src/Roux/Html.hs index 54968eb..06db893 100644 --- a/src/Roux/Html.hs +++ b/src/Roux/Html.hs @@ -337,7 +337,12 @@ renderRecipe recipe = do case course of Just c -> H.p ! A.class_ "roux-course" $ H.toHtml c Nothing -> pure () - H.h1 $ H.toHtml (titleText recipe) + H.div ! A.style "display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;" $ do + H.h1 $ H.toHtml (titleText recipe) + case metaSource meta of + Just url -> H.a ! A.href (H.toValue url) ! A.target "_blank" ! A.rel "noopener noreferrer" ! A.style "white-space: nowrap; font-size: 0.8rem; flex-shrink: 0;" $ do + "↗ Original recipe" + Nothing -> pure () case desc of Just d -> H.p ! A.class_ "roux-desc" $ H.toHtml d Nothing -> pure ()