Commit graph

47 commits

Author SHA1 Message Date
Claude
ab2ef3b4c9
Add mdcms serve and clean-URL hosting documentation
- New `mdcms serve` command: local preview server with SPA clean-URL
  fallback. Unknown extension-less paths (e.g. /section-id) are served
  index.html so reloads and shared clean URLs work; paths with an
  extension still 404, preserving the renderer's category-variant
  fallback. Serves .md as text/markdown and .yml as text/yaml.
  Options: [name], --path, --port (default 8800), --bind.
- New docs/hosting.md: explains why clean URLs 404 on plain static
  hosts and documents the fix per environment (mdcms serve, service
  worker, GitHub Pages 404.html, Netlify/Cloudflare _redirects, nginx,
  Apache, Caddy), plus a standalone Python preview script.
- Update stale boot error message in index.html to point at
  `mdcms serve` instead of the removed "option 8".
- Update CLAUDE.md command table and local-preview note.

https://claude.ai/code/session_018KXUwmSNMGF2UBywTChCcS
2026-06-12 10:12:53 +00:00
Claude
a5127727f0
Enable Back button and fix clean-URL reloads
Renderer (app/index.html):
- navigateTo now pushes a history entry for user navigations (pushState),
  while the initial load, back/forward (popstate/hashchange), and category
  re-renders still replaceState. The browser Back button now returns to the
  previous page instead of leaving the site.

Service worker (mdcms.py generator + app/service-worker.js):
- Serve the cached index.html app shell for navigation requests. Reloading a
  clean URL like /section-id previously 404'd on the static host before any
  JavaScript ran; the shell fallback lets the client-side router resolve the
  path. Also makes pretty-URL reloads work offline.

https://claude.ai/code/session_018KXUwmSNMGF2UBywTChCcS
2026-06-12 07:16:12 +00:00
Claude
df0f179004
Fix renderer XSS/routing bugs and restore CLI fetch-deps
Renderer (app/index.html):
- Guard the router so navigateTo and the hashchange/popstate handlers only
  load relative .md paths (isSafePagePath). Blocks fetching attacker-
  controlled external URLs injected via the location hash.
