| title | fix: Use /x/{slug} deep links for Lark example links in guide pages |
|---|---|
| type | fix |
| status | completed |
| date | 2026-03-23 |
Guide pages in site/content/guides/ have "Try it now" links that claim to open a specific example in Lark, but they all point to the bare root https://lark.calcmark.org instead of the deep-link URL https://lark.calcmark.org/x/{slug}. Users click expecting to see the named example but land on the Lark homepage instead.
Four guide pages name a specific example but link to the wrong URL:
| Guide page | Link text | Current URL | Should be |
|---|---|---|---|
guides/system-sizing/_index.md:12 |
"System Sizing example in Lark" | https://lark.calcmark.org |
https://lark.calcmark.org/x/system-sizing |
guides/business-planning/_index.md:10 |
"Household Budget in Lark" | https://lark.calcmark.org |
https://lark.calcmark.org/x/household-budget |
guides/recipe-scaling/_index.md:14 |
"Recipe Scaling example in Lark" | https://lark.calcmark.org |
https://lark.calcmark.org/x/recipe-scaling |
guides/unit-conversion/_index.md:9 |
"Unit Conversion example in Lark" | https://lark.calcmark.org |
No unit-conversion example exists — keep root link |
Additionally, the Lark base URL (https://lark.calcmark.org) is hardcoded in 8+ locations across content and layouts with no centralized site param.
Update three guide pages to use /x/{slug} deep links where a matching calcmark_source example exists:
guides/system-sizing/_index.md→/x/system-sizingguides/business-planning/_index.md→/x/household-budgetguides/recipe-scaling/_index.md→/x/recipe-scaling
For guides/unit-conversion/_index.md: no unit-conversion worked example exists (no calcmark_source frontmatter), so keep the root Lark link but update the link text to not imply a specific example will open. Change to generic "CalcMark Lark playground" phrasing.
Create site/layouts/shortcodes/lark.html that generates Lark links with optional deep-link slug:
{{</* lark */>}} → https://lark.calcmark.org
{{</* lark "system-sizing" */>}} → https://lark.calcmark.org/x/system-sizing
This centralizes the base URL and makes /x/ deep linking a first-class pattern. Convert the guide page links to use this shortcode.
Add larkURL: "https://lark.calcmark.org" to hugo.yaml params so all templates and shortcodes reference one source of truth. Update section.html and the new lark shortcode to use it.
-
guides/system-sizing/_index.mdlinks tohttps://lark.calcmark.org/x/system-sizing -
guides/business-planning/_index.mdlinks tohttps://lark.calcmark.org/x/household-budget -
guides/recipe-scaling/_index.mdlinks tohttps://lark.calcmark.org/x/recipe-scaling -
guides/unit-conversion/_index.mdlink text does not imply a specific example will open - New
larkshortcode exists and supports optional slug parameter -
hugo.yamlhaslarkURLparam used by shortcode andsection.html -
task site:buildsucceeds (no broken shortcodes or template errors) - Existing pages that link to bare
lark.calcmark.orgin docs/ are optionally converted to shortcode
- The
/x/{slug}pattern is already used insite/layouts/_default/section.html:30for "Edit live" buttons on example pages - The slug is derived from the
calcmark_sourcefilename:path.BaseName "testdata/examples/system-sizing.cm"→system-sizing - 10 worked examples have
calcmark_sourceand get deep links automatically via the section template - The
guides/_index.mdroot link is generic ("playground") and correct — no change needed docs/_index.md,docs/getting-started.md,docs/examples/_index.mdlink to root Lark appropriately — no change needed
site/layouts/_default/section.html:26-33— existing/x/{slug}patternsite/layouts/shortcodes/— 6 existing shortcodes (no Lark shortcode yet)site/hugo.yaml— site config, nolarkURLparam currentlydocs/solutions/infrastructure/hugo-site-structure-from-scratch.md— shortcode conventions