Skip to content

Commit f5227ef

Browse files
oddgrdseanmonstar
authored andcommitted
feat: use versions in guide urls
1 parent ad7b6b8 commit f5227ef

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ defaults:
2121

2222
collections:
2323
legacy:
24-
permalink: /:collection/:path/
24+
permalink: /guides/0.14/:path/
2525
output: true
2626
stable:
27-
permalink: /:collection/:path/
27+
permalink: /guides/1/:path/
2828
output: true
2929
posts:
3030
permalink: /blog/:year/:month/:day/:title/

_includes/guide_ul.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ <h4 class="guide-topic-title">{{ topic.title }}</h4>
44
<ul class="nav">
55
{% if page.collection == "legacy" %}
66
{% for guide in topic.guides %}
7-
{% assign guide_url = guide | prepend:"/" | prepend: topic.path | prepend:"/legacy" | append:"/" %}
7+
{% assign guide_url = guide | prepend:"/" | prepend: topic.path | prepend:"/guides/0.14" | append:"/" %}
88
{% assign p = site.legacy | where:"url", guide_url | first %}
99
<li {% if guide_url == page.url %}class="active"{% endif %}><a href="{{ p.url }}">{{ p.title }} </a></li>
1010
{% endfor %}
1111
{% elsif page.collection == "stable" %}
1212
{% for guide in topic.guides %}
13-
{% assign guide_url = guide | prepend:"/" | prepend: topic.path | prepend:"/stable" | append:"/" %}
13+
{% assign guide_url = guide | prepend:"/" | prepend: topic.path | prepend:"/guides/1" | append:"/" %}
1414
{% assign p = site.stable | where:"url", guide_url | first %}
1515
<li {% if guide_url == page.url %}class="active"{% endif %}><a href="{{ p.url }}">{{ p.title }} </a></li>
1616
{% endfor %}

_includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<li class="nav-item">
66
<a class="navbar-brand" href="/">hyper.rs</a>
77
</li>
8-
<li class="nav-item"><a class="nav-link" href="/stable">1.0 Guides</a></li>
9-
<li class="nav-item"><a class="nav-link" href="/legacy">0.14 Guides</a></li>
8+
<li class="nav-item"><a class="nav-link" href="/guides/1">1.0 Guides</a></li>
9+
<li class="nav-item"><a class="nav-link" href="/guides/0.14">0.14 Guides</a></li>
1010
<li class="nav-item"><a class="nav-link" href="https://github.com/hyperium/hyper">Source</a></li>
1111
</ul>
1212
</div>

_layouts/home.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="container">
1010
<h1 class="hyper-logo">hyper</h1>
1111
<p>Fast and safe HTTP for the Rust language.</p>
12-
<p><a href="/stable" class="btn hyper-getstarted">Get Started</a></p>
12+
<p><a href="/guides/1" class="btn hyper-getstarted">Get Started</a></p>
1313
</div>
1414
</section>
1515
<section class="container">
@@ -18,7 +18,7 @@ <h1 class="hyper-logo">hyper</h1>
1818
<p class="lead">
1919
<b>Note:</b> hyper is planning a stable <code>1.0</code> release at the end of January 2023.
2020
These guides will be gradually transitioned to <code>1.0</code>, but if you're looking for
21-
guides for <code>0.14</code> you can find them <a href="/legacy">here</a>. If you'd like to
21+
guides for <code>0.14</code> you can find them <a href="/guides/0.14">here</a>. If you'd like to
2222
learn more about the move to <code>1.0</code>,
2323
<a href="https://seanmonstar.com/post/680802159018803200/hyper-10-roadmap">this</a> is a good place to start.
2424
</p>

_legacy/client/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Client Guides
3-
permalink: /legacy/client/
3+
permalink: /0.14/client
44
---
55

66
This is just placeholder page. It should probably become a table of

_legacy/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Getting Started
33
layout: guide
4-
permalink: /legacy/
4+
permalink: /guides/0.14/
55
---
66

77
hyper is an HTTP library for the Rust language.

_legacy/server/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Server Guides
3-
permalink: /legacy/server/
3+
permalink: /0.14/server
44
---
55

66
This is just placeholder page. It should probably become a table of

_stable/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: Getting Started
33
layout: guide
4-
permalink: /stable/
4+
permalink: /guides/1/
55
---
66

77
***Note:** these guides are for the upcoming version `1.0` of hyper,
8-
click [here](/legacy) to see the `0.14` guides.*
8+
click [here](/guides/0.14) to see the `0.14` guides.*
99

1010
hyper is an HTTP library for the Rust language.
1111

_stable/server/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Server Guides
3-
permalink: /stable/server/
3+
permalink: /1/server/
44
---
55

66
This is just placeholder page. It should probably become a table of

0 commit comments

Comments
 (0)