Commit Graph

30 Commits

Author SHA1 Message Date
Peter Meier 00d42ebb42 feat(preview): consume rustycms live-preview drafts
Deploy / verify (push) Successful in 45s
Deploy / deploy (push) Successful in 1m1s
`?preview_draft=<sid>` on any page/post route forwards the signed
session id to the CMS, which renders the in-memory draft instead of
the persisted entry. Layout listens for `rustycms:reload` postMessages
from the admin iframe parent and re-runs `invalidateAll()` to pick up
fresh draft state. CSP `frame-ancestors` is set per-request when
`PUBLIC_PREVIEW_PARENT_ORIGIN` is configured so the admin iframe can
embed the response.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 09:24:05 +02:00
Peter Meier 3bc7273e71 perf(cms): batch layout bootstrap, sparse fieldsets, depth caps
Deploy / verify (push) Successful in 40s
Deploy / deploy (push) Successful in 1m16s
Adopt RustyCMS' new resolve semantics (_depth, _fields,
POST /_batch) where they pay off:

- +layout.server.ts: 4 sequential GETs (navHeader, navSocial,
  footer, page_config) collapsed into one batchFetch() call.
  Legacy "default" page_config slug stays as fallback Single-
  Batch only when the canonical slug is missing.
- New getPageStubs() / getPostStubs() use _fields= so the
  Slug→Label/Slug→URL maps don't pull body/rows. Typically
  10-50× smaller payload, eligible for the same TTL cache.
- loadPostsList() now requests posts with _depth=2 and a
  sparse fieldset that keeps card-level fields plus
  postImage.* and postTag.{name,icon,color,_slug}. Body
  Markdown stays out of the listing entirely.
- Page + post detail routes set _depth=3 as a cycle/blast-radius
  cap (page → block → image → img reaches in three levels).
- cms.ts: ContentGetOptions gains depth/fields, getPageBySlug /
  getPostBySlug / getPosts thread them through (cache key
  extended). New batchFetch() / batchData<T>() helpers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 22:00:10 +02:00
Peter Meier 3d343822e9 feat: print-friendly layout + comment count on every post overview
Deploy / verify (push) Successful in 42s
Deploy / deploy (push) Successful in 1m4s
- Hides Header / HeaderOverlay / Footer / TopBanner / Breadcrumbs and
  the comment accordion when printing. Action toolbar already had
  `print:hidden`.
- Adds @media print rules in app.css: 1.5cm page margins, 11pt body,
  forced black-on-white, expand link URLs after anchor text inside
  articles, keep images and headings together at page breaks.
- PostCard now renders the count pill whenever a value is known (incl.
  zero); previously hidden for `count === 0`, so posts whose comments
  are still pending always looked empty.
