Skip to content

Commit 1a6990c

Browse files
Add new rebuild section in about pages
1 parent c1135d1 commit 1a6990c

File tree

6 files changed

+33
-1
lines changed

6 files changed

+33
-1
lines changed

src/web/sitemap.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ about_page!(AboutPageMetadata, "core/about/metadata.html");
143143
about_page!(AboutPageRedirection, "core/about/redirections.html");
144144
about_page!(AboutPageDownload, "core/about/download.html");
145145
about_page!(AboutPageRustdocJson, "core/about/rustdoc-json.html");
146+
about_page!(AboutPageRebuild, "core/about/rebuild.html");
146147

147148
pub(crate) async fn about_handler(subpage: Option<Path<String>>) -> AxumResult<impl IntoResponse> {
148149
let subpage = match subpage {
@@ -175,6 +176,10 @@ pub(crate) async fn about_handler(subpage: Option<Path<String>>) -> AxumResult<i
175176
active_tab: "rustdoc-json",
176177
}
177178
.into_response(),
179+
"rebuild" => AboutPageRebuild {
180+
active_tab: "rebuild",
181+
}
182+
.into_response(),
178183
_ => {
179184
let msg = "This /about page does not exist. \
180185
Perhaps you are interested in <a href=\"https://github.com/rust-lang/docs.rs/tree/master/templates/core/about\">creating</a> it?";

static/trigger-rebuild.png

78.2 KB
Loading

templates/about-base.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ <h1 id="crate-title" class="no-description">Docs.rs documentation</h1>
1919
{% set text = "{} <span class='title'>Badges</span>"|format(text) %}
2020
{% call macros::active_link(expected="badges", href="/about/badges", text=text) %}
2121

22+
{% set text = crate::icons::IconRotateRight.render_solid(false, false, "") %}
23+
{% set text = "{} <span class='title'>Rebuild documentation</span>"|format(text) %}
24+
{% call macros::active_link(expected="rebuild", href="/about/rebuild", text=text) %}
25+
2226
{% set text = crate::icons::IconGears.render_solid(false, false, "") %}
2327
{% set text = "{} <span class='title'>Builds</span>"|format(text) %}
2428
{% call macros::active_link(expected="builds", href="/about/builds", text=text) %}

templates/core/about/builds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h4 id="hitting-resource-limits"> <a href="#hitting-resource-limits">Hitting res
108108

109109
<h4 id="failures-and-rebuilds"> <a href="#failures-and-rebuilds">Other failures and requesting rebuilds</a> </h4>
110110
<p>
111-
If your crate fails to build for a reason not listed here, please <a href="{{ docsrs_repo|safe }}/issues">file an issue</a>.
111+
If your crate fails to build for a reason not listed here, you can either try to <a href="/about/rebuild">rebuild it</a> or <a href="{{ docsrs_repo|safe }}/issues">file an issue</a>.
112112
Some build failures can be fixed by Docs.rs, e.g., by issuing a rebuild after a bug in Docs.rs has been fixed.
113113
</p>
114114

templates/core/about/rebuild.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% extends "about-base.html" %}
2+
3+
{%- block title -%} Rebuild {%- endblock title -%}
4+
5+
{%- block body -%}
6+
{%- set docsrs_repo = "https://github.com/rust-lang/docs.rs" -%}
7+
<h1>Rebuild</h1>
8+
<div class="about-page">
9+
<div class="container pure-u-5-6 about">
10+
<p>You can trigger a documentation rebuild for a specific version of your crates directly on <a href="https://crates.io">crates.io</a> website as you can see below:</p>
11+
12+
<img src="/-/static/trigger-rebuild.png" alt="crates.io dropdown menu showing two items: yank and rebuild docs">
13+
14+
<p>For more information on how documentation build works on <b>docs.rs</b>, take a look at the <a href="/about/builds">builds</a> page.</p>
15+
</div>
16+
<br/>
17+
</div>
18+
{%- endblock body %}

templates/style/style.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ pre {
208208
div.container {
209209
max-width: 1160px;
210210
text-align: left;
211+
212+
img {
213+
max-width: 100%;
214+
margin: 5px 0;
215+
}
211216
}
212217

213218
body.centered div.container {

0 commit comments

Comments
 (0)