Static replacement for the WordPress + Polylang + synchronous DeepL stack: - Hugo config: es (default) / de / pt-br, siblings paired by filename basename, WP slugs preserved via /:slug/ permalinks - Theme: CSS ported verbatim from the WP theme; header/footer/lang-switcher and article templates ported from their PHP counterparts (no Google Fonts — zero third-party requests) - seo-head partial: hreflang + x-default, og:locale(:alternate), JSON-LD BlogPosting/Blog with inLanguage (ported from theme/inc/seo.php) - robots.txt AI-crawler allowlist + build-time llms.txt (ported from theme/inc/robots-and-llms.php) - scripts/translate.py: async DeepL step (tag_handling=html, protected community terms, manual_translation freeze, fail-loud, bot commits) - scripts/wp-to-hugo.py: one-shot WP REST → Hugo content converter - Decap CMS admin with Gitea backend, locally-bundled JS - .woodpecker.yml: translate → build → deploy (rsync to Caddy root) - Sample trilingual welcome post + acerca/contacto pages Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017z2rT1oN7vMS4ggo23n5WG
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
# Woodpecker CI: translate → build → deploy
|
|
#
|
|
# Triggered by the Gitea push webhook. The translate step replaces the old
|
|
# synchronous WordPress save_post hook: publishing in Decap is one git
|
|
# commit, translation happens here, asynchronously, and every DeepL output
|
|
# lands as a reviewable bot commit.
|
|
#
|
|
# Secrets to configure in Woodpecker (repo settings → secrets):
|
|
# deepl_api_key — DeepL free-tier key (500k chars/mo)
|
|
# gitea_push_token — Gitea token for the translations bot user
|
|
# (translations@vienalatina.com) with repo write access
|
|
#
|
|
# The deploy step writes to the Caddy web root via a host mount, which
|
|
# requires the repo to be marked "trusted" in Woodpecker.
|
|
|
|
when:
|
|
- event: push
|
|
branch: main
|
|
|
|
steps:
|
|
translate:
|
|
image: python:3.12-slim
|
|
environment:
|
|
DEEPL_API_KEY:
|
|
from_secret: deepl_api_key
|
|
GITEA_PUSH_TOKEN:
|
|
from_secret: gitea_push_token
|
|
commands:
|
|
- pip install --quiet requests pyyaml
|
|
- python scripts/translate.py
|
|
|
|
build:
|
|
image: hugomods/hugo:0.135.0
|
|
commands:
|
|
# Bundle Decap locally so the /admin page makes zero third-party requests.
|
|
- wget -q -O static/admin/decap-cms.js https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js
|
|
- hugo --minify
|
|
|
|
deploy:
|
|
image: alpine:3.20
|
|
volumes:
|
|
- /var/www/vienalatina.com:/deploy-target
|
|
commands:
|
|
- apk add --no-cache rsync
|
|
- rsync -a --delete public/ /deploy-target/
|