diff --git a/website/src/templates/docs/template.rs b/website/src/templates/docs/template.rs index 73cfe36b5e..b6b8903e59 100644 --- a/website/src/templates/docs/template.rs +++ b/website/src/templates/docs/template.rs @@ -42,6 +42,8 @@ pub fn docs_page(props: DocsPageProps) -> SycamoreTemplate { current_version }) // Because of how Perseus currently shifts everything, we need to re-highlight + // And if the user starts on a page with nothing, they'll see no highlighting on any other pages, so we rerun every time the URL changes + script(src = "/.perseus/static/prism.js", defer = true) script { "window.Prism.highlightAll();" } @@ -64,7 +66,6 @@ pub fn get_template() -> Template { link(rel = "stylesheet", href = "/.perseus/static/styles/markdown.css") link(rel = "stylesheet", href = "/.perseus/static/styles/docs_links_markdown.css") link(rel = "stylesheet", href = "/.perseus/static/prism.css") - script(src = "/.perseus/static/prism.js") } })) }