diff --git a/src/utils/html.rs b/src/utils/html.rs index 77d101002..b03ac3f2d 100644 --- a/src/utils/html.rs +++ b/src/utils/html.rs @@ -20,6 +20,7 @@ pub(crate) fn rewrite_lol( let templates = templates.templates.load(); let tera_head = templates.render("rustdoc/head.html", &ctx).unwrap(); let tera_body = templates.render("rustdoc/body.html", &ctx).unwrap(); + let tera_rustdoc_header = templates.render("rustdoc/header.html", &ctx).unwrap(); let head_handler = |head: &mut Element| { head.append(&tera_head, ContentType::Html); @@ -51,8 +52,11 @@ pub(crate) fn rewrite_lol( rustdoc_body_class.set_tag_name("div")?; // Prepend the tera content rustdoc_body_class.prepend(&tera_body, ContentType::Html); - // Now, make this a full
tag + // Wrap the tranformed body and rustdoc header into a element rustdoc_body_class.before("", ContentType::Html); + // Insert the header outside of the rustdoc div + rustdoc_body_class.before(&tera_rustdoc_header, ContentType::Html); + // Finalize body with rustdoc_body_class.after("", ContentType::Html); Ok(()) diff --git a/templates/rustdoc/body.html b/templates/rustdoc/body.html index df6af7910..f9a2beb8f 100644 --- a/templates/rustdoc/body.html +++ b/templates/rustdoc/body.html @@ -1,241 +1,3 @@ -{%- import "macros.html" as macros -%} - -{# The url of the current release, `/crate/:name/:version` #} -{%- set crate_url = "/crate/" ~ krate.name ~ "/" ~ krate.version -%} - - -