Skip to content

chore(refactor): start using handlebars partials - #81

Merged
SethFalco merged 1 commit into
jsonresume:mainfrom
SethFalco:partials
May 6, 2026
Merged

SethFalco merged 1 commit into
jsonresume:mainfrom
SethFalco:partials

Conversation

@SethFalco

@SethFalco SethFalco commented May 6, 2026 •

Copy link
Copy Markdown
Member

See commit message.


In theory, this should change nothing for end users. At most, just some of the underlying HTML elements and CSS classes assigned. But the exported CV will visually look identical.

The output HTML is a bit leaner too which is nice, the fixture in the repository goes from 6.5 kB to 6.2 kB. 💪(•ᴗ•💪)

Summary by CodeRabbit

Release Notes

  • Refactor

    • Resume template restructured to use modular components for rendering work experience, volunteer roles, education, and project information, improving consistency across sections.
  • Style

    • Updated CSS styling and layout for resume sections and profile area displays.

@coderabbitai

coderabbitai Bot commented May 6, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@SethFalco has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 57 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6d316cd4-3ea2-4af9-a74d-e54472b6a740

📥 Commits

Reviewing files that changed from the base of the PR and between 313ddce and abc8b65.

📒 Files selected for processing (5)
  • src/_partials/date.handlebars
  • src/_partials/tenure.handlebars
  • src/index.js
  • src/resume.handlebars
  • src/style.css

Walkthrough

This PR introduces reusable Handlebars partials for rendering date ranges and tenure entries, adds infrastructure for dynamic partial loading, and refactors the resume template to delegate rendering logic to these partials. CSS selectors are updated to support new classes introduced by the partials.

Changes

Partial Extraction and Dynamic Loading

Layer / File(s) Summary
New Partials
src/_partials/date.handlebars, src/_partials/tenure.handlebars
date partial renders a conditional date range with start and end dates; tenure partial renders a reusable tenure entry with conditional sections for name, position, date, URL, summary, and highlights.
Partial Infrastructure
src/index.js
Added path module import, PARTIALS_DIR constant, dynamic file-based partial registration loop, and a new or Handlebars helper for boolean OR expressions in templates.
Template Refactoring
src/resume.handlebars
Work, volunteer, and project sections now delegate rendering to tenure and date partials instead of inline markup, reducing duplication and improving maintainability.
Style Updates
src/style.css
Selectors updated to support new classes (.date, .work_position, .work_website, .institution, .qualification) used by partials while preserving layout spacing rules.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A rabbit rejoices in templates refined,
Date and tenure partials, so nicely aligned,
Duplication fades as reuse takes flight,
Dynamic loading makes styles shine bright! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(refactor): start using handlebars partials' accurately summarizes the main change: introducing and implementing Handlebars partials to reduce code duplication.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/_partials/date.handlebars`:
- Around line 2-7: The template currently nests the end-date rendering inside
the startDate check, so endDate (or required end dates via isEndDateRequired)
are suppressed when startDate is missing; update the Handlebars logic to render
startDate only when startDate exists ({{{date startDate}}}) and independently
render endDate when endDate exists or isEndDateRequired ({{`#if` (or endDate
isEndDateRequired)}}), and ensure the dash separator is emitted conditionally
only when startDate exists (i.e., render the " - " before the end-date output
only if startDate was present).

In `@src/index.js`:
- Around line 216-221: The loop over PARTIALS_DIR registers every directory
entry, causing EISDIR and incorrect partial names; update the discovery to only
process files ending with ".handlebars" (and skip directories) before calling
Handlebars.registerPartial: use fs.readdir with { withFileTypes: true } or
filter entries by extension (checking Dirent.isFile() or using path.extname) and
then read each file with fs.readFile and register it using path.basename(p,
'.handlebars') to ensure only proper .handlebars files are registered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 906d14da-9e1f-4f5d-9c9c-dbcc2275a28a

📥 Commits

Reviewing files that changed from the base of the PR and between 0e0165b and 313ddce.

📒 Files selected for processing (5)
  • src/_partials/date.handlebars
  • src/_partials/tenure.handlebars
  • src/index.js
  • src/resume.handlebars
  • src/style.css

Comment thread src/_partials/date.handlebars
Comment thread src/index.js
Up until now, this project as duplicated content even though some
sections were clearly similar. Let's finally define a `_partials` folder
and centralize some of these into reusable partials.

For now, just creates `tenure` and `date` but we can slowly migrate
other things into partials as well and align things so it's easier to
keep sections in sync.
@SethFalco
SethFalco merged commit 1513e47 into jsonresume:main May 6, 2026
5 checks passed
@SethFalco
SethFalco deleted the partials branch May 6, 2026 19:27
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