Skip to content
Merged
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
65 changes: 20 additions & 45 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: pages
# GitHub Pages is a redirect stub to https://book.dlgrv.com (canonical book host).
# Deploy static book to GitHub Pages after workflow "test" succeeds on main.
# Auth / interactive sync stays on book.dlgrv.com only (see interactive.js).

on:
workflow_run:
Expand All @@ -24,51 +25,25 @@ jobs:
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main')
runs-on: ubuntu-latest
env:
PYTHONPATH: ${{ github.workspace }}
steps:
- name: Stage redirect stub
run: |
mkdir -p .publish
cat > .publish/index.html <<'HTML'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=https://book.dlgrv.com/">
<link rel="canonical" href="https://book.dlgrv.com/">
<title>Moved to book.dlgrv.com</title>
<script>
location.replace(
'https://book.dlgrv.com/'
+ location.pathname.replace(/^\\/HowToLiveBetter\\/?/, '')
+ location.search + location.hash
);
</script>
</head>
<body>
<p>This book now lives at <a href="https://book.dlgrv.com/">book.dlgrv.com</a>.</p>
</body>
</html>
HTML
# Also redirect common locale paths via meta pages
for lang in en ru zh es pt ar id; do
mkdir -p ".publish/$lang"
cat > ".publish/$lang/index.html" <<HTML
<!doctype html>
<meta http-equiv="refresh" content="0; url=https://book.dlgrv.com/$lang/">
<link rel="canonical" href="https://book.dlgrv.com/$lang/">
<script>location.replace('https://book.dlgrv.com/$lang/'+location.search+location.hash)</script>
<p><a href="https://book.dlgrv.com/$lang/">Continue</a></p>
HTML
done
mkdir -p .publish/login
cat > .publish/login/index.html <<'HTML'
<!doctype html>
<meta http-equiv="refresh" content="0; url=https://book.dlgrv.com/login/">
<link rel="canonical" href="https://book.dlgrv.com/login/">
<script>location.replace('https://book.dlgrv.com/login/'+location.search+location.hash)</script>
<p><a href="https://book.dlgrv.com/login/">Continue</a></p>
HTML
- uses: actions/upload-pages-artifact@v3
- uses: actions/checkout@v4
with:
# workflow_run checkout defaults to default branch tip; pin to the
# commit that passed tests when triggered by workflow_run.
ref: ${{ github.event.workflow_run.head_sha || github.sha }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install deps
run: pip install -r requirements-dev.txt
- name: Build site pages
run: python3 forge/site/build_pages.py
- name: Stage Pages artifact
run: python3 forge/site/pages_artifact.py
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .publish

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Raw `python3 translate/…` needs PYTHONPATH=. (or use these targets).

export PYTHONPATH := $(CURDIR)
# PocketBase v0.40+ needs Go ≥1.27; let the module toolchain download it.
export GOTOOLCHAIN := auto

PY = .venv/bin/python3
RUFF = .venv/bin/ruff
Expand All @@ -11,7 +13,7 @@ YAMLLINT = .venv/bin/yamllint

.PHONY: help sync-upstream digest assemble verify verify-all wave repair status lint format test test-integration ci og og-html update-readme hooks check-commit-msg pages-artifact serve web-build quality style lt check-content check-links ebook-deps ebook-test ebook-epub ebook-pdf ebooks api-dev api-test api-lint api-format api-build api-smoke api-vuln api-cover

GOLANGCI_LINT_VERSION := v2.1.6
GOLANGCI_LINT_VERSION := v2.14.0
GOLANGCI_LINT := github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
API_DIR := api

Expand Down Expand Up @@ -81,7 +83,8 @@ api-cover: ## Go coverage report

api-lint: ## golangci-lint + go mod tidy -diff
cd $(API_DIR) && go mod tidy -diff
cd $(API_DIR) && go run $(GOLANGCI_LINT) run ./...
# Rebuild golangci-lint with Go ≥ api/go.mod (host may be older).
cd $(API_DIR) && GOTOOLCHAIN=go1.27.0 go run $(GOLANGCI_LINT) run ./...

api-format: ## gofumpt via golangci-lint formatters
cd $(API_DIR) && gofmt -w $$(find . -name '*.go' -not -path './.local/*')
Expand Down
52 changes: 27 additions & 25 deletions api/go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
module github.com/dlgrv/HowToLiveBetter/api

go 1.23.12
go 1.27

require (
github.com/pocketbase/dbx v1.11.0
github.com/pocketbase/pocketbase v0.28.4
github.com/pocketbase/dbx v1.12.0
github.com/pocketbase/pocketbase v0.40.4
)

require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/domodwyer/mailyak/v3 v3.6.2 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.9 // indirect
github.com/ganigeorgiev/fexpr v0.5.0 // indirect
github.com/go-ozzo/ozzo-validation/v4 v4.3.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.2 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.15 // indirect
github.com/ganigeorgiev/fexpr v0.6.0 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/mattn/go-colorable v0.1.15 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/pocketbase/ozzo-validation/v4 v4.3.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/spf13/cast v1.9.2 // indirect
github.com/spf13/cobra v1.9.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect
golang.org/x/image v0.28.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/oauth2 v0.30.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.26.0 // indirect
modernc.org/libc v1.65.10 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
golang.org/x/crypto v0.57.0 // indirect
golang.org/x/image v0.46.0 // indirect
golang.org/x/net v0.59.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/sys v0.48.0 // indirect
golang.org/x/text v0.42.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/libc v1.74.4 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.38.0 // indirect
modernc.org/memory v1.12.0 // indirect
modernc.org/sqlite v1.57.0 // indirect
)
Loading
Loading