diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 5c957e4a379a4..00b46b1ba918b 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -74,30 +74,26 @@ {{- layout.external_html.before_content | safe -}} {#- -#} ☰ {#- -#} - {#- -#} - {#- -#} - {#- -#} - {#- -#} + {#- -#} + {#- -#} + {%- if layout.logo -%} + {#- -#} + {%- else -%} + {#- -#} + {%- endif -%} + {#- -#} {{- sidebar | safe -}} {#- -#} {#- -#} {#- -#} {#- -#} - {#- -#} - {#- -#} + {#- -#} + {%- if layout.logo -%} + + {%- else -%} + + {%- endif -%} {#- -#} {#- -#} {#- -#} diff --git a/src/test/rustdoc/logo-class-default.rs b/src/test/rustdoc/logo-class-default.rs new file mode 100644 index 0000000000000..a7016d227b158 --- /dev/null +++ b/src/test/rustdoc/logo-class-default.rs @@ -0,0 +1,4 @@ +// Note: this test is paired with logo-class.rs. +// @has logo_class_default/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' +// @has logo_class_default/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' '' +pub struct SomeStruct; diff --git a/src/test/rustdoc/logo-class.rs b/src/test/rustdoc/logo-class.rs new file mode 100644 index 0000000000000..f071f356a6d38 --- /dev/null +++ b/src/test/rustdoc/logo-class.rs @@ -0,0 +1,10 @@ +#![doc(html_logo_url = + "https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png")] +// Note: this test is paired with logo-class-default.rs. + +// @has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' '' +// @!has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' '' +// +// @has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' '' +// @!has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' '' +pub struct SomeStruct;