about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-12-23 00:07:55 +0800
committerkennytm <kennytm@gmail.com>2018-12-23 02:12:16 +0800
commit4446c65d9b6971ec80684ef5c299ab56cb1d16d8 (patch)
tree0a353b0fcafe99f1f9632be02c4bbe6aa42b01f1 /src/libstd
parent5ba6a3438b990f7ede56491d77ee722651a6b3d7 (diff)
parent8dc8d7ac512b831705da9bf7ef4601fdc6adcb25 (diff)
downloadrust-4446c65d9b6971ec80684ef5c299ab56cb1d16d8.tar.gz
rust-4446c65d9b6971ec80684ef5c299ab56cb1d16d8.zip
Rollup merge of #57011 - QuietMisdreavus:static-root-path, r=GuillaumeGomez
rustdoc: add new CLI flag to load static files from a different location

This PR adds a new CLI flag to rustdoc, `--static-root-path`, which controls how rustdoc links pages to the CSS/JS/font static files bundled with the output. By default, these files are linked with a series of `../` which is calculated per-page to link it to the documentation root - i.e. a relative link to the directory given by `-o`. This is causing problems for docs.rs, because even though docs.rs has saved one copy of these files and is dispatching them dynamically, browsers have no way of knowing that these are the same files and can cache them. This can allow it to link these files as, for example, `/rustdoc.css` instead of `../../rustdoc.css`, creating a single location that the files are loaded from.

I made sure to only change links for the *static* files, those that don't change between crates. Files like the search index, aliases, the source files listing, etc, are still linked with relative links.

r? @GuillaumeGomez

cc @onur
Diffstat (limited to 'src/libstd')
0 files changed, 0 insertions, 0 deletions