Add love-letters page with postcard component #491
Merged
Conversation
- New /love-letters page displaying postcards with images and markdown quotes - Postcard component using useMemo, with markdown-it for link support - Content sourced from content/love-letters/postcards.md for easy editing - Heart icon and nav link added after Partner Pack in header Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Love Letters” section to the site, sourcing postcard data from a markdown file and exposing it via a new page and header navigation entry.
Changes:
- Introduces
/love-letterspage with static content loading fromcontent/love-letters/postcards.md. - Adds a
Postcardcomponent + SCSS styling to render an image grid with markdown-rendered quotes. - Adds a Heart icon and a new “Love Letters” link in the global header; registers the route in
common/routes.js.
Show a summary per file
| File | Description |
|---|---|
| styles/styles.scss | Imports the new postcard SCSS into the global stylesheet bundle. |
| public/icons/heart.js | Adds a Heart SVG icon component for the header nav. |
| pages/love-letters.js | Creates the Love Letters page and loads postcard data at build time. |
| content/love-letters/postcards.md | Adds editable postcard content (image + quote) in frontmatter. |
| components/postcard/postcard.scss | Provides layout and visual styling for the postcards grid/cards. |
| components/postcard/Postcard.jsx | Renders postcards, including markdown quote rendering and images. |
| components/header/Header.jsx | Adds a new nav item linking to Love Letters with the Heart icon. |
| common/routes.js | Registers the LOVE_LETTERS route helper. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
components/postcard/Postcard.jsx:31
- The image
alttext is set topostcard.quote, which may contain markdown syntax (e.g.[@user](...)) and can be quite long. For accessibility,altshould be a concise plain-text description of the image (or empty if decorative). Consider adding a dedicatedalt/imageAltfield in the markdown data, or stripping markdown before using it as alt text.
<img
className="postcards__image"
src={postcard.image}
alt={postcard.quote}
/>
components/postcard/Postcard.jsx:37
md({ linkify: true }).render(...)is instantiating a new markdown-it parser for every postcard (and on every re-render). This is unnecessarily expensive. Prefer creating a single MarkdownIt instance once (e.g., viauseMemo/module-level singleton) and reusing it to render each quote.
<blockquote
className="postcards__quote"
dangerouslySetInnerHTML={{
__html: md({ linkify: true }).render(postcard.quote || ''),
}}
- Files reviewed: 8/8 changed files
- Comments generated: 2
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Mockups Below 👇