[publish-script-template-download] fix dropped frontmatter + add namuthaj AR template - #125
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Bug: publish-draft.mjs silently drops unlisted frontmatter
buildPublishedFrontmatter()is an explicit field allowlist. My newtemplate_download_href/template_download_labelfields (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 publishesapp/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) tonamuthaj-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
--rtlflag onscripts/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 tostr.isupper()(correctlyFalsewhen there's no cased character at all) plus a trailing-bare-colon heuristic for label-style headers (جدول الأعمال:) -- works for both languages now.Verified
tsc --noEmitcleannext buildsucceedshref(/downloads/meeting-minutes-template.docx,/downloads/namuthaj-mahdar-ijtimaa-template.docx)🤖 Generated with Claude Code