feat(build): introduce scripts/build.sh for deploy-time envsubst

Replaces literal email and Umami website ID in the HTML files with
[EMAIL_ADDRESS] and [UMAMI_WEBSITE_ID] placeholders. Coolify runs
scripts/build.sh as the build step before serving, substituting the
placeholders with values from service env vars (CONTACT_EMAIL and
UMAMI_WEBSITE_ID). The repo no longer contains the real email or
website id.

Also mirrors recent text refinements from the Catalan 'Per què ho
faig' section into the Spanish 'Por qué lo hago' section. Adds public/
to .gitignore and refreshes README + CHANGELOG.
This commit is contained in:
2026-07-30 15:28:28 +02:00
parent 130a182556
commit 950af21f7b
6 changed files with 1201 additions and 28 deletions
+4 -1
View File
@@ -2,4 +2,7 @@
*.log
.DS_Store
.env
.env.local
.env.local
# Build output
public/
+12
View File
@@ -1,5 +1,17 @@
# Changelog
## 0.5.0 — 2026-07-30
### Changed
- `email` and `umami website id` are no longer in the repo — they live as Coolify env vars and are substituted at build time via `scripts/build.sh`.
- The visible link text in the "Per què ho faig" / "Por qué lo hago" contact line is now "Itziar ZG" in both languages, replacing the literal email address.
- "Per què ho faig" / "Por qué lo hago" content refinements mirrored from CA to ES: dropped the "no soy bióloga marina / no soc biòloga marina" disclaimer, added "on"/"donde" before the relative clause ("…una illa **on el** principal actiu…"), and "balears" → "locals" in "dues organitzacions ecologistes locals" / "dos organizaciones ecologistas locales".
- Removed the "Plataforma Posidonia" attribution from the footer "Mantenida per" / "Mantenguda por" line in both languages.
### Added
- `scripts/build.sh` — small `sed`-based substitution script for Coolify; reads `CONTACT_EMAIL` and `UMAMI_WEBSITE_ID` env vars and emits to `./public/`.
- `public/` added to `.gitignore` so build output stays out of the repo.
## 0.4.0 — 2026-07-30
- `refactor(i18n)`: aplanar la estructura i18n — el català passa a servir-se a l'arrel (`/`), s'elimina el subdirectori `/ca/`.
+25 -7
View File
@@ -8,13 +8,15 @@ Sitio editorial estático en catalán y español sobre el seguimiento de la *Pos
```
/
├── index.html # Català (primari, x-default)
├── index.html # Català (primari, x-default) — contiene placeholders
├── es/
│ └── index.html # Castellano
│ └── index.html # Castellano — contiene placeholders
├── og-image-ca.jpg # 1200×630, imatge social per a /
├── og-image-es.jpg # 1200×630, imatge social per a /es/
├── robots.txt
── sitemap.xml # enumera / i /es/ amb hreflang complet
── sitemap.xml # enumera / i /es/ amb hreflang complet
└── scripts/
└── build.sh # sed envsubst → ./public/
```
- `/` és l'idioma principal (`hreflang="x-default"`).
@@ -22,13 +24,29 @@ Sitio editorial estático en catalán y español sobre el seguimiento de la *Pos
- Cada pàgina porta un selector d'idioma a la cantonada superior dreta del `<header>` (`CA | ES`), amb `aria-current="page"` a l'idioma actiu.
- Tots dos documents declaren `<link rel="alternate" hreflang="…">` per a l'altra llengua i per a `x-default`, més el seu propi `canonical`.
## Build
## Build & Deploy
No build step required. The two `index.html` files, `robots.txt`, `sitemap.xml` and the two `og-image-*.jpg` files in this repo root are deployed as-is.
This site uses a small build step that substitutes two placeholders — `[EMAIL_ADDRESS]` and `[UMAMI_WEBSITE_ID]` — with values supplied via Coolify environment variables. The build output goes to `./public/`, which Coolify serves as the static site root. The real email and Umami UUID never appear in the repo.
**Coolify service config:**
- Build command: `bash scripts/build.sh`
- Publish directory: `public`
- Environment variables (set in Coolify service "Environment" tab):
- `CONTACT_EMAIL` — your real contact email (e.g. `hello@example.com`)
- `UMAMI_WEBSITE_ID` — your Umami website UUID (e.g. `8ba9afa3-f6d3-45d9-b2ad-…`)
**Local build for testing:**
```bash
CONTACT_EMAIL=hello@example.com UMAMI_WEBSITE_ID=8ba9afa3-… bash scripts/build.sh
python3 -m http.server --directory public 8000 # preview
```
The build is just a `sed` substitution; no Node toolchain required. The output `./public/` is gitignored.
## Deploy
En Coolify, configura un servicio de sitio estático que apunte directamente al directorio raíz de este repositorio. Crea un CNAME para `posidonia.eivissaenvironmentalwatch.es` apuntando al ingreso del servidor Hetzner/Coolify.
Crea un CNAME para `posidonia.eivissaenvironmentalwatch.es` apuntando al ingreso del servidor Hetzner/Coolify.
Coolify aprovisiona HTTPS con Let's Encrypt después de que el DNS se propague. Si se alcanza un límite de emisión, conserva el DNS correcto, revisa los registros de validación y reintenta después de una hora; no solicites certificados repetidamente durante la propagación.
@@ -39,4 +57,4 @@ La página usa tipografías del sistema, CSS y SVG en línea, cero scripts exter
## Contacto
<!-- TODO: [reemplazar con email real del mantenedor si es diferente] -->
Escribe a [contacto@posidonia.eivissaenvironmentalwatch.es](mailto:contacto@posidonia.eivissaenvironmentalwatch.es).
Escribe a [Itziar ZG](mailto:[EMAIL_ADDRESS]).
+2 -2
View File
File diff suppressed because one or more lines are too long
+1125 -18
View File
File diff suppressed because one or more lines are too long
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Build script for Coolify: substitute [EMAIL_ADDRESS] and [UMAMI_WEBSITE_ID]
# placeholders using environment variables, then output to ./public/
#
# Required env vars:
# CONTACT_EMAIL — the actual email address
# UMAMI_WEBSITE_ID — the umami website UUID
set -euo pipefail
: "${CONTACT_EMAIL:?Need CONTACT_EMAIL env var}"
: "${UMAMI_WEBSITE_ID:?Need UMAMI_WEBSITE_ID env var}"
mkdir -p public
# Substitute placeholders in both language files
sed \
-e "s|\[EMAIL_ADDRESS\]|${CONTACT_EMAIL}|g" \
-e "s|\[UMAMI_WEBSITE_ID\]|${UMAMI_WEBSITE_ID}|g" \
index.html > public/index.html
mkdir -p public/es
sed \
-e "s|\[EMAIL_ADDRESS\]|${CONTACT_EMAIL}|g" \
-e "s|\[UMAMI_WEBSITE_ID\]|${UMAMI_WEBSITE_ID}|g" \
es/index.html > public/es/index.html
# Copy static assets unchanged
cp -v og-image-*.jpg umami.js robots.txt sitemap.xml public/ 2>/dev/null || true
echo "✅ Build complete. Output in ./public/"
echo " HTML pages: $(find public -name '*.html' | wc -l)"
echo " Total size: $(du -sh public | cut -f1)"