- Extracts the bulk-fetch helper to `lib/comment-counts.ts`
  (`fetchCommentCounts` + `postSlugForComments`) and uses it from both
  `BlogOverview` and `PostOverviewBlock`. Homepage / any page with a
  post_overview block now shows the badges too — previously only the
  paginated /posts/* routes did.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 15:29:15 +02:00
Peter Meier 6f14e4f150 style(post): polish post header + actions toolbar
Deploy / verify (push) Successful in 43s
Deploy / deploy (push) Successful in 1m4s
- PostActions: every item is a rounded-full pill with subtle border;
  the three icon-only actions (share/copy/print) cluster in one
  segmented control with divider lines, count + reading-time stand
  alone left and right
- Share button only renders when `navigator.share` is available so
  desktop doesn't get a duplicate of "Copy link"
- All action buttons drop their inline labels and use `title=` +
  `aria-label` for tooltip-only access; copy still flips icon to a
  checkmark for 1.5s on success
- Empty comment state stacks vertically on mobile (icon above), goes
  horizontal + left-aligned on ≥sm
- Post header rebuilt: image fixed at 150x150 (no more mobile blow-up),
  right column is `flex flex-col gap-3` so date/tags/actions share one
  rhythm instead of ad-hoc margins
- Reading-time now also walks `row*Content` and pulls `content`/`body`/
  `text` strings — Termin-Posts with empty body but markdown rows now
  show a meaningful estimate

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 15:08:04 +02:00
Peter Meier 6b2b7245f4 refactor: fold comment count into PostActions toolbar
CommentCountBadge was a separate component rendered next to PostActions
— two adjacent strips of buttons that should have been one toolbar.
Merges the count fetch + click-to-scroll behaviour into PostActions
behind `commentPageId` / `commentTargetId` props. The standalone
CommentCountBadge.svelte is now redundant; deleted.

Layout under the post hero is now a single row:
[💬 3]  [↗ Teilen]  [📋 Link]  [🖨️]  [⏱ 4 min]

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 14:52:30 +02:00
Peter Meier 3318fe9e17 feat(post): post actions toolbar (share / copy / print / reading time)
Adds a small toolbar next to the comment-count badge with four actions:

- Share — uses `navigator.share()` on supporting devices, falls back
  to copy-link otherwise
- Copy link — clipboard API with `<input>` + `execCommand` fallback,
  flashes a checkmark for 1.5s on success
- Print — `window.print()`, hidden via `print:hidden` so it doesn't
  show up in the printed output itself
- Reading time — server-computed from headline+body HTML at ~200 wpm,
  hidden when 0

Reading time + canonical URL come from `+page.server.ts` so SSR
output is identical and shareable URLs render correctly.

All labels go through the translations layer (5 new
`post_action_*` keys).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 14:42:16 +02:00
Peter Meier 8f45094f64 style(comments): move count badge under image, drop underline
Deploy / verify (push) Successful in 43s
Deploy / deploy (push) Successful in 1m3s
Repositions the CommentCountBadge out of the date row into its own
container below the post image. Removes hover colour-change + the
prose underline (`no-underline\!`) so the badge sits flat with the
post chrome.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 13:21:05 +02:00
Peter Meier febc027e6b feat: replace Cusdis with own comment plugin
Deploy / verify (push) Failing after 45s
Deploy / deploy (push) Has been skipped
Drops the Cusdis embed (postCommentSlot in pageConfig) in favour of the
new RustyCMS comment plugin. New Comments.svelte renders the thread,
form, replies and inline edit/delete via /api/comments. Count-badge near
the post date links to the accordion and uses /api/comments/:id/count.

Accordion gets a `lazy` mode so the comment iframe / fetch happens only
on first open (avoids the previous "empty on first render" issue with
hidden details).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 11:17:10 +02:00
Peter Meier ecff7b0bbf feat(images): cache-bust /cms-images URLs by post._updated
Deploy / verify (push) Successful in 40s
Deploy / deploy (push) Successful in 1m1s
Browser caches /cms-images responses immutably for a year. When the
editor changes a focal point or alt text, the underlying transform
output changes too, but the URL stays the same — so the browser keeps
serving the previous bytes. Manual hard-reloads and /api/cache/clear
help once but not for visitors who already have the file.

- RustyImageTransformParams gains an optional `version` that
  serializes as `_v` in the /cms-images URL.
- RustyImage.svelte takes a matching `version` prop and forwards it
  through `baseParams`, so every <picture> source carries the tag.
- The post thumbnail passes `post._updated` (truncated to seconds)
  as version. Each save bumps `_updated`, the URL changes, browsers
  re-fetch.

`_v` is intentionally not consumed by `/cms-images` — its sole job is
to break the browser cache key. The server-side image-cache and the
RustyCMS transform cache key both ignore it, so disk usage doesn't
balloon when the version tag changes.
2026-04-25 09:43:34 +02:00
Peter Meier bb9df1f9bd fix(post): align microformat block with PostEntry types for svelte-check
Deploy / verify (push) Successful in 37s
Deploy / deploy (push) Successful in 1m0s
Three CI typecheck failures from the previous microformat patch:

- post.created is the only date field in the schema (no _created on the
  generated PostEntry). Drop the _created fallback.
- postTag items can be a slug string OR a tag object. Type narrowing
  with `'name' in tag` widened to `never`; pull the name through an
  explicit `{ name?: string }` cast in @const so the iteration stays
  honest about the runtime shape.
- author isn't on PostEntry either; cast at the use-site for the
  hidden h-card author block.
2026-04-25 09:22:18 +02:00
Peter Meier 1ff4dc7a9a feat(api): POST /api/cache/clear + flush images on asset webhooks
Deploy / verify (push) Failing after 38s
Deploy / deploy (push) Has been skipped
Two changes:
- New POST /api/cache/clear (auth: REVALIDATE_TOKEN). Wipes the
  TTL content cache, the image disk + memory cache, and forwards to
  the RustyCMS /api/transform/cache/invalidate endpoint when an
  API key is configured. Single trigger to flush everything.
- /api/revalidate now also calls clearImageCache() on asset.* events
  so a re-upload (focal change, alt edit, replacement) doesn't keep
  serving the previous transformed image from disk.

clearImageCache() in image-cache.server.ts wipes the in-memory map
and removes every file under IMAGE_CACHE_DIR.
2026-04-25 09:20:48 +02:00
Peter Meier 7264ad6707 feat(post): emit VideoObject JSON-LD for embedded YouTube videos
Deploy / verify (push) Failing after 38s
Deploy / deploy (push) Has been skipped
Posts whose row*Content contains a `youtube_video` block now ship a
schema.org VideoObject per video alongside the existing BlogPosting /
Event JSON-LD. Lets Google attach a video rich-result to the post URL
(thumbnail, duration where available, embed/content URLs) instead of
treating the page as plain text whose body happens to be a single
iframe.

Thumbnail uses YouTube's predictable maxresdefault + hqdefault URLs;
upload date falls back to post.created when the embed has none.
2026-04-25 09:16:33 +02:00
Peter Meier 5b82d37be4 feat(post): add h-entry microformat + tag-name keywords fallback
Deploy / verify (push) Failing after 44s
Deploy / deploy (push) Has been skipped
Microformats:
- Wrap the post <article> in h-entry with p-name on the headline,
  p-summary on the subheadline (or sr-only fallback from excerpt),
  e-content on the rendered body, dt-published on the created date
  (hidden time element) and an invisible p-author h-card. Tag names
  are mirrored as hidden p-category entries so crawlers see them
  even though the visual Tags component already links them.
- itemscope/itemtype maps to schema.org BlogPosting (or Event when
  `isEvent`), aligning the invisible microdata with the existing
  JSON-LD.

Keywords:
- When post.seoKeywords is empty, fall back to the comma-joined tag
  names so <meta name="keywords"> still ships something meaningful.
2026-04-24 11:04:14 +02:00
Peter Meier 36288befe1 fix(post): render post.headline/subheadline when markdown body has no H1
Deploy / verify (push) Successful in 49s
Deploy / deploy (push) Successful in 1m6s
The article template only rendered the H1 it could pluck from the
markdown body (`contentHeadlineHtml`). Posts whose body opens with H2
(or no heading) silently lost both the schema-level `headline` and
`subheadline` — they were used in SEO/JSON-LD/breadcrumb only.

Fall back to the structured fields when no inline H1 is present.
2026-04-24 08:30:50 +02:00
Peter Meier 724b75b6bf feat(cms-images): forward dpr + format=auto to RustyCMS
Deploy / verify (push) Successful in 40s
Deploy / deploy (push) Successful in 1m2s
- Accept dpr query param (clamped 1..4) and include it in cache key so
  each density gets its own cached file.
- Accept format=auto and negotiate locally from the client's Accept
  header (avif > webp > jpeg) before building the cache key — concrete
  formats in the cache avoid cross-client leaks.
2026-04-23 13:36:38 +02:00
Peter Meier 50bb0ef398 feat(preview): implement preview mode for content management
Deploy / verify (push) Successful in 41s
Deploy / deploy (push) Successful in 1m3s
- Added support for a preview mode in the CMS, allowing draft content to be viewed without being indexed.
- Updated hooks and server logic to handle preview parameters, adjusting cache control and robots tags accordingly.
- Enhanced layout to display a preview notification when in preview mode, improving user experience for content editors.
2026-04-23 11:11:27 +02:00
Peter Meier 5b5ec7c659 feat: add FilesBlock interface and component integration
Deploy / verify (push) Successful in 46s
Deploy / deploy (push) Successful in 1m8s
- Introduced FilesBlockItem and FilesBlockData interfaces to support file handling in the CMS.
- Integrated FilesBlock component into ContentRows.svelte for rendering file blocks.
- Updated block type handling to include support for files, enhancing content versatility.
2026-04-22 10:23:20 +02:00
Peter Meier a18c0a8cf7 feat(post-page): separate headline and body content for improved rendering
Deploy / verify (push) Successful in 45s
Deploy / deploy (push) Successful in 59s
- Extracted headline and body content from the post's HTML, allowing for distinct rendering of the headline and body in the post page.
- Updated the Svelte component to display the extracted headline and body content separately, enhancing the layout and readability of posts.
2026-04-19 21:56:30 +02:00
Peter Meier 2e0601e178 feat(post-page): implement script execution for dynamic content rendering
Deploy / verify (push) Successful in 42s
Deploy / deploy (push) Successful in 1m11s
- Added `executeScripts` function to handle script elements within the comment slot, ensuring proper execution of inline scripts.
- Updated the comment slot container to utilize the new script execution functionality, enhancing dynamic content handling.
2026-04-19 13:52:29 +02:00
Peter Meier 62d25202a6 feat(deadline-banner): auto mode pulls all calendar_items globally
Deploy / verify (push) Successful in 40s
Deploy / deploy (push) Successful in 59s
Auto-mode deadline_banner now resolves to the next future event across
all calendar_items in the CMS instead of requiring a manually-curated
items[] pool. Server load hooks (+page.server.ts for /, /[...slug],
/post/[slug]) call resolveDeadlineBannerBlocks which fetches the
global calendar_item list once and attaches it as items[] when mode
is "auto" and items[] is not already resolved. Component logic
unchanged — it still picks the soonest future entry.

Also:
- cms.ts: getCalendarItems() bulk list fetcher
- PostOverviewBlock.svelte: design defaults to "cards" when value is
  empty string (not just null/undefined) so existing entries with
  design: "" render

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 11:02:50 +02:00
Peter Meier 597b920e7c feat(quote-carousel): add QuoteCarouselBlock component and related types
Deploy / verify (push) Successful in 41s
Deploy / deploy (push) Successful in 1m1s
- Introduced a new QuoteCarouselBlock component for displaying rotating quotes.
- Added QuoteCarouselBlockData interface to define the structure of the quote carousel data.
- Updated existing components and types to integrate the new quote carousel functionality.
- Enhanced blog-utils to support filtering posts by tags more effectively.
- Made various UI improvements in the Footer and PostCard components for better user experience.
2026-04-18 13:19:59 +02:00
Peter Meier b08c64eb38 feat(seo): add keywords meta tag support for improved SEO
Deploy / verify (push) Successful in 37s
Deploy / deploy (push) Failing after 58s
- Introduced keywords property in layout and page server files to enhance SEO capabilities.
- Updated relevant components to include keywords in meta tags for better search engine visibility.
2026-04-18 12:28:13 +02:00
Peter Meier da294010c8 feat: update site URLs and enhance image handling
Deploy / verify (push) Successful in 50s
Deploy / deploy (push) Failing after 1m3s
- Changed site URLs in docker-compose and deployment configurations to remove "www" prefix for consistency.
- Improved image handling by introducing warmPostCardImages function for pre-fetching images in posts and tags.
- Enhanced PostCard component with responsive image sizes for better performance.
- Updated layout to include robots meta tag and JSON-LD structured data for improved SEO.
- Added loading state for images in TopBanner component to enhance user experience.
2026-04-18 12:25:45 +02:00
Peter Meier a2f2d5bfb0 feat(image): enhance image handling with new properties and responsive support
Deploy / verify (push) Successful in 41s
Deploy / deploy (push) Successful in 1m2s
- Updated PostEntry type to include _rawImageUrl and _imageFocal for improved image management.
- Refactored image handling in various components to utilize the new properties, ensuring better focal point support and responsive image rendering.
- Introduced warmResponsiveImage function for pre-fetching image variants to optimize loading performance.
- Replaced CmsImage component with RustyImage in multiple blocks for consistent image processing.
2026-04-18 08:43:17 +02:00
Peter Meier a139372ce2 feat(image): enhance image handling with focal points and responsive support
Deploy / verify (push) Failing after 14s
Deploy / deploy (push) Has been skipped
- Added support for extracting focal points and alt text from CMS image fields.
- Introduced responsive image handling in TopBanner component, allowing for AVIF/WebP sources and LQIP placeholders.
- Updated image transformation functions to accommodate focal point parameters for better cropping.
- Refactored image URL resolution logic across various components and routes to utilize new image field structure.
2026-04-18 00:42:33 +02:00
Peter Meier 4d79bf08da feat(revalidate): accept X-Webhook-Secret header for RustyCMS webhooks
Deploy / verify (push) Successful in 34s
Deploy / deploy (push) Successful in 54s
RustyCMS now sends its optional shared secret as X-Webhook-Secret. Keep
existing X-Revalidate-Token + ?token= query param for compatibility.
2026-04-17 23:49:57 +02:00
Peter Meier da340530ee feat(analytics): pull pm86 site-id from CMS page_config, drop env var
Deploy / verify (push) Successful in 39s
Deploy / deploy (push) Successful in 54s
- +layout.server: expose pageConfig.analyticsPm86SiteId on layout data
- +layout.svelte: inject analytics.pm86.de script when CMS value present
- +error.svelte: light 404 page with wald-700 accent, dropped dark gradient
- .env.example + deploy.yml: remove PUBLIC_ANALYTICS_PM86_SITE_ID
2026-04-17 23:21:45 +02:00
Peter Meier 78b358e10f ui: redesign 404 page with branded hero and dual CTAs
Deploy / verify (push) Successful in 38s
Deploy / deploy (push) Successful in 54s
2026-04-17 23:05:01 +02:00
Peter Meier f328989aa8 seo: enforce trailing slash on all URLs
Deploy / verify (push) Successful in 37s
Deploy / deploy (push) Successful in 55s
- Set trailingSlash='always' globally via root layout.
- Update postHref, pageHref, Pagination, tag/breadcrumb hrefs, blog→posts
  redirects to emit trailing slash.
- Match old Astro canonical so indexed URLs hit 200 directly instead of
  308-redirect.
2026-04-17 22:23:16 +02:00
Peter Meier 2fef91a548 Initial SvelteKit frontend port of windwiderstand.de
Deploy / verify (push) Failing after 32s
Deploy / deploy (push) Has been skipped
Full parity with Astro site: content rows, post/tag routes, pagination,
event badges + OSM map, comments, Live-Search via /api/search-index,
CMS image proxy, RSS, sitemap.

Deploy: Dockerfile + docker-compose.prod.yml + Gitea Actions workflow
to build + push to git.pm86.de registry and ssh-deploy to Contabo.
2026-04-17 22:01:30 +02:00