Skip to content

feat: Add clean URL router for docs site#21

Merged
JoshuaWink merged 7 commits intomainfrom
clean-url-router
Sep 7, 2025
Merged

feat: Add clean URL router for docs site#21
JoshuaWink merged 7 commits intomainfrom
clean-url-router

Conversation

@JoshuaWink
Copy link
Copy Markdown
Contributor

This PR implements a clean URL router for the CodeUChain documentation site using GitHub Pages' 404.html routing mechanism.

Changes Made

  • docs/404.html: Added comprehensive client-side router that handles clean URLs for all language documentation pages
  • docs/index.html: Updated navigation links to use clean URLs
  • docs/go/index.html: Updated navigation links to use clean URLs
  • docs/router-test.html: Added test suite to verify router functionality

Features

  • Clean URLs without .html extensions (e.g., /go, /python, /javascript)
  • Support for section anchors (#concepts, #benefits, etc.)
  • Query parameter preservation
  • Language-specific routing with aliases
  • Comprehensive route mapping for all supported languages
  • Fallback handling for unknown routes

Testing

The router has been tested with:

  • All main language routes (/go, /python, /javascript, etc.)
  • Section anchor navigation
  • Query parameter handling
  • Invalid route fallback

This makes the documentation site appear more dynamic and professional while maintaining static hosting benefits.

- Add 404.html router that handles clean URLs without index.html
- Update navigation links to use clean URLs (e.g., /docs/go instead of /docs/go/index.html)
- Support all language routes with aliases (c#, c++, js, etc.)
- Handle section anchors and sub-routes
- Preserve query parameters and hash fragments
- Add comprehensive router test suite
- Update main index.html and go/index.html with clean URLs
@JoshuaWink JoshuaWink self-assigned this Sep 7, 2025
- Fix async/await handling in build.js for proper template processing
- Update json-reader.js to async RuntimeJSONReader with caching
- Add 'is_homepage': false to all language data files for proper conditional logic
- Fix language-navigation.html template variables (relative paths, highlighting, conditionals)
- Ensure all template variables are properly replaced in generated HTML pages
- Verify build process works correctly for all 11 pages (main + 10 languages)
@JoshuaWink JoshuaWink merged commit f606191 into main Sep 7, 2025
@JoshuaWink JoshuaWink deleted the clean-url-router branch September 7, 2025 18:05
JoshuaWink added a commit that referenced this pull request Jan 19, 2026
* codeuchain site + buf-json demo

* rm buf-json and sent to github,com/orchestrate-solutions/buf-json

* feat: Add clean URL router for docs site

- Add 404.html router that handles clean URLs without index.html
- Update navigation links to use clean URLs (e.g., /docs/go instead of /docs/go/index.html)
- Support all language routes with aliases (c#, c++, js, etc.)
- Handle section anchors and sub-routes
- Preserve query parameters and hash fragments
- Add comprehensive router test suite
- Update main index.html and go/index.html with clean URLs

* fix: Add missing json-reader.js and rebuild HTML pages

* Fix logo links for clean URL routing - update base.json to use '../' instead of '../index.html'

* fix: Resolve codeuchain.com routing build issues with template variables

- Fix async/await handling in build.js for proper template processing
- Update json-reader.js to async RuntimeJSONReader with caching
- Add 'is_homepage': false to all language data files for proper conditional logic
- Fix language-navigation.html template variables (relative paths, highlighting, conditionals)
- Ensure all template variables are properly replaced in generated HTML pages
- Verify build process works correctly for all 11 pages (main + 10 languages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant