Files
webstudio/docs/university/core-components/xml-time.md
Oleg Isonen 99371187dc docs: Move product documentation into Builder (#5987)
## Summary

- move the complete GitBook documentation tree and assets into Builder
under `/docs`
- generate the exhaustive MCP page from the local CLI source in the same
change
- publish GitBook from a release-gated `docs` branch containing the
exact successfully released revision
- run MCP documentation tests, typechecking, and stale-output checks
with the existing generated-docs check
- remove links to the Community Discussions repository

## Technical choices

- Import the current documentation as a linear snapshot so the branch
satisfies Builder's required-linear-history protection.
- Keep the Markdown wrapper separate from the TypeScript generator at
`scripts/docs/mcp-page.md`.
- Generate through `packages/cli/local.js` so CLI guidance and its
documentation are reviewed together.
- Let `check:generated-docs` reject CLI changes that leave the committed
MCP page stale.
- After both GitHub release creation and package publication succeed,
fast-forward the read-only `docs` branch to the immutable release tag
commit. A divergent update fails instead of publishing a different
revision.
- Configure GitBook to publish `/docs` from the `docs` branch, not
directly from `main`.
- Exclude `/docs` from the repository-wide `oxfmt` scan so imported
GitBook Markdown retains its established formatting; generator tests and
stale-output checks still validate the MCP page.
- Exclude `transcripts/` and GitHub Discussions from the migration.

## Todo

- [x] Import documentation, navigation, includes, and assets under
`/docs`.
- [x] Generate the MCP page from the local CLI source.
- [x] Move MCP generation and validation into Builder.
- [x] Require MCP documentation updates alongside CLI changes.
- [x] Publish released revisions through a read-only `docs` branch.
- [x] Remove Community repository links from Builder and the migrated
docs.
- [x] Preserve and verify a final Community Git bundle locally.
- [ ] Merge this pull request.
- [ ] Let the next successful release create or advance the `docs`
branch.
- [ ] Repoint GitBook Git Sync to `webstudio-is/webstudio`, branch
`docs`, root directory `/docs`.
- [ ] Verify `docs.webstudio.is`, navigation, assets, anchors, and the
MCP page in production.
- [ ] Delete `webstudio-is/webstudio-community`.

## Verification

- `pnpm check:generated-docs`
- `pnpm lint`
- `pnpm oxfmt --check`
- `git diff --check origin/main...HEAD`
- generator regression test demonstrated failing when the GitBook
wrapper behavior was removed, then passing after restoration
- no fixture inputs or outputs are affected

## Known limitation

All documentation merged after the previous release waits for the next
successful release before GitBook publishes it. This deliberately keeps
the public MCP reference aligned with an installable CLI revision.

Ref #5986
2026-08-03 17:55:50 +02:00

3.0 KiB
Raw Permalink Blame History

description
description
Format dates in XML sitemaps and RSS feeds using the XML Time component.

🕐 XML Time

See MDN: Date.toISOString()

The XML Time component converts machine-readable date and time values to ISO 8601 format. This is essential for generating valid XML feeds like RSS, Atom, and sitemaps that require standardized date formats.

When to Use

Use XML Time for:

  • RSS feed publication dates (<pubDate>)
  • Atom feed <updated> and <published> elements
  • Sitemap <lastmod> timestamps
  • Any XML output requiring ISO 8601 formatted dates

How to Use

  1. Drag an XML Time component from Components > XML onto your canvas
  2. Bind the datetime property to a date value from your CMS or data source
  3. The component outputs the date in ISO format (e.g., 2024-01-15T10:30:00.000Z)

Properties

Property Type Description
datetime Date/String The date value to convert. Accepts a JavaScript Date object, ISO string, or timestamp.
dateStyle String Controls the output format style for the date.

Example Usage

RSS Feed Item Date

When building an RSS feed with a Collection, use XML Time to format publication dates:

<item>
  <title>Article Title</title>
  <pubDate>
    <!-- XML Time outputs: 2024-01-15T10:30:00.000Z -->
  </pubDate>
</item>

Sitemap Last Modified

For XML sitemaps, XML Time ensures proper date formatting:

<url>
  <loc>https://example.com/page</loc>
  <lastmod>
    <!-- XML Time outputs the ISO date -->
  </lastmod>
</url>

Binding Dynamic Dates

To display dynamic dates from your CMS:

  1. Select the XML Time component
  2. In Settings, click the binding icon next to datetime
  3. Open the Expression editor
  4. Bind to your date field: Collection Item.publishedAt

Difference from Time Component

Component Output Use Case
Time Human-readable dates (e.g., "January 15, 2024") Displaying dates to users
XML Time ISO 8601 format (e.g., "2024-01-15T10:30:00.000Z") Machine-readable XML/RSS feeds

Technical Notes

  • XML Time renders the date string directly without any HTML wrapper
  • The ISO 8601 format is universally recognized by feed readers and XML parsers
  • Always ensure your source date is valid; invalid dates will produce unexpected output
  • XML Node – Create XML elements for feeds
  • Time – Display human-readable dates
  • Collection – Loop through data for feed items