Skip to content

Commit abe4fbc

Browse files
committed
Serve security page from /policies/security; /security redirects
1 parent 1283c54 commit abe4fbc

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

app/components/footer.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<h1>Policies</h1>
2424
<ul role="list">
2525
<li><LinkTo @route="policies">Usage Policy</LinkTo></li>
26-
<li><LinkTo @route="security">Security</LinkTo></li>
26+
<li><LinkTo @route="policies.security">Security</LinkTo></li>
2727
<li><a href="https://foundation.rust-lang.org/policies/privacy-policy/">Privacy Policy</a></li>
2828
<li><a href="https://www.rust-lang.org/policies/code-of-conduct">Code of Conduct</a></li>
2929
<li><LinkTo @route="data-access">Data Access</LinkTo></li>

app/router.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ Router.map(function () {
5151
});
5252
this.route('category-slugs', { path: 'category_slugs' });
5353
this.route('team', { path: '/teams/:team_id' });
54-
this.route('policies');
54+
this.route('policies', function () {
55+
this.route('security');
56+
});
57+
// The canonical security page is `/policies/security`; this is a redirect to support guessing
58+
// of the URL to be `/security`.
5559
this.route('security');
5660
this.route('data-access');
5761
this.route('confirm', { path: '/confirm/:email_token' });

app/routes/security.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Route from '@ember/routing/route';
2+
import { inject as service } from '@ember/service';
3+
4+
export default class SecurityRoute extends Route {
5+
@service router;
6+
7+
redirect() {
8+
this.router.replaceWith('policies.security');
9+
}
10+
}

app/templates/policies.hbs renamed to app/templates/policies/index.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102

103103
<h2 id='security'>Security</h2>
104104

105-
<p>Please see the <LinkTo @route="security">Security page</LinkTo>.</p>
105+
<p>Please see the <LinkTo @route="policies.security">Security page</LinkTo>.</p>
106106

107107
<h2 id='sexually-obscene-content'>Sexually Obscene Content</h2>
108108

File renamed without changes.

0 commit comments

Comments
 (0)