From 9373e38eb4c7255a002349e2029b90f8bddaab80 Mon Sep 17 00:00:00 2001 From: Sung-Kyu Yoo Date: Sat, 14 Mar 2026 03:19:20 +0900 Subject: [PATCH 1/5] Add Hugo documentation site shell (#8) --- hugo.toml | 16 +++ layouts/_default/baseof.html | 25 +++++ layouts/_default/list.html | 10 ++ layouts/_default/single.html | 6 ++ layouts/index.html | 18 ++++ static/css/style.css | 191 +++++++++++++++++++++++++++++++++++ 6 files changed, 266 insertions(+) create mode 100644 hugo.toml create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 static/css/style.css diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..778a8a3 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,16 @@ +baseURL = 'https://skyoo2003.github.io/kvs/' +languageCode = 'en-us' +title = 'KVS Documentation' + +[menu] + [[menu.main]] + name = "Home" + url = "/" + weight = 1 + [[menu.main]] + name = "Documentation" + url = "/docs/" + weight = 2 + +[markup.goldmark.renderer] + unsafe = true diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..9f0b449 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,25 @@ + + + + + + {{ if .Title }}{{ .Title }} | {{ end }}{{ .Site.Title }} + + + +
+ +
+
+ {{ block "main" . }}{{ end }} +
+ + + diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..efefcd8 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,10 @@ +{{ define "main" }} +
+

{{ .Title }}

+ +
+{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..01bcc9b --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,6 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ .Content }} +
+{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..6eff134 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,18 @@ +{{ define "main" }} +
+

KVS

+

A simple key-value store for Go

+
+
+

KVS is a lightweight in-memory key-value store with a Cobra-based CLI. Import it into your Go programs or use the command-line tool directly.

+
+ +{{ end }} diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..066a3bc --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,191 @@ +:root { + --bg: #fafafa; + --fg: #1a1a1a; + --muted: #5a5a5a; + --accent: #0066cc; + --border: #e0e0e0; + --code-bg: #f4f4f4; +} + +@media (prefers-color-scheme: dark) { + :root { + --bg: #121212; + --fg: #e8e8e8; + --muted: #9a9a9a; + --accent: #66aaff; + --border: #2a2a2a; + --code-bg: #1e1e1e; + } +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html { + font-size: 16px; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; + background: var(--bg); + color: var(--fg); + line-height: 1.6; + min-height: 100vh; + display: flex; + flex-direction: column; +} + +header { + border-bottom: 1px solid var(--border); + padding: 1rem 2rem; +} + +nav { + display: flex; + gap: 1.5rem; + align-items: center; + max-width: 800px; + margin: 0 auto; +} + +nav a { + color: var(--muted); + text-decoration: none; + font-size: 0.95rem; +} + +nav a:hover, +nav a.active { + color: var(--accent); +} + +nav .logo { + font-weight: 700; + font-size: 1.1rem; + color: var(--fg); + letter-spacing: 0.02em; +} + +main { + flex: 1; + padding: 2rem; + max-width: 800px; + margin: 0 auto; + width: 100%; +} + +footer { + border-top: 1px solid var(--border); + padding: 1.5rem 2rem; + text-align: center; + color: var(--muted); + font-size: 0.85rem; +} + +h1, h2, h3 { + font-weight: 600; + line-height: 1.3; +} + +h1 { + font-size: 2rem; + margin-bottom: 1rem; +} + +h2 { + font-size: 1.4rem; + margin-top: 2rem; + margin-bottom: 0.75rem; +} + +h3 { + font-size: 1.15rem; + margin-top: 1.5rem; + margin-bottom: 0.5rem; +} + +p { + margin-bottom: 1rem; +} + +a { + color: var(--accent); +} + +a:hover { + text-decoration: underline; +} + +code { + background: var(--code-bg); + padding: 0.15rem 0.4rem; + border-radius: 3px; + font-size: 0.9em; + font-family: "SF Mono", Monaco, "Cascadia Code", monospace; +} + +pre { + background: var(--code-bg); + padding: 1rem; + border-radius: 4px; + overflow-x: auto; + margin-bottom: 1rem; +} + +pre code { + padding: 0; + background: none; +} + +ul, ol { + margin-bottom: 1rem; + padding-left: 1.5rem; +} + +li { + margin-bottom: 0.5rem; +} + +.hero { + text-align: center; + margin-bottom: 2rem; +} + +.hero h1 { + font-size: 2.5rem; + margin-bottom: 0.5rem; +} + +.tagline { + font-size: 1.15rem; + color: var(--muted); +} + +.intro { + margin-bottom: 2rem; +} + +.quick-links ul { + list-style: none; + padding: 0; +} + +.quick-links li { + padding: 0.5rem 0; +} + +.doc { + max-width: 100%; +} + +.doc-list ul { + list-style: none; + padding: 0; +} + +.doc-list li { + padding: 0.5rem 0; +} From ec7241f229f85c26ae006c5da551773ceac691f7 Mon Sep 17 00:00:00 2001 From: Sung-Kyu Yoo Date: Sat, 14 Mar 2026 03:19:28 +0900 Subject: [PATCH 2/5] Add documentation site content pages (#8) --- content/_index.md | 3 +++ content/docs/_index.md | 3 +++ content/docs/cli.md | 34 +++++++++++++++++++++++++ content/docs/contributing.md | 24 ++++++++++++++++++ content/docs/overview.md | 49 ++++++++++++++++++++++++++++++++++++ content/docs/release.md | 22 ++++++++++++++++ 6 files changed, 135 insertions(+) create mode 100644 content/_index.md create mode 100644 content/docs/_index.md create mode 100644 content/docs/cli.md create mode 100644 content/docs/contributing.md create mode 100644 content/docs/overview.md create mode 100644 content/docs/release.md diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..6f340a0 --- /dev/null +++ b/content/_index.md @@ -0,0 +1,3 @@ +--- +title: "KVS" +--- diff --git a/content/docs/_index.md b/content/docs/_index.md new file mode 100644 index 0000000..b40df67 --- /dev/null +++ b/content/docs/_index.md @@ -0,0 +1,3 @@ +--- +title: "Documentation" +--- diff --git a/content/docs/cli.md b/content/docs/cli.md new file mode 100644 index 0000000..16dd4c2 --- /dev/null +++ b/content/docs/cli.md @@ -0,0 +1,34 @@ +--- +title: "CLI Usage" +weight: 2 +--- + +The `kvs` binary exposes a small Cobra-based CLI for interacting with the key-value store. + +## Basic Commands + +```sh +$ kvs --help +$ kvs -v +$ kvs version +``` + +## Configuration + +Use `--config` to load a specific Viper-compatible configuration file: + +```sh +$ kvs --config config.yaml version +``` + +## Available Flags + +| Flag | Description | +|------|-------------| +| `--help`, `-h` | Show help for any command | +| `-v` | Show version information | +| `--config` | Path to config file | + +## Further Reading + +For Go API usage, see the [Overview](../overview/) documentation or the [Go package reference](https://pkg.go.dev/github.com/skyoo2003/kvs). diff --git a/content/docs/contributing.md b/content/docs/contributing.md new file mode 100644 index 0000000..0aef4a0 --- /dev/null +++ b/content/docs/contributing.md @@ -0,0 +1,24 @@ +--- +title: "Contributing" +weight: 3 +--- + +Contribution guidance is still being documented. + +## Current Status + +The repository currently keeps its contribution guide in `CONTRIBUTING.md`, which is marked as `_TBD_`. + +## Repository Links + +- [Repository on GitHub](https://github.com/skyoo2003/kvs) +- [Project README](https://github.com/skyoo2003/kvs/blob/main/README.md) +- [Current contributing file](https://github.com/skyoo2003/kvs/blob/main/CONTRIBUTING.md) + +## Contributing Today + +Until the dedicated guide is expanded, use the existing repository files and open a pull request with the proposed change. + +## Note + +This page summarizes the current contribution information available in the repository. diff --git a/content/docs/overview.md b/content/docs/overview.md new file mode 100644 index 0000000..06b988f --- /dev/null +++ b/content/docs/overview.md @@ -0,0 +1,49 @@ +--- +title: "Overview" +weight: 1 +--- + +KVS is a simple key-value store written in Go. It provides an in-memory store that can be used as a library within Go programs or via its command-line interface. + +## Features + +- In-memory key-value storage +- Clean Go API for programmatic use +- Cobra-based CLI for command-line operations +- Viper configuration support + +## Installation + +Clone and install the CLI: + +```sh +$ git clone https://github.com/skyoo2003/kvs.git +$ cd kvs +$ go install ./cmd/kvs +``` + +## Library Usage + +Import `github.com/skyoo2003/kvs` to use KVS as a library: + +```go +package main + +import ( + "fmt" + + "github.com/skyoo2003/kvs" +) + +func main() { + store := kvs.NewStore() + _ = store.Put("language", "go") + + value, _ := store.Get("language") + fmt.Println(value) +} +``` + +## License + +MIT License. See [LICENSE](https://github.com/skyoo2003/kvs/blob/main/LICENSE) for details. diff --git a/content/docs/release.md b/content/docs/release.md new file mode 100644 index 0000000..27832fd --- /dev/null +++ b/content/docs/release.md @@ -0,0 +1,22 @@ +--- +title: "Release Process" +weight: 4 +--- + +The repository tracks release notes in `docs/RELEASE.md` and automates tagged releases with GitHub Actions. + +## Commands + +```sh +$ changie new +$ changie batch {version} +$ changie merge +``` + +## Current Workflow + +The release workflow lives in `.github/workflows/release.yaml` and runs when a tag matching `v*` is pushed. + +## Note + +This page summarizes the current release information and workflow already present in the repository. From 2f8c0021401d066270010997208a9750312ee015 Mon Sep 17 00:00:00 2001 From: Sung-Kyu Yoo Date: Sat, 14 Mar 2026 03:19:33 +0900 Subject: [PATCH 3/5] Deploy documentation site to gh-pages (#8) --- .github/workflows/docs.yaml | 56 +++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/docs.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..cad7e5e --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,56 @@ +name: Docs + +on: + push: + branches: + - main + paths: + - ".github/workflows/docs.yaml" + - "hugo.toml" + - "content/**" + - "layouts/**" + - "static/**" + - "README.md" + - "CONTRIBUTING.md" + - "docs/RELEASE.md" + pull_request: + branches: + - main + paths: + - ".github/workflows/docs.yaml" + - "hugo.toml" + - "content/**" + - "layouts/**" + - "static/**" + - "README.md" + - "CONTRIBUTING.md" + - "docs/RELEASE.md" + workflow_dispatch: + +permissions: + contents: write + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v6.0.2 + with: + fetch-depth: 0 + + - name: Set up Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: '0.148.2' + + - name: Build documentation site + run: hugo build --gc --minify + + - name: Deploy documentation site + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: JamesIves/github-pages-deploy-action@v4 + with: + branch: gh-pages + folder: public + clean: true diff --git a/.gitignore b/.gitignore index a1f19c4..b1e9e73 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ /.idea/ /vendor/ /dist/ +/public/ +/resources/ +/.hugo_build.lock From d59902acb063a2f842cf7fcd48bab7cb6018a497 Mon Sep 17 00:00:00 2001 From: Sung-Kyu Yoo Date: Sat, 14 Mar 2026 03:31:10 +0900 Subject: [PATCH 4/5] Document gh-pages release flow --- content/docs/release.md | 12 +++++++++++- docs/RELEASE.md | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/content/docs/release.md b/content/docs/release.md index 27832fd..2bddb3c 100644 --- a/content/docs/release.md +++ b/content/docs/release.md @@ -3,7 +3,7 @@ title: "Release Process" weight: 4 --- -The repository tracks release notes in `docs/RELEASE.md` and automates tagged releases with GitHub Actions. +The repository tracks release notes in `docs/RELEASE.md`, automates tagged releases with GitHub Actions, and publishes the documentation site through `gh-pages`. ## Commands @@ -17,6 +17,16 @@ $ changie merge The release workflow lives in `.github/workflows/release.yaml` and runs when a tag matching `v*` is pushed. +## Documentation Site Release + +The documentation workflow lives in `.github/workflows/docs.yaml`. + +When a docs-related change is pushed to `main`, GitHub Actions builds the Hugo site and deploys the generated `public/` directory to the `gh-pages` branch. + +For this to publish correctly, repository settings must point GitHub Pages at the `gh-pages` branch root. + +After a merge, verify that the `Docs` workflow succeeds and that the site is available at `https://skyoo2003.github.io/kvs/`. + ## Note This page summarizes the current release information and workflow already present in the repository. diff --git a/docs/RELEASE.md b/docs/RELEASE.md index e6efeaa..44f549b 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -1,6 +1,9 @@ # Release -_TBD_ +This repository has two release paths: + +- tagged application releases through `.github/workflows/release.yaml` +- static documentation site releases through `.github/workflows/docs.yaml` ## Commands @@ -9,3 +12,34 @@ $ changie new $ changie batch {version} $ changie merge ``` + +## Documentation Site Release + +The static documentation site is built with Hugo and published to the `gh-pages` branch. + +### Trigger + +The docs workflow runs on pushes to `main` when one of these paths changes: + +- `hugo.toml` +- `content/**` +- `layouts/**` +- `static/**` +- `README.md` +- `CONTRIBUTING.md` +- `docs/RELEASE.md` +- `.github/workflows/docs.yaml` + +### Publish Flow + +1. GitHub Actions runs `.github/workflows/docs.yaml` +2. Hugo builds the site into `public/` +3. `JamesIves/github-pages-deploy-action` publishes `public/` to the `gh-pages` branch + +### Repository Setting + +GitHub Pages must be configured to serve from the `gh-pages` branch root. + +### Verification + +After merging a docs change to `main`, confirm that the `Docs` workflow succeeds and that the site is available at `https://skyoo2003.github.io/kvs/` From 21f997fcd96b69082a4e6c3688006f11df7d6da4 Mon Sep 17 00:00:00 2001 From: Sung-Kyu Yoo Date: Sat, 14 Mar 2026 03:33:46 +0900 Subject: [PATCH 5/5] Document project release process --- content/docs/release.md | 6 ++++++ docs/RELEASE.md | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/content/docs/release.md b/content/docs/release.md index 2bddb3c..c382210 100644 --- a/content/docs/release.md +++ b/content/docs/release.md @@ -17,6 +17,12 @@ $ changie merge The release workflow lives in `.github/workflows/release.yaml` and runs when a tag matching `v*` is pushed. +## Project Release + +For an application release, prepare the changelog with `changie`, push a version tag such as `v1.2.3`, and let the `Release` workflow publish the artifacts defined in `.goreleaser.yml`. + +After the tag is pushed, verify that the `Release` workflow succeeds and that the GitHub release contains the expected binaries and archives. + ## Documentation Site Release The documentation workflow lives in `.github/workflows/docs.yaml`. diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 44f549b..6d96e04 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -13,6 +13,28 @@ $ changie batch {version} $ changie merge ``` +## Project Release + +Project releases are published from `.github/workflows/release.yaml` when a tag matching `v*` is pushed. + +### Preparation + +1. Create changelog entries with `changie new` +2. Batch the release notes with `changie batch {version}` +3. Merge the changelog with `changie merge` +4. Commit the release notes and create the release tag + +### Publish Flow + +1. Push a tag such as `v1.2.3` +2. GitHub Actions runs `.github/workflows/release.yaml` +3. GoReleaser builds the `kvs` binaries and archives defined in `.goreleaser.yml` +4. The workflow publishes the GitHub release artifacts and related package outputs + +### Verification + +After pushing the tag, confirm that the `Release` workflow succeeds and that the expected release artifacts are attached to the GitHub release. + ## Documentation Site Release The static documentation site is built with Hugo and published to the `gh-pages` branch.