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:: {} } }