feat(themes): add social share buttons to posts#126
Merged
Conversation
Adds a share_urls Jinja2 filter yielding (platform, url) pairs for Twitter/X, LinkedIn, Facebook, Reddit, Hacker News, and Email with percent-encoded title and canonical URL. A shared _share.html partial in the default theme renders icon buttons plus a copy-link button (navigator.clipboard with execCommand fallback); blue-tech and terminal include it via loader fallback and style it per theme. Section is hidden entirely when site.url is not configured. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds first-party social sharing to SquishMark’s bundled post themes by introducing a shared Jinja partial and a new share_urls filter that generates fully percent-encoded platform URLs from the render context’s canonical_url. This keeps sharing privacy-friendly (direct links only) while allowing themes/content repos to override the partial if desired.
Changes:
- Add
share_urlsJinja filter to generate ordered (platform, url) share links with strict percent-encoding. - Introduce a shared
_share.htmlpartial (default theme) and include it frompost.htmlin all bundled themes via loader fallback. - Add per-theme CSS for the share row/buttons and add tests covering filter behavior + rendering across themes.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| themes/terminal/static/css/style.css | Adds terminal theme styling for share buttons. |
| themes/terminal/post.html | Includes shared share partial and sets a terminal-specific label. |
| themes/default/static/style.css | Adds default theme styling for share buttons. |
| themes/default/post.html | Includes shared share partial on post pages. |
| themes/default/_share.html | New shared partial rendering share links + copy-link behavior. |
| themes/blue-tech/static/style.css | Adds blue-tech theme styling for share buttons. |
| themes/blue-tech/post.html | Includes shared share partial on post pages. |
| tests/test_share_urls.py | Adds unit + render tests for share_urls and share section visibility. |
| src/squishmark/services/theme/filters.py | Implements and registers the share_urls filter. |
| .claude/skills/theme-creator/references/filters.md | Documents the new filter and how themes include the partial. |
Keeps fuzzy from perturbing order among exact/prefix posts and skips the fuzzy scan entirely on queries with real hits.
…l match" This reverts commit 2dc319b.
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.
Closes #12
Share buttons on post pages across all three bundled themes: Twitter/X, LinkedIn, Facebook, Reddit, Hacker News, Email, plus a copy-link button.
Browser-verified on all three themes: share row renders in each theme's style, copy button shows its feedback state, links are correctly encoded, and the section is absent when site.url is not configured.
🤖 Generated with Claude Code