Commit graph

147 commits

Author SHA1 Message Date
099320cde7
Create .gitkeep 2026-05-21 23:21:43 +07: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
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
0bf8cf319b
Merge branch claude/config-sitename-title-Dmzsl into development
Picks up blank <title></title> in app/index.html template (cleaner than
the hardcoded MD-CMS value; mdcms build overwrites it with sitename on
every build either way).

https://claude.ai/code/session_01Xs5GyREFhjWxhS1UhW2wA8
2026-05-19 14:23:19 +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
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
893588d89b Updated themes, 2026-05-19
New folder structure plus HTML presentation.
2026-05-19 20:20:10 +07:00
03adf65c62 Merge branch 'main' of https://github.com/kbenestad/mdcms 2026-05-19 15:52:09 +07:00
65c4944a84 New standard favicon added. 2026-05-19 15:52:06 +07:00
Claude
7b2d54da57
Update CLAUDE.md: document <title> patching in run_build 2026-05-19 08:38:19 +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
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
ee3d4872a0
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:31:47 +00:00
Claude
269980ea28
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:27:53 +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
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
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
d63fc0035f
Document unreleased.md as a living changelog for development
https://claude.ai/code/session_01EzU13EL8D5Ud2ngQUKDj9e
2026-05-19 06:58:41 +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
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
aa9ea34683
Enforce two-branch policy in CLAUDE.md: main + development only
Non-canonical branches must be deleted immediately after merging.

https://claude.ai/code/session_01R4b6mihSGtCUzyW4Sd5jzM
2026-05-19 06:22:06 +00:00
Claude
24f428d8d3
Merge remote-tracking branch 'origin/main' into development 2026-05-19 06:20:58 +00:00
Claude
cef2318210
Merge remote-tracking branch 'origin/claude/per-category-font-styling-gUUzo' 2026-05-19 06:20:47 +00:00
Claude
a4eb1c25fe
Merge remote-tracking branch 'origin/development' into development 2026-05-19 06:17:46 +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
b69af5dfa2
Merge claude/investigate-google-fonts-ijYrT: default font provider to Bunny Fonts
https://claude.ai/code/session_01PTQoBgxUeXHkZkdgHbafAE
2026-05-19 03:41:52 +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
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
da7d33ccc2
Merge main into development — sync
https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 15:21:22 +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
6b491846d7
Merge main into development — sync all theme system changes
https://claude.ai/code/session_01NQKywehSj8Ku4yKhwB4VNB
2026-05-18 15:16:56 +00: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
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