Repository navigation
Add Open Graph / Twitter social preview card - #2768
Conversation
Adds a branded 1200x630 social preview card (isometric safe with gold bars, matching the project logo) plus og:image / twitter:image and description meta tags to the base layout head. Without these, sharing wrongsecrets.herokuapp.com on X/LinkedIn/Discord/Slack renders a bare link with no preview image. Co-Authored-By: Paperclip <noreply@paperclip.ing>
🧪 Testing this PR locallyIf you already have the repositoryFirst, make sure the official OWASP WrongSecrets repository is configured git remote get-url wrongsecrets-upstream >/dev/null 2>&1 || \
git remote add wrongsecrets-upstream https://github.com/OWASP/wrongsecrets.gitThen fetch and check out this PR: git fetch wrongsecrets-upstream pull/2768/head:pr-2768
git checkout pr-2768
Or, if you want the contributor branch directlyIf the contributor repository is already configured as git fetch origin
git checkout -b test-pr-2768 origin/add-og-social-preview🌍 Reviewing translationsCompare the translated files of this PR side by side with the originals: 🧹 Cleaning up after testingWhen you are finished testing, you can remove the local PR branch: git checkout main
git branch -D pr-2768If you added the git remote remove wrongsecrets-upstream
PR: #2768 |
commjoen
left a comment
There was a problem hiding this comment.
Hi @astra-intelligence , thank you for the mr! Can you use our original logo instead please?
Addresses maintainer review on OWASP#2768: embed the repo's actual isometric safe-with-gold-bars logo (from static/android-chrome-384x384.png) instead of the hand-drawn reproduction. Adds tools/gen-og-image.py (portable, no machine-specific paths, fonts via WRONGSECRETS_FONT_DIR -> ./fonts -> ~/.fonts -> system dirs) so the card is reproducible.
|
Thanks for the review! I've updated the card to use the repo's original logo — the isometric safe with gold bars from Also added The updated |
|
@bendehaan how about the tagline “can you find all the secrets?” |
|
Or “learn how to manage your secrets through solving challenges “ or “ learn how to manage your secrets through challenges and fun” |
|
Thanks @commjoen for the tagline suggestions! I've updated the card to use "Can you find all the secrets?" — it's short, punchy, and captures the challenge-based learning angle of WrongSecrets. The regenerated 1200×630 card (74 KB) is pushed to the branch. Ready for another look. |
|
Synced the branch with upstream master — the PR is up to date and ready for a re-review whenever you have a minute. The card now uses the repo's original logo and the "Can you find all the secrets?" tagline as discussed. No rush! |
|
I just came of the phone with @bendehaan , @astra-intelligence : can you do as a tagline "Can you find them all?" and fix the pre-commit findings please? |
|
Thanks @commjoen — done on both counts:
The PR head is updated and the pre-commit check should re-run green. Ready for re-review whenever you have a minute. |
|
Thank you @astra-intelligence , one small question: it feels a bit crowded at the bottom, can i have it a bit higher please? then ready to have it merged :) |
|
and can you move |
- Shift OWASP/WrongSecrets/tagline up ~30px so the tagline keeps a comfortable 30px bottom margin (maintainer feedback: card was crowded at the bottom, tagline nearly touched the 630px edge). - Relocate tools/gen-og-image.py -> scripts/gen-og-image.py per maintainer request; output path logic unchanged (repo-root relative). - Regenerate src/main/resources/static/img/og-image.png from the moved script. Refs: PR OWASP#2768
|
Thanks @commjoen — both done:
CI is re-running on the new head. Ready for merge whenever you are — thanks for the quick review! |
commjoen
left a comment
There was a problem hiding this comment.
Thank you @astra-intelligence , welcome to the team of contributors!
What
Adds a branded 1200×630 social preview card to WrongSecrets so links shared on X/Twitter, LinkedIn, Discord, Slack, and WhatsApp render a proper image card instead of a bare link.
src/main/resources/static/img/og-image.png— 1200×630 card reproducing the project's isometric-safe-with-gold-bars logo motif (dark navy gradient, brand blues#5d7b93/#3e5f7a/#7a9bb5, gold#f1c40f), with the "OWASP WrongSecrets" wordmark and tagline. 55 KB, well under the 1 MB crawler limit. Reproducible via the committed generator script.src/main/resources/templates/index.html— addsog:type/site_name/title/description/url/image(+w/h/alt)andtwitter:card=summary_large_image/title/description/imageplus ameta name="description"to the base layout<head>(applies to all pages).Why
The site currently has no Open Graph or Twitter card tags at all — sharing
wrongsecrets.herokuapp.comon any social platform produces a bare link with no preview. This is a small, self-contained fix that makes the project look polished when shared.Notes
og:image/og:urlpoint at the canonicalwrongsecrets.herokuapp.comdeployment; the image asset is served identically from every deployment's static dir, so the card renders regardless of which host a visitor is on.Verified: image renders clean (vision-QA'd), tags are well-formed, no build changes needed.