contact messages: editor preview renders no button when messaging disabled

The preview registered the {contact:} directive unconditionally, so with
no configured label it showed the button with the 'Contact us'
placeholder while the served page renders nothing. Mirror the page
logic in the preview render path.
This commit is contained in:
LeoVasanko committed 2026-09-28 17:06:38 +00:00
1 parent 023783d189
commit ba2d6ec60c
3 files changed
+19 -12

No files matched your search

+3 -3
View File
@@ -36,15 +36,15 @@ A lone `{contact: Label}` line in article Markdown (the block-directive
machinery of `markdown.py`) renders
`<button class="contact-trigger">Label</button>`. An empty label falls
back to the configured site label (`Data.contact_label`, localized —
below; "Contact us" appears only as the inert preview's placeholder when
nothing is configured). `pagerite.js`
below; "Contact us" is the last-resort fallback when neither is set).
`pagerite.js`
click-delegates these buttons and lazy-loads
the contact bundle; the editor preview renders the same button inert, and
description/card mining resolves the tag to nothing. A per-button label
lives in the chunk, so translated pages localize it like any other text.
Feeds render the tag as its literal source (no directive context). When
messaging is disabled (no site label configured) the tag renders nothing
at all.
at all, in the editor preview just as on the served page.
## Site settings and localization