Skip to content

[publish-script-template-download] fix dropped frontmatter + add namuthaj AR template - #125

Merged
Smetools merged 1 commit into
mainfrom
hassan/publish-script-template-download
Jul 8, 2026
Merged

[publish-script-template-download] fix dropped frontmatter + add namuthaj AR template#125
Smetools merged 1 commit into
mainfrom
hassan/publish-script-template-download

Conversation

@Smetools

@Smetools Smetools commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Bug: publish-draft.mjs silently drops unlisted frontmatter

buildPublishedFrontmatter() is an explicit field allowlist. My new template_download_href/template_download_label fields (PR #113) weren't in it, so the just-merged how-to-do-meeting-minutes post went live without its download card -- the frontmatter pointer got stripped even though the .docx asset itself shipped fine.

Fixed:

  • scripts/publish-draft.mjs -- passthrough the two fields for future publishes
  • app/content/blog/how-to-do-meeting-minutes.md -- patched directly (already-published file, script fix doesn't retroactively apply)

Namuthaj: same treatment, per Hassan

Adds template_download_href/label + a real downloadable RTL .docx (app/public/downloads/namuthaj-mahdar-ijtimaa-template.docx) to namuthaj-mahdar-ijtimaa-ar (the AR محضر money-page), replacing the now-fixed-but-still-inline <pre> block with a pointer paragraph + the tracked download card.

New --rtl flag on scripts/gen-template-docx.py (right-align + bidi paragraph direction -- python-docx has no high-level API for this, done via oxml).

Also fixed a second bug caught while building this: the heading-detection heuristic (line == line.upper()) is a no-op on uncased scripts, so every Arabic line matched "ALL CAPS heading." Switched to str.isupper() (correctly False when there's no cased character at all) plus a trailing-bare-colon heuristic for label-style headers (جدول الأعمال:) -- works for both languages now.

Verified

  • tsc --noEmit clean
  • next build succeeds
  • Both posts' static HTML confirmed to render the tracked download card with the correct href (/downloads/meeting-minutes-template.docx, /downloads/namuthaj-mahdar-ijtimaa-template.docx)

🤖 Generated with Claude Code

…er; add namuthaj AR template

publish-draft.mjs's frontmatter transform is an explicit allowlist -- it
silently stripped the new template_download_href/label fields on merge,
so how-to-do-meeting-minutes went live without its download card. Fixed
the script for future publishes and patched the already-published file
directly (asset itself was untouched, only the frontmatter pointer to it
got dropped).

Also: per Hassan, add the same tracked-download template to
namuthaj-mahdar-ijtimaa-ar (the AR محضر money-page) -- generates a real
RTL .docx via gen-template-docx.py --rtl (new flag: right-aligns +
sets bidi paragraph direction, python-docx has no high-level API for
this). Fixed a second bug found while building it: the heading-detection
heuristic (`line == line.upper()`) is a no-op on uncased scripts, so
every Arabic line would have matched "ALL CAPS heading" -- switched to
Python's `str.isupper()` (correctly False with no cased chars present)
plus a trailing-bare-colon heuristic for label-style Arabic headers.

Verified: tsc clean, `next build` succeeds, both posts' static HTML
confirmed to render the tracked download card with the correct href.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
knowcap-landing Ready Ready Preview, Comment Jul 8, 2026 12:01pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Smetools, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: de705715-aa4f-4a4c-a46f-2848d62d3061

📥 Commits

Reviewing files that changed from the base of the PR and between d9fa4d5 and 2889760.

⛔ Files ignored due to path filters (1)
  • app/public/downloads/namuthaj-mahdar-ijtimaa-template.docx is excluded by !**/*.docx
📒 Files selected for processing (4)
  • app/content/blog/how-to-do-meeting-minutes.md
  • app/content/blog/namuthaj-mahdar-ijtimaa-ar.md
  • scripts/gen-template-docx.py
  • scripts/publish-draft.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hassan/publish-script-template-download

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Smetools
Smetools merged commit 3f3460b into main Jul 8, 2026
3 checks passed
@Smetools
Smetools deleted the hassan/publish-script-template-download branch July 8, 2026 12:02
@Smetools
Smetools restored the hassan/publish-script-template-download branch July 8, 2026 12:04
@Smetools
Smetools deleted the hassan/publish-script-template-download branch July 8, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant