Skip to content

Commit 328a3f8

Browse files
committed
add routing intro
1 parent 08d658f commit 328a3f8

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

docs/develop/introduction.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,25 @@ pagination_next: null
6161
<span class="hub-card__cta">Open guide</span>
6262
</a>
6363
</li>
64+
<li class="hub-card">
65+
<a class="hub-card__link" href="/docs/develop/manifests">
66+
<h3 class="hub-card__title">Manifests</h3>
67+
<p class="hub-card__desc">
68+
Learn about how manifests enable a virtual "file system" on Swarm, and how to manipulate the manifest to re-write virtual paths to add, remove, or move content.
69+
</p>
70+
<span class="hub-card__cta">Open Guide</span>
71+
</a>
72+
</li>
73+
<li class="hub-card">
74+
<a class="hub-card__link" href="/docs/develop/routing">
75+
<h3 class="hub-card__title">Routing</h3>
76+
<p class="hub-card__desc">
77+
Learn about routing on Swarm and the various options at your disposal for approaching website routing.
78+
</p>
79+
<span class="hub-card__cta">Open Guide</span>
80+
</a>
81+
</li>
82+
<!--
6483
<li class="hub-card">
6584
<a class="hub-card__link" href="/docs/develop/dynamic-content">
6685
<h3 class="hub-card__title">Dynamic Content</h3>
@@ -71,7 +90,6 @@ pagination_next: null
7190
<span class="hub-card__cta">Open guide</span>
7291
</a>
7392
</li>
74-
<!--
7593
<li class="hub-card">
7694
<a class="hub-card__link" href="/docs/develop/act">
7795
<h3 class="hub-card__title">Add Access Control</h3>

docs/develop/routing.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ id: routing
66
import Tabs from '@theme/Tabs';
77
import TabItem from '@theme/TabItem';
88

9-
Add intro and transition, mention different types of routing and strengths and weaknesses.
10-
-----------------
9+
10+
Swarm's serverless architecture obviously doesn't support server-side routing, but there are several alternative approaches which work well for different circumstances: hash-based client-side routing, manifest-based clean URLs, or directory-style routing (also requires manifest manipulation). Each comes with its own trade-offs in simplicity, flexibility, and URL aesthetics. Here’s the quick overview before we dive into the details.
11+
12+
| Routing Type | How It Works | Pros | Cons |
13+
| --------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------ |
14+
| **Hash Routing** | Routes live after `/#/` and are handled entirely in the browser | Easiest to implement, zero manifest edits, highly reliable | URLs use `/#/`, not the cleanest visually |
15+
| **Manifest Clean URLs** | Add aliases or rewrite paths directly in the manifest | Real clean URLs like `/about`, flexible control | Requires manual manifest manipulation |
16+
| **Directory-Style Routing** | Use folder structures with `index.html` | Clean URLs with familiar static-site patterns | More structure in your build, still needs manifest awareness |
17+
18+
Now let’s look at each method, starting with the simplest and most Swarm-friendly option: hash-based client-side routing.
19+
1120

1221
## Client-Side Hash Routing
1322

@@ -298,7 +307,7 @@ You now have:
298307

299308
## Website Routing
300309

301-
#### 1. Upload the Site (and Observe Basic Behavior)
310+
#### 1. Upload the Site
302311

303312
Start by uploading the site:
304313

sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = {
9292
'develop/host-your-website',
9393
'develop/manifests',
9494
'develop/routing',
95-
'develop/dynamic-content',
95+
// 'develop/dynamic-content',
9696
'develop/act',
9797
],
9898
collapsed: false

0 commit comments

Comments
 (0)