From 6708636ec24322c7f20cd46ae81ddca2f9bdba24 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Sat, 17 Jan 2026 20:02:56 -0500 Subject: [PATCH] The highlighting should be loaded before the CSS. This way a client can override the CSS from the highlighting. --- bard/src/page.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bard/src/page.rs b/bard/src/page.rs index 7c6eba1..d32497c 100644 --- a/bard/src/page.rs +++ b/bard/src/page.rs @@ -15,6 +15,11 @@ fn BlogLayout() -> Element // Retrieve the provided settings from context. let settings = use_context::(); + // Setup the system to use Highlight.js for code blocks. + // This is required for the Bard library. + document::Stylesheet { href: "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/vs2015.css" } + document::Script { src: "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js" } + rsx! { match settings.stylesheet @@ -45,10 +50,6 @@ fn BlogLayout() -> Element } } - // Setup the system to use Highlight.js for code blocks. - document::Stylesheet { href: "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/vs2015.css" } - document::Script { src: "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js" } - Outlet:: {} } }