From ee791d8e4ae040346e8a6437d8f70cf7b78ffea5 Mon Sep 17 00:00:00 2001 From: Dinesh Pandiyan Date: Tue, 13 Oct 2026 23:55:35 +1100 Subject: [PATCH] docs: add Hugo and Hextra website --- docs-website/.gitignore | 3 ++ docs-website/README.md | 40 +++++++++++++++++++++++ docs-website/content/_index.md | 17 ++++++++++ docs-website/content/getting-started.md | 42 +++++++++++++++++++++++++ docs-website/go.mod | 5 +++ docs-website/go.sum | 2 ++ docs-website/hugo.yaml | 39 +++++++++++++++++++++++ docs-website/package.json | 9 ++++++ mise.toml | 13 ++++++++ pnpm-lock.yaml | 2 ++ pnpm-workspace.yaml | 1 + 11 files changed, 173 insertions(+) create mode 100644 docs-website/.gitignore create mode 100644 docs-website/README.md create mode 100644 docs-website/content/_index.md create mode 100644 docs-website/content/getting-started.md create mode 100644 docs-website/go.mod create mode 100644 docs-website/go.sum create mode 100644 docs-website/hugo.yaml create mode 100644 docs-website/package.json diff --git a/docs-website/.gitignore b/docs-website/.gitignore new file mode 100644 index 00000000..4c47d390 --- /dev/null +++ b/docs-website/.gitignore @@ -0,0 +1,3 @@ +/dist/ +/resources/ +/.hugo_build.lock diff --git a/docs-website/README.md b/docs-website/README.md new file mode 100644 index 00000000..3354176d --- /dev/null +++ b/docs-website/README.md @@ -0,0 +1,40 @@ +# Docs website + +Public user documentation built with Hugo and Hextra. Independent of the +application; existing `docs/` remains code and contributor documentation. + +## Run locally + +From the repository root, with mise installed and the project trusted: + +```sh +mise run docs:dev +``` + +Open . Changes reload automatically; stop with `Ctrl+C`. +Mise installs the pinned Hugo extended binary when needed. The theme is pinned +in this directory's `go.mod` and `go.sum`; its first download needs network access. +The website needs Go and Git for Hugo modules, with no Node dependencies. + +## Build + +```sh +mise run docs:build +``` + +Static HTML and assets go to `docs-website/dist/` (gitignored). Build warnings +fail the command. `mise run docs:check` runs the same validation. + +The pnpm workspace also exposes `pnpm --filter @diffx/docs dev`, `build`, and +`check` through mise. Application builds remain independent. + +## Edit + +- Homepage: `content/_index.md`. +- Guides: Markdown files in `content/`; use `weight` to order the sidebar. +- Screenshots and other assets: add files under `static/`, then reference them + with paths such as `/images/review.png`. +- Site configuration: `hugo.yaml`. + +Use Hextra's built-in docs layout, search, code blocks, and theme toggle. Keep +pages brief; no custom layout or deployment setup yet. diff --git a/docs-website/content/_index.md b/docs-website/content/_index.md new file mode 100644 index 00000000..d71c06c6 --- /dev/null +++ b/docs-website/content/_index.md @@ -0,0 +1,17 @@ +--- +title: diffx documentation +type: docs +--- + +Review Git changes in your browser with diffx. Read diffs, mark files reviewed, +and leave comments without changing your working tree or index. + +## Start here + +[Get started](getting-started/) with installation and your first local review. + +## Your review workflow + +- Compare branch changes, staged changes, and unstaged changes. +- Review a captured snapshot at your own pace. +- Keep comments and review progress across restarts. diff --git a/docs-website/content/getting-started.md b/docs-website/content/getting-started.md new file mode 100644 index 00000000..9c9f5b7b --- /dev/null +++ b/docs-website/content/getting-started.md @@ -0,0 +1,42 @@ +--- +title: Getting started +description: Install diffx and open your first local review. +weight: 1 +--- + +## Install + +With Homebrew: + +```sh +brew install flexdinesh/tap/diffx +``` + +Or with Go 1.25 or later: + +```sh +go install github.com/flexdinesh/diffx/cmd/diffx@latest +``` + +## Open a review + +From your Git repository, run: + +```sh +diffx +``` + +Your browser opens the captured changes. Use the file list to navigate, switch +between all, staged, and unstaged changes, and add comments as you review. + +To review another repository: + +```sh +diffx /path/to/repo +``` + +## Capture new changes + +A review is a fixed snapshot. After editing your code, stop diffx with `Ctrl+C` +and run it again to capture the latest changes. Comments and review progress +persist across restarts. diff --git a/docs-website/go.mod b/docs-website/go.mod new file mode 100644 index 00000000..9ad1c283 --- /dev/null +++ b/docs-website/go.mod @@ -0,0 +1,5 @@ +module github.com/flexdinesh/diffx/docs-website + +go 1.25.0 + +require github.com/imfing/hextra v0.13.0 // indirect diff --git a/docs-website/go.sum b/docs-website/go.sum new file mode 100644 index 00000000..6557292b --- /dev/null +++ b/docs-website/go.sum @@ -0,0 +1,2 @@ +github.com/imfing/hextra v0.13.0 h1:1zhCYy0tA9ZRErFBlU6NJEgR1HjK69bgd52EmpwnG00= +github.com/imfing/hextra v0.13.0/go.mod h1:vi+yhpq8YPp/aghvJlNKVnJKcPJ/VyAEcfC1BSV9ARo= diff --git a/docs-website/hugo.yaml b/docs-website/hugo.yaml new file mode 100644 index 00000000..c1e09dce --- /dev/null +++ b/docs-website/hugo.yaml @@ -0,0 +1,39 @@ +baseURL: http://localhost:1313/ +locale: en-US +title: diffx +publishDir: dist + +module: + imports: + - path: github.com/imfing/hextra + +menu: + main: + - name: Documentation + pageRef: / + weight: 1 + - name: Search + weight: 2 + params: + type: search + - name: GitHub + url: https://github.com/flexdinesh/diffx + weight: 3 + params: + icon: github + +params: + description: Review Git changes in your browser with diffx. + navbar: + displayTitle: true + displayLogo: false + theme: + default: system + displayToggle: true + footer: + displayCopyright: false + displayPoweredBy: true + +markup: + highlight: + noClasses: false diff --git a/docs-website/package.json b/docs-website/package.json new file mode 100644 index 00000000..3aefa2df --- /dev/null +++ b/docs-website/package.json @@ -0,0 +1,9 @@ +{ + "name": "@diffx/docs", + "private": true, + "scripts": { + "dev": "mise run docs:dev", + "build": "mise run docs:build", + "check": "mise run docs:check" + } +} diff --git a/mise.toml b/mise.toml index ceecba15..3f6c57a6 100644 --- a/mise.toml +++ b/mise.toml @@ -49,6 +49,19 @@ run = "pnpm dev:web" description = "Build self-contained agent plugin adapters" run = "pnpm --recursive --filter '@diffx/plugin-*' --if-present build" +[tasks."docs:dev"] +description = "Serve the docs website with live reload at localhost:1313" +dir = "{{config_root}}/docs-website" +tools = { "hugo-extended" = "0.166.0" } +run = "hugo server --bind 127.0.0.1 --buildDrafts --disableFastRender --renderToMemory" + +[tasks."docs:build"] +description = "Build and validate the static docs website at docs-website/dist" +alias = "docs:check" +dir = "{{config_root}}/docs-website" +tools = { "hugo-extended" = "0.166.0" } +run = "hugo --minify --panicOnWarning --cleanDestinationDir" + [tasks."dev:server"] description = "Start a standalone Go fixture server" depends = ["web:build"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b33ee44..c3e47e8a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -184,6 +184,8 @@ importers: specifier: 'catalog:' version: 0.1.5 + docs-website: {} + packages/api: dependencies: openapi-fetch: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 37c88248..231ca467 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,7 @@ packages: - apps/* - packages/* + - docs-website catalog: "@opencode/plugin": 2.0.22