Skip to content

Commit ec7684f

Browse files
committed
feat: BrowserRoute
1 parent 345b869 commit ec7684f

File tree

59 files changed

+6889
-471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6889
-471
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,20 @@ npm start
5353
```
5454
This will open the site at http://localhost:3000.
5555

56-
### 4. Shipping it to the world
57-
To put the site online (GitHub Pages):
56+
## Routing and SEO
57+
58+
This project uses `BrowserRouter` for clean URLs (e.g., `/apps/markdown-table-formatter`) instead of hash-based URLs (`/#/apps/...`).
59+
60+
To support this on GitHub Pages (which is a static file host), we use `react-snap` to pre-render all routes into static HTML files during the build process.
61+
62+
- **Pre-rendering:** `react-snap` crawls the application and generates a directory structure that matches the routes (e.g., `build/apps/markdown-table-formatter/index.html`). This allows GitHub Pages to serve the correct file for each route directly.
63+
- **SEO:** This approach ensures that every page has unique, server-side rendered metadata (title, description, open graph tags) for social media previews and search engines.
64+
- **Fallback:** A `404.html` is generated to handle unknown routes.
65+
66+
### Deployment
67+
68+
The standard `npm run deploy` command handles the build, pre-rendering, and deployment to GitHub Pages automatically.
69+
5870
```bash
5971
npm run deploy
6072
```

0 commit comments

Comments
 (0)