Repository navigation
Releases: A-Line-Services/go-cms
Releases · A-Line-Services/go-cms
Release list
v0.1.21
What's new
- Deploy version tracking: During build, writes
__cms_versionfile to the output directory containing the deploy version timestamp from the CMS API. This enables the CMS to verify deployments are live by fetching this file from the production domain.
v0.1.20
feat: add RichTextLinkClass config for site-defined link styling
Sites can now set Config.RichTextLinkClass (e.g. "cms-link") to have the class injected onto <a> tags in rich text content at render time. A <meta name="cms-link-class"> tag is emitted once per page so the CMS live preview bridge can apply the same transformation.
v0.1.18
v0.1.17
What's Changed
- feat: Populate
LocalesanddefaultLocaleonPageDatain template and sync renders, so conditional UI (e.g. language switchers guarded bylen(p.Locales) > 1) renders correctly in CMS preview and sync mode. resolveLocalenow always fetches and caches the locale list on the App struct, even whenconfig.Localeis already set.
v0.1.16
Bug Fix
- fix: defensive locale filtering in subcollection and page data resolution —
resolveSubcollections()andresolvePageData()now filter field values by locale, preventing language mixing when the API returns mixed-locale subcollection data.
v0.1.15
What's new
- Rich text image downloading: During static builds with
DownloadMedia: true, the build pipeline now scans rich text HTML for<img>tags withdata-media-idattributes (inserted by the CMS WYSIWYG editor). For each image found, a fresh signed URL is fetched via the media API, the image is downloaded locally,srcis rewritten to the local path, and thedata-media-id/data-site-idattributes are stripped from production output.
This ensures rich text images are self-hosted in static builds, just like structured image fields.
v0.1.14
v0.1.13
v0.1.12
New: Toggle field type
Adds a new toggle field type for conditionally showing/hiding CMS-managed elements on the live site.
API additions
PageData.Toggle(key string) bool— returns the boolean field value (false if missing)PageData.ToggleOr(key string, fallback bool) bool— returns CMS value or fallback; returnstruewhen fields is nil (template/sync renders for schema discovery)EntryData.Toggle(key string) bool— same as above for subcollection entriesEntryData.ToggleOr(key string, fallback bool) bool— same as above for subcollection entries
Components
components.Toggleable(p, key, label, fallback)— wraps content with a toggle control for page-level fieldscomponents.ToggleableEntry(e, key, label, fallback)— wraps content with a toggle control for subcollection entries
Usage
// Inline conditional
if p.ToggleOr("show_banner", true) {
<div data-cms-field="show_banner" data-cms-type="toggle" data-cms-label="Show Banner">
...
</div>
}
// Or use the component wrapper
@c.Toggleable(p, "show_banner", "Show Banner", true) {
<div class="banner">...</div>
}