This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-02-10
|
||||
40
openspec/changes/archive/2026-02-10-fix-sub-pages/design.md
Normal file
40
openspec/changes/archive/2026-02-10-fix-sub-pages/design.md
Normal file
@@ -0,0 +1,40 @@
|
||||
## Context
|
||||
|
||||
The site is statically generated (Astro) and deployed behind nginx in Docker. Users can browse to `/videos`, `/podcast`, and `/about`, but direct navigation to these paths is currently resulting in a 404 in the deployed environment.
|
||||
|
||||
The static output contains directory-based pages (`/videos/index.html`, `/podcast/index.html`, `/about/index.html`). Some nginx configurations resolve directory indexes only for requests ending with `/` (e.g., `/videos/`) and may 404 for the no-trailing-slash path (`/videos`) unless explicitly handled.
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
- Ensure `/videos`, `/podcast`, and `/about` resolve successfully (200) in the nginx/Docker deployment.
|
||||
- Ensure requests to both the trailing slash and non-trailing slash forms work predictably.
|
||||
- Keep behavior consistent with the SEO spec (indexable pages remain distinct; no SPA-style fallback masking real 404s).
|
||||
|
||||
**Non-Goals:**
|
||||
- Changing site IA or page content.
|
||||
- Introducing a client-side router fallback (SPA rewrite) that would hide missing pages.
|
||||
|
||||
## Decisions
|
||||
|
||||
### 1) Fix nginx static routing for directory index pages
|
||||
|
||||
**Decision:** Update nginx `try_files` to include `$uri/index.html` so requests like `/videos` resolve to `/videos/index.html` when present.
|
||||
|
||||
**Rationale:** This explicitly supports directory index pages without requiring a redirect, and prevents the common 404 case when the request does not include a trailing slash.
|
||||
|
||||
**Alternatives considered:**
|
||||
- Redirect `/videos` -> `/videos/`: acceptable, but adds an extra hop and needs per-route rules or more complex logic.
|
||||
- Rewrite all unknown paths to `/index.html`: not acceptable; would mask real 404s and break the semantics of distinct indexable pages.
|
||||
|
||||
### 2) Add a small verification step as part of deployment
|
||||
|
||||
**Decision:** Validate the deployed container serves `/videos`, `/podcast`, and `/about` as 200 in addition to verifying the build output includes the expected `index.html` files.
|
||||
|
||||
**Rationale:** This catches config regressions and ensures the fix applies to the real serving stack.
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- [Path collisions] -> Using `$uri/index.html` could cause unexpected resolution if both a file and a directory exist. Mitigation: keep route structure simple and prefer one form.
|
||||
- [Platform differences] -> Non-nginx deployments might still behave differently. Mitigation: document that the Docker/nginx deploy is canonical and ensure other hosts use equivalent rules.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
## Why
|
||||
|
||||
Users navigating to `/videos`, `/podcast`, and `/about` are landing on a 404, which breaks core site navigation and discovery. Fixing this restores expected browsing and improves user experience.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Fix routing/serving so `/videos`, `/podcast`, and `/about` resolve to the actual generated pages instead of a 404.
|
||||
- Ensure the fix applies in the deployed static hosting setup (nginx/Docker) and matches local expectations.
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
<!-- None (bug fix only) -->
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
- `seo-content-surface`: Ensure indexable pages `/videos`, `/podcast`, and `/about` resolve correctly in deployed static serving environments (including requests without a trailing slash).
|
||||
|
||||
## Impact
|
||||
|
||||
- Static server configuration (nginx) and/or build output serving behavior.
|
||||
- Improves navigation reliability and reduces drop-off from broken links.
|
||||
@@ -0,0 +1,25 @@
|
||||
## MODIFIED Requirements
|
||||
|
||||
### Requirement: Indexable pages
|
||||
The site MUST provide indexable HTML pages for:
|
||||
- home (`/`)
|
||||
- videos (`/videos`)
|
||||
- podcast (`/podcast`)
|
||||
- about (`/about`)
|
||||
|
||||
These pages MUST be server-rendered or statically generated HTML suitable for search engine crawling (not client-rendered only).
|
||||
|
||||
The deployed static server MUST serve these pages successfully for both trailing-slash and non-trailing-slash requests when a directory-based `index.html` exists (for example, `/videos` and `/videos/` MUST both resolve to the videos page).
|
||||
|
||||
#### Scenario: Crawling the home page
|
||||
- **WHEN** a crawler requests `/`
|
||||
- **THEN** the server returns an HTML document containing the homepage content modules and metadata
|
||||
|
||||
#### Scenario: Direct request without trailing slash
|
||||
- **WHEN** a user requests `/videos` (no trailing slash)
|
||||
- **THEN** the server returns the videos page HTML and does not respond with 404
|
||||
|
||||
#### Scenario: Direct request with trailing slash
|
||||
- **WHEN** a user requests `/videos/` (with trailing slash)
|
||||
- **THEN** the server returns the videos page HTML and does not respond with 404
|
||||
|
||||
14
openspec/changes/archive/2026-02-10-fix-sub-pages/tasks.md
Normal file
14
openspec/changes/archive/2026-02-10-fix-sub-pages/tasks.md
Normal file
@@ -0,0 +1,14 @@
|
||||
## 1. Reproduce And Diagnose
|
||||
|
||||
- [x] 1.1 Reproduce the 404 for `/videos`, `/podcast`, and `/about` in the deployed nginx/Docker setup
|
||||
- [x] 1.2 Confirm the build output includes `site/dist/videos/index.html`, `site/dist/podcast/index.html`, and `site/dist/about/index.html`
|
||||
|
||||
## 2. Fix Static Serving
|
||||
|
||||
- [x] 2.1 Update nginx config to serve directory index pages for non-trailing-slash requests (e.g., add `$uri/index.html` to `try_files`)
|
||||
- [x] 2.2 Rebuild the Docker image and restart the container
|
||||
|
||||
## 3. Verify
|
||||
|
||||
- [x] 3.1 Verify `/videos`, `/podcast`, and `/about` return 200 (both with and without trailing slash)
|
||||
- [x] 3.2 Verify the fix does not mask real 404s for unknown paths
|
||||
Reference in New Issue
Block a user