Add a page title to every page.
The page_title
helper pushes the provided string at the end of the title, but because of the order that layouts are rendered in by ActionView, the result is always this:
<title from view> |
<title from as specified in the controller or by its layout> |
<title from layouts/_head>
For example: Merge Requests | GitLab.org / Gitlab Community Edition | GitLab
.
All a developer needs to know is to put a page_title
call describing the page in question at the start of every template.
To get everything where I wanted it to go without too much duplication, I had to make some changes around layouts, sidebars and controllers.
Merge request reports
Activity
218 "Merge request ##{@merge_request.iid} - " + title 219 else 220 "Merge requests - " + title 221 end 222 elsif current_controller?(:wikis) 223 "Wiki - " + title 224 elsif current_controller?(:network) 225 "Network graph - " + title 226 elsif current_controller?(:graphs) 227 "Graphs - " + title 228 else 229 title 230 end 231 232 title 233 end Added 1 commit:
- 280a2124 - Fix Profiles::PasswordsController.
Added 1 commit:
- f7239683 - Include commit message in page title.
Added 1 commit:
- 9508bdc0 - Include ref in network page title.
Added 1 commit:
- 6fcdd150 - Capitalize "Git Access" in page title.
Added 1 commit:
- 0a63c1d2 - Have tree page title read "Files" for root.
Reassigned to @dzaporozhets
@dzaporozhets A speedy review would be appreciated, because if it waits too long, this MR is bound to get into conflicts :)
Reassigned to @DouweM
Added 1 commit:
- 92fd3cce - Add helpers for header title and sidebar, and move setting those from controllers to layouts.
Added 1 commit:
- a2eee318 - Fix title on user page.
Reassigned to @dzaporozhets