Skip to content

Commit ea31423

Browse files
oddgrdseanmonstar
authored andcommitted
feat: rename old guides to legacy
1 parent 3bf482c commit ea31423

File tree

10 files changed

+16
-15
lines changed

10 files changed

+16
-15
lines changed

.github/workflows/check_guides.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/sh
22

3-
for value in guides stable
3+
for value in legacy stable
44
do
55
if [ ! -e "$value/Cargo.toml" ]; then
66
if [ ! -d $value ]; then
77
cargo new $value
88
else
99
cargo init $value
1010
fi
11-
if [ $value = guides ]; then
11+
if [ $value = legacy ]; then
1212
cat >> "$value/Cargo.toml" <<-EOF
1313
futures = "0.3"
1414
hyper = { version = "0.14", features = ["full"] }

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Gemfile*
22
_site*
33
.sass-cache
4-
/guides
4+
/legacy
55
/stable

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ url: "https://hyper.rs" # the base hostname & protocol for your site
66
defaults:
77
-
88
scope:
9-
path: "_guides/"
9+
path: "_legacy/"
1010
type: "guides"
1111
values:
1212
layout: "guide"
@@ -20,7 +20,7 @@ defaults:
2020

2121

2222
collections:
23-
guides:
23+
legacy:
2424
permalink: /:collection/:path/
2525
output: true
2626
stable:
File renamed without changes.

_guides/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: /guides/client/
3+
permalink: /legacy/client/
44
---
55

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

_guides/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: /guides/
4+
permalink: /legacy/
55
---
66

77
hyper is an HTTP library for the Rust language.

_guides/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: /guides/server/
3+
permalink: /legacy/server/
44
---
55

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

_includes/guide_ul.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<section class="guide-topic">
33
<h4 class="guide-topic-title">{{ topic.title }}</h4>
44
<ul class="nav">
5-
{% if page.collection == "guides" %}
5+
{% if page.collection == "legacy" %}
66
{% for guide in topic.guides %}
7-
{% assign guide_url = guide | prepend:"/" | prepend: topic.path | prepend:"/guides" | append:"/" %}
8-
{% assign p = site.guides | where:"url", guide_url | first %}
7+
{% assign guide_url = guide | prepend:"/" | prepend: topic.path | prepend:"/legacy" | append:"/" %}
8+
{% 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" %}

_includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<a class="navbar-brand" href="/">hyper.rs</a>
77
</li>
88
<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="/guides">0.14 Guides</a></li>
9+
<li class="nav-item"><a class="nav-link" href="/legacy">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/guide.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ <h1>{{ page.title }}</h1>
1414
<div class="row">
1515
<aside class="col-md-3 hyper-sidebar">
1616
<nav>
17-
{% if page.collection == "guides" %}
18-
{% assign topics = site.data.guides | first %}
17+
{{page.collection | jsonify }}
18+
{% if page.collection == "legacy" %}
19+
{% assign topics = site.data.legacy | first %}
1920
{% for guides in topics.guides %}
2021
{% assign topic_sub_url = guides | prepend:"/" %}
21-
{% assign topic = site.data.guides | where: "path", topic_sub_url | first %}
22+
{% assign topic = site.data.legacy | where: "path", topic_sub_url | first %}
2223
{% include guide_ul.html topic=topic %}
2324
{% endfor %}
2425
{% elsif page.collection == "stable" %}

0 commit comments

Comments
 (0)