- Stop treating in-page heading anchors (#heading) as page files, which
  previously replaced the page with a 404.
- HTML-escape meta.title, link href/title attributes, not-found/offline
  messages, and the icon fallback img; block javascript:/data: hrefs via
  safeUrl.
- Hydrate mdcms tags nested inside tabs/accordions/callouts.
- Configure marked once instead of on every render.
- Validate stored theme value; fix text-align center; resolve per-category
  offline message after categories initialise.

CLI (mdcms.py):
- Restore CDN_DEPS, _WOFF2_URL_RE, _fetch_bunny_fonts, _patch_index_html so
  fetch-deps no longer raises NameError.
- Compare site markers against SITE_FORMAT_VERSION with zero-padded version
  comparison, removing the spurious "update available" warning on v0.6 sites.
- Bump CLI to 0.6.1.

https://claude.ai/code/session_018KXUwmSNMGF2UBywTChCcS
2026-06-12 07:07:15 +00:00
Claude
8e7f5d3ae9
feat: mdcms build writes mdcms.json; register accepts URLs
mdcms build now calls generate_site_manifest() at the end of every build,
writing mdcms.json to the site root. This file lists all deployable files
and empty directories, and is deployed alongside the site so any mdcms
user can register a copy of the site from its URL.

mdcms register now accepts a GitHub repo URL or plain HTTPS URL as PATH
or via --from. GitHub URLs try mdcms.json (raw content) first and fall
back to the Contents API tree-walk. Plain URLs require mdcms.json to be
present and fail with a clear error if it is not found.

- generate_site_manifest() added; called at end of run_build
- download_template(dest, source=None) dispatches on source type
- _parse_github_url() extracts owner/repo/branch/subpath from GitHub URLs
- _fetch_manifest() / _apply_manifest() handle the manifest protocol
- _download_tree_api() retained as GitHub Contents API fallback
- _http_get_github() carries Accept header for Contents API responses
- MANIFEST_FILENAME = "mdcms.json"; GITHUB_URL_RE added
- app/template-manifest.json replaced by app/mdcms.json
- register command: PATH accepts URL; --from option added

https://claude.ai/code/session_01Ai8xRvmrzdhuTKiRQ2fnn9
2026-06-07 18:00:24 +00:00
Claude
e559e67341
feat: manifest-driven template download
Replace the GitHub Contents API tree-walk with a flat manifest approach.
template-manifest.json lists every file and empty directory in the starter
template; download_template() fetches the manifest then pulls each file
directly as a raw URL, sidestepping git API rate limits and making the
template hostable from any HTTP source.

- GITHUB_CONTENTS_API / _github_get / _download_tree removed
- TEMPLATE_BASE_URL + TEMPLATE_MANIFEST constants added
- _http_get() replaces _github_get() (generic, no GitHub headers)
- download_template() accepts optional base_url for custom sources
- app/template-manifest.json added (v0.4, 35 files, 2 empty dirs)
- Generated files (manifest.json, service-worker.js, search.json)
  excluded from manifest — they belong to mdcms build output, not
  the starter template

https://claude.ai/code/session_01Ai8xRvmrzdhuTKiRQ2fnn9
2026-06-07 17:41:07 +00:00
Claude
31330d19e2
feat: clean URLs for section-id pages
Pages whose filename matches a nav section-id now get a clean pathname
URL (e.g. /timesheet) instead of the hash-based /#pages/timesheet.md.

- _initialPathname captured at IIFE start; handles ?_route= from 404.html
- basePath determined by initBasePath() after nav data loads; subpath
  deployments (e.g. /mysite/) handled automatically
- navigateTo() uses replaceState to /slug for section-id pages and falls
  back to #hash for everything else
- popstate listener handles browser history if a clean URL was the entry
- resolveSlugToFile() validates that slug is both a section code and has
  a pages/{slug}.md entry in navData
- app/404.html added for GitHub Pages SPA routing

https://claude.ai/code/session_01Ai8xRvmrzdhuTKiRQ2fnn9
2026-06-07 17:23:30 +00:00
Claude
ee3a967b86
docs: add tabs and accordion reference to reference-pages.md
Documents all four block types (tab-underline, tab-filled,
accordion-underline, accordion-filled and their aliases) with
per-item key tables and worked examples, in the same style as
the existing callout/toc/posts-* sections.

https://claude.ai/code/session_01SFMh7PDxJjvvo5dYbCCFFs
2026-05-21 16:56:44 +00:00
Claude
a09df3a63c
Add tabs and accordion content components to index.html
Implements four new mdcms fenced-block types:
  tab-underline / tab, tab-filled,
  accordion-underline / accordion, accordion-filled

Each block reads items: from a YAML body. Tab state and accordion
open/close are managed with aria-selected / aria-expanded and
data-open attributes. Markdown content inside each item is rendered
with the same pipeline as the surrounding page.

Adds computeDerivedTokens() — called on every applyTheme() — which
computes --mdcms-bar, --mdcms-filled-bg/border/fg, --mdcms-strip-border
from the active palette. Uses HSL chroma (S × (1-|2L-1|)) instead of raw
HSL S for the bold-nav heuristic, avoiding a false-positive on near-white
nav colours like the default #F8FAFC.

Adds app/pages/tabs-accordions.md as a visual test page and
docs/unreleased.md to track this change ahead of the next release.

https://claude.ai/code/session_01SFMh7PDxJjvvo5dYbCCFFs
2026-05-21 16:41:27 +00:00
Claude
5f3175497b
Merge branch claude/update-config-docs-NnldI into development 2026-05-21 15:07:09 +00:00
Claude
ef4197fa83
feat: add visibilityifnocontent per-category config key
When set to visible, the category always appears in the selector
even when no variant exists for the current page. Navigating to
such a page shows pagenotfoundmessage with no fallback to
default-category content. Default behaviour (hidden) is unchanged.

Updates pageShouldDisplay and visibleCategoryCodesForCurrentPage
to honour the new key alongside the existing notfoundmessage logic.
Docs updated with key description, summary table, and full example.
2026-05-21 15:02:31 +00:00
Claude
cc4ed7b881
docs: add missing per-category config keys to reference-config.md
Documents all keys that can appear under default-category and
categories entries: message, name-latin, notfoundmessage,
pagenotfoundmessage, font, and line-height. Adds a summary table
and updates the full example to show these keys in context.
2026-05-21 14:46:46 +00:00
a939883bef
Clarify markdown usage in reference pages
Update documentation to clarify markdown usage.
2026-05-21 12:14:37 +07:00
80877cbaea
Fix markdown syntax in reference pages documentation
Correct markdown formatting for code blocks and frontmatter.
2026-05-21 12:14:14 +07:00
7ab7d468e5
Improve markdown structure in reference pages
Update markdown formatting and clarify frontmatter section.
2026-05-21 12:13:45 +07:00
Claude
b9410d4b88
Fix two bugs: SPA-routing page load failure and stale service worker
fetchPageFile now rejects text/html responses so servers with SPA routing
(e.g. Cloudflare Pages with /* /index.html 200) no longer trick the renderer
into treating a fallback index.html as a found markdown file. Category-variant
pages (page.current.md with no plain page.md) now fall through correctly to
their variant URL.

mdcms build now writes a self-unregistering service-worker.js when pwa: no,
evicting any stale caching worker left over from a previous pwa: yes build.
manifest.json is also removed when pwa: no.

https://claude.ai/code/session_01Xs5GyREFhjWxhS1UhW2wA8
2026-05-19 14:55:51 +00:00
Claude
431b1c054c
Fix: raise on config.yml parse errors instead of silently returning empty dict
A YAML parse error in config.yml (e.g. a stray tab character) caused
read_config to swallow the exception and return {}, disabling categories
and producing a broken nav.yml with no variants fields and wrong filenames.
read_config now raises ClickException on both OSError and YAMLError.

Documented in docs/knownbugs.md and docs/unreleased.md.

https://claude.ai/code/session_01Xs5GyREFhjWxhS1UhW2wA8
2026-05-19 14:15:38 +00:00
Claude
28b248735f
Patch <title> in index.html with sitename during build
mdcms build now writes the sitename from config.yml into the <title> tag
of index.html. WhatsApp, Slack, and other link-preview crawlers read the
static HTML without executing JavaScript, so the title must be correct in
the raw file. Previously it was blank (or "MD-CMS" in older templates).
2026-05-19 08:37:57 +00:00
Claude
11dc053118
Scope uncategorized-post fix to posts/ only
Pages without a category suffix still map to the default category.
Only posts/ files without a suffix get uncategorized: true in nav.yml
and category: null in search.json.

https://claude.ai/code/session_01EzU13EL8D5Ud2ngQUKDj9e
2026-05-19 07:00:36 +00:00
Claude
1279b8035d
Add unreleased.md documenting development-only changes
https://claude.ai/code/session_01EzU13EL8D5Ud2ngQUKDj9e
2026-05-19 06:57:12 +00:00
Claude
8c4486a1f8
Update docs: default font provider is now Bunny Fonts
https://claude.ai/code/session_01PTQoBgxUeXHkZkdgHbafAE
2026-05-19 03:41:44 +00:00
cfe11cd24b
Add banner for latest version notification 2026-05-18 22:20:48 +07:00
f08e8d896a
Update version message in v0.3.2 banner 2026-05-18 22:20:21 +07:00
Claude
bcb451a9ee
Merge development: update reference-theme.md with all new theme.yml keys
https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 15:16:45 +00:00
f836e320b3 Update reference-theme.md with all new theme.yml keys (nav colours, semantic-dark, toggle icons)
Adds documentation for:
- nav-link, nav-link-active, nav-section-heading (per mode)
- nav-sitename, nav-description, nav-toggle (per mode)
- divider (per mode, auto-derived by default)
- colours-semantic-dark (dark mode semantic colour overrides)
- nav-section-expand-icon / nav-section-collapse-icon (top-level toggle icons)

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 22:15:13 +07:00
Claude
737049f19e
Add configurable nav section toggle icons
Two new top-level theme.yml keys — nav-section-expand-icon and
nav-section-collapse-icon — replace the hardcoded arrow_right/arrow_drop_down
used on collapsible nav sections. Defaults preserve existing behaviour.

Eight new icon SVGs added to app/assets/icons/:
  keyboard_arrow_right / keyboard_arrow_down     (chevrons)
  keyboard_double_arrow_right / keyboard_double_arrow_down
  expand_content / collapse_content              (corner arrows)
  add / minimize                                 (plus/minus)

All eight added to STANDARD_ICONS so fetch-deps bundles them correctly.
CLAUDE.md key reference and docs/claude-design.md updated with the full
icon catalogue, pairing guidance, and style notes for Claude Design.

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 15:08:59 +00:00
Claude
648f1afcfd
Add legibility analysis section to Claude Design guide
Documents every colour pairing to check, WCAG contrast targets for each
role, and common failure modes (saturated accents, muted text on tinted
backgrounds, dark-mode text-muted). Checklist expanded with contrast items.

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 14:58:26 +00:00
Claude
f4a41ed3ae
Add nav-sitename, nav-description, nav-toggle colour keys
Separates sidebar header colours from nav link colours. The three new keys
control the site name, site description, and dark/light toggle independently,
each cascading from the nearest nav variable (nav-sitename → nav-link,
nav-description and nav-toggle → nav-section-heading) so existing themes
are unaffected.

Enables Claude Design to fine-tune sidebar header legibility on saturated or
bold nav backgrounds without having to override the nav link colours, and vice
versa. CSS selectors and applyThemeYml() updated; app/theme.yml, CLAUDE.md,
and docs/claude-design.md updated with full key reference and pattern examples.

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 14:47:28 +00:00
Claude
1d76226311
Document nav colour key requirement for saturated and dark nav backgrounds
Clarifies that nav-link, nav-link-active, and nav-section-heading affect not
just nav links but also the site name, description, and theme toggle — all
sidebar elements that inherit from these variables. Adds a rule of thumb for
when to set the keys explicitly (saturation >20%, or lightness outside the
neutral range).

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 14:43:04 +00:00
Claude
f2bc729e40
Derive --divider via color-mix; add explicit divider key as escape hatch
--divider in both light and dark modes now auto-derives from the theme's
background and text colours using color-mix(in srgb, bg 85%, text), so
accent-coloured or custom-background themes get a correct divider without
any extra config. An explicit `divider` key in theme.yml overrides this
for the rare cases where exact control is needed.

docs/claude-design.md and CLAUDE.md updated accordingly.

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 11:09:06 +00:00
Claude
923626855f
Add nav-link colour keys and per-mode semantic colours to theme system
- New theme.yml keys: nav-link, nav-link-active, nav-section-heading (per
  light/dark mode). Fixes themes where nav-background equals accent, which
  made active nav links invisible against their own background.
- New colours-semantic-dark block overrides callout semantic colours in dark
  mode only, preventing washed-out callout borders and backgrounds on dark
  page backgrounds.
- CSS: nav item and section heading selectors now use the new CSS variables
  with graceful fallbacks to existing defaults — no breakage for themes that
  don't set the new keys.
- app/theme.yml starter updated with new keys (commented examples) and
  sensible colours-semantic-dark defaults.
- CLAUDE.md updated with full key reference table and guidance on when to
  use nav colour overrides.
- docs/claude-design.md: new authoring guide for Claude Design covering
  contrast rules, nav pattern examples, and a pre-publish checklist.

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 10:37:35 +00:00
9ea0c0cc55
Adjust paths for MD-CMS multisite workflow
Updated paths and git commands for multisite configuration in the workflow.
2026-05-18 17:00:16 +07:00
c7ddf32720
Enhance GitHub Actions workflow and permissions
Updated GitHub Actions workflow to include permissions and modified installation command for mdcms. Changed directory handling for building sections to use a loop instead of hardcoded values.
2026-05-18 16:57:01 +07:00
Claude
f9f3b9b81b
Add full reference doc for page frontmatter and mdcms tags
Covers all frontmatter fields, all mdcms code-block tag types
(callout-*, toc, posts-created-*), tag options, raw HTML behaviour,
and a full example page.

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-18 09:17:24 +00:00
Claude
74681670d7
Add full reference docs for theme.yml, config.yml, and nav.yml
All keys, all values, usage instructions, and full examples for each file.

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-18 08:44:35 +00:00
3c27e86cf2 Upodated docs 2026-05-17 22:23:07 +07:00
bcf716bfd0 Update v0.3.2.txt 2026-05-16 22:25:53 +07:00
a17cfc6f1a Updated to v0.3.2. 2026-05-16 22:25:19 +07:00
6dc83e176d Updated to v0.3.2. 2026-05-16 22:22:19 +07:00
b1b64917cf Updated banner for v0.3.1 2026-05-16 21:58:22 +07:00
fb1b7e6ee4 Updated install.md
Added instructions on CLI installation for Linux, Mac, and Windows.
2026-05-16 21:53:14 +07:00
767b370202 Overhauled downloads, started fixing docs. 2026-05-16 21:19:35 +07:00
22f95cd633
Add placeholder text to README.md 2026-05-10 09:01:45 +07:00
95eec13611 Fix install.md: install from GitHub until mdcms is on PyPI 2026-05-09 01:19:53 +07:00
8f8e6b7734
Update release checklist with version bump instructions
Added instructions for updating the version number and committing changes before tagging a release.
2026-05-08 23:45:24 +07:00
01341db24b
Add installation and setup guide for mdcms
This guide details the installation of mdcms, site registration, local builds, and GitHub Actions setup for automatic updates.
2026-05-08 23:34:34 +07:00
0d0dfa7268
Add release guide for mdcms
This guide provides detailed steps for releasing a new version of mdcms, including prerequisites, setup, version bumping, tagging, and monitoring the build process.
2026-05-08 23:34:06 +07:00
Claude
bd3001c74e
Rename resources/ to docs/
https://claude.ai/code/session_01MqEqGhP1guGx5VuFsLaws2
2026-05-08 16:22:42 +00:00