Skip to content

Add titles to crate pages #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2014
Merged

Conversation

pimterry
Copy link
Contributor

@pimterry pimterry commented Dec 3, 2014

This adds configurable titles to pages, with just the individual crate page configured for now, to fix #33 and #82.

This is using the https://github.com/paddle8/ember-document-title mixin, which builds titles breadcrumb style, accumulating them up the route hierarchy, for each route that has a 'title' property. I've set the application route title to 'Cargo', and the crate route title to be the crate name itself.

End result: the crate page now has a title of 'cratename - Cargo', e.g. 'gcc - Cargo', and every other page has 'Cargo' as its title (as previously). If you add a title property on any other route, its name will be 'titlepropertyvalue - Cargo'. If you have a route B nested within a route A, with title properties set to 'B' and 'A' respectively, the title of page B will be 'B - A - Cargo'. If you only set B, but not A, it'll be 'B - Cargo'.

This is a good start on this, it'd probably be good to fill out a bunch of other titles for each route, but that can be done adhoc (or not, and this is still a useful improvement I think).

@alexcrichton
Copy link
Member

This... looks awesome! Thanks so much @pimterry!

alexcrichton added a commit that referenced this pull request Dec 4, 2014
@alexcrichton alexcrichton merged commit a32c5b3 into rust-lang:master Dec 4, 2014
@pimterry pimterry deleted the add-titles branch December 4, 2014 09:38
Turbo87 pushed a commit to Turbo87/crates.io that referenced this pull request Jan 4, 2023
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust page title to reflect contents
2 participants