Repository navigation
feat(templates): add referral bonus job template - #296
Merged
anurag629 merged 1 commit intoOct 28, 2026
Merged
Conversation
Adds job-referral for posts asking people to refer a friend for an open role: a Know someone? label, the role and company, a large referral bonus with its label, how to refer, and the site name. Long text shrinks and truncates, blank optional fields hide, and the accent text is darkened on a light background. Closes codercops#294
anurag629
approved these changes
Oct 28, 2026
anurag629
left a comment
Member
There was a problem hiding this comment.
Thanks @Saifjafri212213, this works. Check, all 1503 tests and the build pass on top of dev, and the renders look right: default, a white background with a pale accent, long caps text in every field (the bonus label drops under a wide bonus), and blank fields, with the label going away along with the bonus.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the
job-referraltemplate (Referral Bonus) for posts asking people to refer a friend for an open role. From the top: a "Know someone?" label in the accent colour, the role large with the company under it ("at Acme"), the referral bonus large with its label beside it, one line on how to refer, and the site name at the bottom.Closes #294
src/templates/job/referral.ts, idjob-referral, with fieldstitle,company,bonus,bonusLabel,note,siteName,bgColor,accentColor,textColorsrc/templates/job/index.tsand appended to the Job block insrc/templates/registry.tsautoFontSize()and then truncates at 60 characters; the company, bonus, label and note truncate toomixColors(), so they stay readableHow I Tested This
tests/templates/job-referral.test.ts(13 tests): registration and re-export, the field list and defaults, a 1200 by 630 root with only flex divs, the render order, each blank optional field hiding, the bonus label hiding with the bonus, defaults for omitted fields, role font sizes and truncation, truncation of the other fields, bonus sizing, and colours on a light backgroundnpx tsc --noEmitis clean and the full suite passes (75 files, 1503 tests)satoriand@resvg/resvg-wasmengine and the bundled fonts inpublic/fontsfor six cases: defaults, a light background, long text, all optional fields blank, a blank bonus, and a light blue accent. I looked at each image; nothing overflows and blank fields hide cleanlynpm run dev, the editor's live preview and the Download PNG button, andastro check. The local@cloudflare/workerd-darwin-arm64package in mynode_moduleshas an emptybinfolder, so Astro cannot load its config hereAI Assistance
An AI coding assistant helped write the template and its tests. I read the template and ran the checks above.
Type of Change
Screenshots
Rendered with the same satori and resvg engine and the bundled fonts.
Default, dark:
Light background (white, dark text, pale yellow accent):
Light background with a blue accent:
Long role, company, bonus, label and note (shrunk, then truncated):
Blank bonus and site name (the bonus label goes with the bonus):
All optional fields blank:
Checklist
devnpm run checkpasses (tscpasses;astro checkcould not run locally, see above)npm run testpassesnpm run dev(not possible locally, see above)