Commit graph

41 commits

Author SHA1 Message Date
1f083fd12f
Update version comment from v0.4 to v0.6.0 2026-06-10 22:05:16 +07: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
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
4c8ca31651
fix: hidden categories now auto-switch to default instead of showing error
Two bugs fixed in navigateTo:

1. When a category has visibilityifnocontent: hidden (default) and the
   current page has no variant for it, the renderer now silently switches
   to the default category before fetching. Previously the category stayed
   active (kept visible in the selector via the activeCategory guard),
   the fetch failed, and an error page was shown.

2. The offline message stored in localStorage was shown for any failed
   fetch, not just genuine offline situations. Now gated on !navigator.onLine
   so missing pages always show pagenotfoundmessage instead.
2026-05-21 15:27:10 +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
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
2fd48fcb7f
Merge pull request #24 from kbenestad/main
Refactor sidebar behavior and add new favicon
2026-05-19 21:19:00 +07:00
Claude
a8fcc79ba9
Set page title from config.sitename instead of hardcoded MD-CMS
The static <title> element previously showed "MD-CMS" before JavaScript
loaded. The JS already sets document.title from config.sitename on boot,
so clearing the initial value ensures the browser tab never displays the
hardcoded string.
2026-05-19 08:37:16 +00:00
Claude
283e0f8299
Fix hamburger hidden on iOS: hide sidebar with visibility on mobile
iOS Safari can fail to honour transform: translateX(-100%) on position:fixed
elements, leaving the sidebar sitting over the content at z-index 100 and
blocking the mobile-header (z-index 50) that contains the hamburger.

Add visibility: hidden to the closed mobile sidebar. A transition-delay of
0.3s (matching the transform duration) keeps the slide-out animation intact —
the sidebar slides away first, then disappears. The open state resets the
transition immediately so the sidebar becomes visible before sliding in.

https://claude.ai/code/session_017r3kqm4FgEGy2DPPzYcLYQ
2026-05-19 07:22:06 +00:00
Claude
3ac0a89be1
Remove sidebar header and footer dividers from nav
https://claude.ai/code/session_017r3kqm4FgEGy2DPPzYcLYQ
2026-05-19 07:03:28 +00:00
Claude
51cb68c4f9
Merge branch 'main' of http://127.0.0.1:45849/git/kbenestad/mdcms into development 2026-05-19 06:58:52 +00:00
Claude
e1527d8e3b
Show category-less posts/pages in all categories
Files without a category suffix (e.g. post.md alongside post.en.md)
previously only appeared in the default category. They now appear in
every category, so untranslated content is always visible.

- mdcms.py: nav entries with a bare variant get `uncategorized: true`;
  search.json keeps `category: null` instead of mapping to default code
- index.html: pageShouldDisplay, posts filter, and category dropdown
  all treat uncategorized/null-category items as universally visible

https://claude.ai/code/session_01EzU13EL8D5Ud2ngQUKDj9e
2026-05-19 06:54:58 +00:00
Claude
cb0bc180a4
Remove default bold-on-hover from content links
Link hover bold was hardcoded to 700 in both light and dark root variables.
Users can opt in via `link-style-hover: ...:bold` in theme.yml.

