diff --git a/site/justfile b/site/justfile index 9986459..009844f 100644 --- a/site/justfile +++ b/site/justfile @@ -19,6 +19,12 @@ default: # Start the HTMX-SSR dev server (auto-detects site/ in PWD) [no-cd] dev: + #!/usr/bin/env bash + export DATABASE_URL="${DATABASE_URL:-sqlite:data/dev.db}" + export HTMX_TEMPLATE_PATH="${HTMX_TEMPLATE_PATH:-htmx-templates}" + export RUSTELO_SITE_ROUTES="${RUSTELO_SITE_ROUTES:-site/config/routes}" + export SITE_BASE_URL="${SITE_BASE_URL:-https://ontoref.dev}" + export SITE_NAME="${SITE_NAME:-ontoref}" lsof -ti:3030 | xargs kill -9 2>/dev/null || true rustelo-htmx-server @@ -655,7 +661,7 @@ sync: templates htmx-assets rotator-assets content # it ran by hand. `graph` here is content_graph.json, a different artifact; the name collision is # exactly what let the omission read as covered. [no-cd] -sync-full: templates htmx-assets rotator-assets adr-pages expedientes informe catalog-content decks content glossary conceptos graph adr-map diagram about-json sync-artifacts check +sync-full: templates htmx-assets rotator-assets adr-pages expedientes informe catalog-content decks spine content glossary conceptos graph adr-map taglines diagram about-json sync-artifacts check # The nu generators own these four files in site/public/r (the deploy tree); the serve # tree needs the same copies. `content` does this too, so a standalone `just content` diff --git a/site/scripts/build/gen-spine-pages.nu b/site/scripts/build/gen-spine-pages.nu index 079b40c..7d6b9f6 100644 --- a/site/scripts/build/gen-spine-pages.nu +++ b/site/scripts/build/gen-spine-pages.nu @@ -47,6 +47,16 @@ def main [ for item in ($spine.doors | enumerate) { let d = $item.item let vp = (nickel export --format json $"($vp_dir)/($d.value_prop_id).ncl" | from json) + # Localized claim/problem_solved: use the optional `*_i18n` sibling for this + # lang WHEN it carries that lang key, else the canonical (English) scalar — + # so the 16 non-door vps (no sibling) and `en` (translations-only sibling) + # both fall back to the scalar. `get $col` on a dynamic name errors on a + # missing key, so presence is checked against `columns` first. Keeps the + # door pages bilingual without touching the Rust `ValueProp` struct. + let claim_i18n = ($vp.claim_i18n?) + let vp_claim = (if ($claim_i18n != null) and ($lang in ($claim_i18n | columns)) { $claim_i18n | get $lang } else { $vp.claim }) + let problem_i18n = ($vp.problem_solved_i18n?) + let vp_problem = (if ($problem_i18n != null) and ($lang in ($problem_i18n | columns)) { $problem_i18n | get $lang } else { $vp.problem_solved }) let label = ($d.label | get $lang) let line = ($d.line | get $lang) let blog_url = $"/blog?tag=($d.tag)" @@ -60,7 +70,7 @@ def main [ $"[Posts]\(($blog_url)\) · [Recipes]\(($recipes_url)\)" }) let prize_label = (if $is_es { "El premio, al entrar" } else { "The prize, once inside" }) - let excerpt = ($vp.problem_solved | lines | where ($it | str trim | is-not-empty) | first | str trim | str replace --all '"' "'") + let excerpt = ($vp_problem | lines | where ($it | str trim | is-not-empty) | first | str trim | str replace --all '"' "'") let cat_desc = (if $is_es { "Casos de uso e implementaciones de ontoref" } else { "Use cases and implementations of ontoref" }) let proj_dir = $"($content)/domains/($lang)/use-cases" @@ -100,9 +110,9 @@ category_published: true " }) - let body = $"($hook_block)**($vp.claim)** + let body = $"($hook_block)**($vp_claim)** -($vp.problem_solved) +($vp_problem) ---