Replace [[component:name]] smart-tag prefix with terse [[/name]]

Replace [[component:name]] smart-tag prefix with terse [[/name]]

#36 in Riparion/riparion-cms — merged 2026-06-02

What

The [[component: prefix on embedded smart tags was pure ceremony — 10 characters before the component name — because nothing else used the [[ … ]] syntax. This swaps the canonical embed form to a single / sigil:

[[/counter start=0 step=1 label="Clicks"]]
[[/queryloop query="select posts where category=news order_by_desc=published_date take=6"]]

How

  • src/mdx.rsparse_embed_line accepts [[/name …]] as canonical and keeps [[component:name …]] as a deprecated alias, so existing post bodies keep rendering unchanged. The prop grammar (key=value, key="quoted", bare flags) is untouched.
  • src/embeds/mod.rs — all 10 SMART_TAGS slash-menu snippets emit the new form, so new content gets the terse syntax automatically.
  • src/seed.rs — demo-post bodies updated.
  • src/server/tests.rs — primary tests switched to [[/…]]; new parse_body_accepts_deprecated_component_prefix pins the alias.
  • Doc comments across mdx.rs, embeds/*, and admin panes updated.

Why it's more than cosmetic

Using a leading sigil instead of owning the whole [[ … ]] namespace leaves bare [[Some Page]] free for future wiki-style internal links. The existing parse_body_ignores_non_embed_brackets test now guards exactly that boundary.

Migration note

Already-saved post bodies still contain [[component:…]] text — they render fine via the alias. Retiring the alias later would need a one-time content migration ([[component:[[/ over stored body columns).

Verification

Ran locally, all green:

  • cargo fmt --all --check
  • cargo test --no-default-features --features server,sqlite (parser tests, incl. new alias test)
  • cargo clippy on server,sqlite, server,postgres, and wasm web (with CI flags)

🤖 Generated with Claude Code

Last updated 2026-06-03