https://claude.ai/code/session_01EzU13EL8D5Ud2ngQUKDj9e
2026-05-19 06:54:50 +00:00
cd02f43e82
Fix category font not reverting when switching to a no-font category (#23)
* Fix category picker and hamburger using page colours instead of nav colours

Both elements render against --bg-nav but were using --font-colour (the page
text colour). Switch to --nav-link-colour / --nav-section-heading-colour /
--nav-link-active-colour so they remain legible when nav-background is set to
a colour that contrasts with the page text colour (e.g. dark blue nav with
white nav-link text).

https://claude.ai/code/session_01MA8V1FvCmxjkCYyTxseaxB

* Fix category font not reverting when switching to a no-font category

maybeLoadCategoryFont applied a font-family to document.body but never
cleared it when switching to a category with no font defined. The inline
style overrides the CSS --font-body variable, so the category font
persisted indefinitely.

Fix: reset document.body.style.fontFamily to '' when the target category
has no font (letting --font-body take effect), and re-apply the family
string when switching back to an already-loaded font category.

https://claude.ai/code/session_01MA8V1FvCmxjkCYyTxseaxB

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-19 13:28:51 +07:00
c1d83b4bd6
Fix category picker and hamburger using page colours instead of nav colours (#22)
Both elements render against --bg-nav but were using --font-colour (the page
text colour). Switch to --nav-link-colour / --nav-section-heading-colour /
--nav-link-active-colour so they remain legible when nav-background is set to
a colour that contrasts with the page text colour (e.g. dark blue nav with
white nav-link text).

https://claude.ai/code/session_01MA8V1FvCmxjkCYyTxseaxB

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-19 13:25:29 +07:00
Claude
cef2318210
Merge remote-tracking branch 'origin/claude/per-category-font-styling-gUUzo' 2026-05-19 06:20:47 +00:00
Claude
237fae111a
Add per-category line-height support
Nastaliq and other complex scripts need significantly more vertical
space than Latin text. A new `line-height` key on any category entry
in config.yml overrides --line-height-body for that category and
restores the theme default when switching away.

https://claude.ai/code/session_01LZVnq4wUgdv5oXFLcj6qXf
2026-05-19 06:11:40 +00:00
Claude
a67d731700
Fix mobile hamburger not showing: replace inline-style+!important hack with a base CSS rule
The mobile header was hidden via mobileHeader.style.display='none' (inline style),
then a dynamically-injected <style> with !important was supposed to reveal it on mobile.
Inline styles and injected stylesheets interact inconsistently across browsers, making
the hamburger invisible on mobile in practice.

Replace with a simple CSS-only approach: add a base rule
'.layout-sidebar .mobile-header { display: none; }' so the existing media-query
'display: flex' override works through normal cascade — no inline style needed,
no !important injection needed.

https://claude.ai/code/session_01HRJsjppKZ2cpmNUAV2NXds
2026-05-19 04:12:45 +00:00
Claude
c77e423bdd
Change default font provider from Google to Bunny Fonts
Font specs without an explicit provider prefix now route to Bunny Fonts
instead of Google Fonts, avoiding Google CDN requests by default.

https://claude.ai/code/session_01PTQoBgxUeXHkZkdgHbafAE
2026-05-19 03:40:51 +00: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
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
4e66024be0
Fix sidebar header and theme toggle colours on accent-coloured nav backgrounds
Site name, site description, and dark/light mode toggle all used content-area
colour variables (--font-colour, --font-colour-muted, --divider) which clash
when nav-background differs from the page background. All three now reference
the nav colour variables (--nav-link-colour, --nav-link-active-colour,
--nav-section-heading-colour) with graceful fallbacks, so they remain legible
on any nav background colour without requiring new theme.yml keys.

https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 14:37:44 +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
Claude
7fa60aae59
Add full Apache 2.0 licence notice to all relevant files
- mdcms.py: expand abbreviated notice to full boilerplate
- app/index.html: fix version in comment header (v0.3.8 → v0.4)
- app/config.yml: add missing final two lines of notice
- app/theme.yml: add full licence notice (was missing entirely)

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-18 07:11:00 +00:00
Claude
6b2eb490fa
Bump to v0.4.0 — milestone release
- mdcms.py: CLI_VERSION 0.4.0, updated docstring and comment
- pyproject.toml: version 0.4.0
- app/index.html: site format marker → mdcms v0.4
- app/config.yml: site format marker → mdcms v0.4
- app/theme.yml: add site format marker mdcms v0.4

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-17 20:38:21 +00:00
Claude
020b05f1f6
Fix callout CSS: wire border-color and background to CSS variables
border-left was 4px solid without color; background was missing.
JS sets --callout-primary and --callout-bg on each callout element
but CSS wasn't referencing them.

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-17 19:21:25 +00:00
Claude
ad2f7b47ee
Fix phase7 index.html: restore main base, apply only PWA additions
Cherry-pick had auto-merged with wrong base (reverted TOC/callout CSS
and renderTocTag). Now uses main's index.html with only the three
phase7 additions applied on top: manifest link, SW registration
script, and offline-message localStorage handling.

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-17 19:15:56 +00:00
Claude
92615fad1c
v0.4 Phase 7: PWA support + bump to 0.3.8
- Add generate_pwa(): builds manifest.json (name, short_name, theme_color,
  standalone display, favicon icon) and service-worker.js with a
  cache-first strategy; cache name is versioned by a hash of the precache
  file list so new builds automatically invalidate old caches; precache
  list covers index.html, config.yml, nav.yml, search.json, theme file,
  and all pages/posts/assets
- Call generate_pwa() from run_build() when pwa: yes/true in config.yml
- index.html: add <link rel="manifest"> and SW registration script in
  <head>; both silently no-op when the generated files are absent
- index.html boot(): write offline-message from config to localStorage
  on every load so the message survives cache eviction
- index.html navigateTo(): show localStorage offline message when a page
  fetch fails instead of the generic not-found message
- Update CLAUDE.md with PWA config key reference

https://claude.ai/code/session_015XtsgTMi8UtmgxEgb5Qt2c
2026-05-17 19:10:19 +00:00
Claude
cd1e6e14ce
Fix missing icon broken image, clean up debug logs, expand test cases
- iconEl: use actual icon filename as <img src> fallback so browser
  shows a visible broken image when the file is missing (was src="")
- Remove debug console.log statements added for diagnosis
- home.md: add test cases for message: override (with console warning)
  and missing icon (broken image should render)
- home.md: add explanatory text for message: key test

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-17 18:27:41 +00:00
Claude
dd306b004c
Debug: add console.log to renderCalloutTag, set title color as inline style
Helps diagnose why title row is not showing. Logging shows the raw tag
data and whether the title branch is taken. Inline style bypasses any
CSS custom-property cascade issues.

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-17 18:08:37 +00:00
Claude
690965df7d
v0.4 Phase 4: callout tags
- Extend renderer.code to match `mdcms <type>` fence syntax (e.g. ```mdcms callout-info)
- Extend parseMdcmsTag to capture body lines after the key-value block
- Add renderCalloutTag: icon + title row, markdown body, colour CSS vars
- Add hexToRgba helper for low-opacity background colour
- Make themeConfig module-level so callout renderer can read callout defaults
- Add callout CSS: left border, title row flex layout, icon fill
- Add reusable message: key support with category-aware language resolution
- Add aitranslation callout message to config.yml for test
- Update home.md with full Phase 4 test cases

https://claude.ai/code/session_01UP8Wo2CKPNhvvTkzX48CWF
2026-05-17 17:43:27 +00:00
Claude
0386422a99
v0.4 Phase 2: local SVG icon system, remove Google Material Icons
- Add 17 SVG icons to app/assets/icons/ (Material Icons paths, Apache 2.0)
- Remove Google Material Icons and Symbols CDN link tags
- Add normaliseIconName(), loadIcon(), getIcon(), iconEl() — icon name
  normalisation per spec §2.3, async fetch-and-cache, sync accessor,
  element builder with broken-image fallback for missing icons
- Preload all standard icons (+ categories-selecticon if set) concurrently
  in boot() before UI is built, so all icon references are sync after that
- Replace ICONS object with icon cache system throughout:
  theme toggle → light_mode/dark_mode, search → search, hamburgers → menu,
  section toggles → arrow_right/arrow_drop_down, dropdown carets →
  arrow_drop_down, category selecticon → normalised SVG lookup
- Update .toggle-icon, .category-icon, .nav-caret CSS for SVG layout
- Add .mdcms-icon CSS class (inline-flex, currentColor fill)
- Fix pre-existing ICONS.close bug (was undefined; hamburger now always
  shows menu icon)

https://claude.ai/code/session_015XtsgTMi8UtmgxEgb5Qt2c
2026-05-17 17:19:33 +00:00
3c27e86cf2 Upodated docs 2026-05-17 22:23:07 +07:00
56c22f075d
Merge pull request #13 from kbenestad/claude/linux-install-docs-cwQsb
Claude/linux install docs cw qsb
2026-05-16 22:46:38 +07:00
Claude
6492329b27
v0.4 Phase 1: theme.yml — separate presentational config from config.yml
- Add app/theme.yml: colours (light/dark), semantic colours, callout
  defaults, fonts (with bunny: provider support), font-size, line-height,
  main-width, nav-width
- app/config.yml: add `theme: theme.yml` reference; remove font and
  layout keys that now live in theme.yml
- index.html: add applyThemeYml() that reads the new theme.yml format
  and derives all CSS custom properties (accent-rgb, nav-active-bg,
  nav-hover-bg, table-header-bg, link-colour) from the 5 user keys per
  mode; add --colour-info/warning/success/error CSS vars with hardcoded
  defaults; add --line-height-body CSS var
- index.html: update loadFonts() to accept themeConfig, support
  provider:name:weight format for Bunny Fonts and Google Fonts
- index.html: boot() fetches theme file named by config.theme, routes
  to applyThemeYml() for new format or applyConfigTheme() for legacy;
  falls back gracefully to hardcoded defaults when theme key is absent

https://claude.ai/code/session_015XtsgTMi8UtmgxEgb5Qt2c
2026-05-16 15:33:20 +00:00
Claude
71bda790ef
Overhaul topbar navigation with grouped dropdowns
Topbar now shows two item types intermixed by sort order:
- Unsectioned pages grouped by sort century: lowest sort = top-level
  link, others fold out in a dropdown beneath it
- Sections: appear as named triggers; pages fold out on hover/click;
  hidden sections require click to expand, visible sections also open
  on hover; draft sections excluded entirely

Desktop: hover or click to open dropdown, small ▾ caret indicates
nested items, parent link highlighted when a child page is active.
Mobile: slide-in panel with accordion expand/collapse per group,
+ / − toggle button on each group that has children.

https://claude.ai/code/session_013A4egzphocyto9bvZ76dxf
2026-05-09 14:03:11 +00:00
Claude
5e4612c01d
Update post listing tags to use created field throughout
Tag names changed from posts-date-*/posts-datetime-* to posts-created-*.
Renderer updated to filter, sort, group, and display using the created
field from search.json. Page meta display also updated to drop date/datetime
fallbacks. Samplesite posts and pages updated to match.

https://claude.ai/code/session_013A4egzphocyto9bvZ76dxf
2026-05-09 13:41:00 +00:00
Claude
24670a66dd
Rebuild mdcms as proper CLI tool (v0.3)
- Replace interactive TUI with click-based subcommands:
  register, delete, view, build
- build accepts NAME (registry), --path, or CWD for GitHub Actions use
- Switch to PyYAML for frontmatter and nav.yml parsing
- Add pyproject.toml with click + PyYAML deps and mdcms entry point
- Add v0.3 version marker to app/config.yml and app/index.html
- Registry moves to ~/.config/mdcms/sites.json (XDG-compliant)
- Project root is now the directory containing index.html (no website/ subdir)
- register auto-downloads template from GitHub if no site found

https://claude.ai/code/session_01MqEqGhP1guGx5VuFsLaws2
2026-05-08 16:05:04 +00:00
Claude
35c0b727e7
Rename website/ directory to app/
https://claude.ai/code/session_01MqEqGhP1guGx5VuFsLaws2
2026-05-08 15:29:54 +00:00
Renamed from website/index.html (Browse further)