The highlighting should be loaded before the CSS.
This way a client can override the CSS from the highlighting.
This commit is contained in:
@ -15,6 +15,11 @@ fn BlogLayout() -> Element
|
|||||||
// Retrieve the provided settings from context.
|
// Retrieve the provided settings from context.
|
||||||
let settings = use_context::<BardSettings>();
|
let settings = use_context::<BardSettings>();
|
||||||
|
|
||||||
|
// 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!
|
rsx!
|
||||||
{
|
{
|
||||||
match settings.stylesheet
|
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::<Page> {}
|
Outlet::<Page> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user