Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Configure GitHub Pages
id: pages
uses: actions/configure-pages@v5

- name: Install dependencies
run: npm ci

- name: Build site
run: BASE_PATH="${{ steps.pages.outputs.base_path }}" npm run build

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./dist

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
node_modules
playwright-report
test-results
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ schema/ ← Configuration — structure, conventions, workflows
| **Query** | Search wiki → synthesize answer with citations → optionally write back as new page |
| **Lint** | Check contradictions, orphans, stale claims, missing cross-refs, data gaps |

## Frontend

The repository now includes a static frontend build for GitHub Pages.

- `npm install`
- `npm run build` to generate `dist/`
- `npm run preview` to serve the generated site locally at `http://127.0.0.1:4173`
- `npm run test:e2e` to run the Playwright smoke test against the local preview server
- `.github/workflows/deploy-pages.yml` deploys `dist/` from `main`

Architecture notes, inspiration references, and content assumptions live in [docs/frontend.md](docs/frontend.md).

## Why this works

> "Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored."
Expand Down
49 changes: 49 additions & 0 deletions docs/frontend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Frontend Architecture

The rara-wiki frontend is a small static generator rather than a full framework app.

## Why this direction

- The repository is markdown-first and already has a clean content split: `wiki/`, `raw/`, `schema/`, and `README.md`.
- GitHub Pages prefers a deterministic static output with low operational overhead.
- A custom Node build keeps the implementation transparent: the rendering rules for frontmatter, wikilinks, backlinks, source references, and collection pages all live in one build pipeline.

## Reference projects

These projects informed the direction, but rara-wiki intentionally keeps a narrower implementation surface:

- [Quartz](https://github.com/jackyzha0/quartz): markdown-native digital garden with strong graph, backlink, and wiki-link conventions.
- [Obsidian Digital Garden](https://github.com/oleeskild/obsidian-digital-garden): public publishing pattern for a markdown knowledge base with lightweight page metadata and navigation.
- [Jekyll Garden](https://github.com/Jekyll-Garden/jekyll-garden.github.io): an Obsidian-to-site presentation style that makes note networks browseable on static hosting.
- [Dendron](https://github.com/dendronhq/dendron): schema-aware knowledge base design, especially around backlinks, hierarchy, and refactor-safe linking.

## What the build generates

- A home page from `README.md`
- Page routes for every markdown file under `wiki/`, `raw/`, and `schema/`
- Collection indexes for wiki pages, raw sources, schema docs, and tags
- Client-side search via a generated JSON index
- Backlinks computed from `[[wikilinks]]`
- Frontmatter surfaces for tags, sources, date, and status
- Base-path-safe asset and page URLs for GitHub Pages project deployments

## Key files

- `scripts/build.mjs`: content ingestion, link resolution, HTML generation, search index generation
- `scripts/preview.mjs`: simple local static preview server
- `site/site.css`: layout, theming, responsive design, and typography
- `site/site.js`: theme toggle and client-side search
- `tests/wiki.spec.js`: Playwright smoke coverage for search, wikilinks, backlinks, and theme persistence
- `.github/workflows/deploy-pages.yml`: build and deployment workflow for GitHub Pages

## Content assumptions

- Wiki links are written as `[[page-name]]` or `[[path/to/page]]`
- Tags come from frontmatter
- Source links in frontmatter can be URLs or paths to markdown pages inside the repo
- `wiki/log.md` acts as the recent updates stream surfaced in the UI

## Verification

- `npm run build` verifies the static site generator output
- `npm run test:e2e` runs a browser smoke test with Playwright against the preview server
Loading