Skip to content

Commit

Permalink
Rollup merge of #93418 - ojeda:no-shortcut, r=camelid
Browse files Browse the repository at this point in the history
rustdoc & doc: no `shortcut` for `rel="icon"`

According to https://html.spec.whatwg.org/multipage/links.html#rel-icon:

> For historical reasons, the `icon` keyword may be preceded by the keyword "`shortcut`".

And to https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types:

> **Warning:** The `shortcut` link type is often seen before `icon`, but this link type is non-conforming, ignored and **web authors must not use it anymore.**

While it was removed from the Rust logo case a while ago in commit 085679c ("Use theme-adaptive SVG favicon from other Rust sites"), it is still there for the custom logo case.

Also updated a few other instances.

Signed-off-by: Miguel Ojeda <[email protected]>
  • Loading branch information
Dylan-DPC authored Mar 4, 2022
2 parents 4c70200 + 30685ed commit c695de0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/doc/favicon.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
<link rel="icon" href="https://www.rust-lang.org/favicon.ico">
2 changes: 1 addition & 1 deletion src/doc/redirect.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<meta name="robots" content="noindex,follow">
<link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico">
<link rel="icon" href="https://www.rust-lang.org/favicon.ico">
2 changes: 1 addition & 1 deletion src/doc/rustdoc/src/the-doc-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This form of the `doc` attribute lets you control the favicon of your docs.
#![doc(html_favicon_url = "https://example.com/favicon.ico")]
```

This will put `<link rel="shortcut icon" href="{}">` into your docs, where
This will put `<link rel="icon" href="{}">` into your docs, where
the string for the attribute goes into the `{}`.

If you don't use this attribute, there will be no favicon.
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
href="{{static_root_path|safe}}theme{{page.resource_suffix}}.css"> {#- -#}
{%- endif -%}
{%- if !layout.favicon.is_empty() -%}
<link rel="shortcut icon" href="{{layout.favicon}}"> {#- -#}
<link rel="icon" href="{{layout.favicon}}"> {#- -#}
{%- else -%}
<link rel="alternate icon" type="image/png" {# -#}
href="{{static_root_path|safe}}favicon-16x16{{page.resource_suffix}}.png"> {#- -#}
Expand Down

0 comments on commit c695de0

Please sign in to comment.