Skip to content

Feat/new badge - #7183

Open
eli32-vlc wants to merge 4 commits into
fmhy:mainfrom
eli32-vlc:feat/new-badge
Open

eli32-vlc wants to merge 4 commits into
fmhy:mainfrom
eli32-vlc:feat/new-badge

Conversation

@eli32-vlc

Copy link
Copy Markdown
Contributor

Auto-expiring NEW badge for entries added in the last 7 days

Adds a small NEW pill next to wiki entries added in the last 7 days, so people browsing a page can spot new additions without checking Discord. The pill disappears on its own after a week.

How it works
• No manual work. scripts/generate-removed.js already walks the last 30 days of git history for the Recently Removed page. It now also records primary resources added in the last 7 days and writes docs/.vitepress/new-sites.json (URL to date added, gitignored).
• Only real additions count. A URL is marked new only if it's still on the wiki, wasn't removed anywhere in the 30-day window, and no entry with the same name was removed in the same commit. Section moves, re-adds and URL swaps don't get the badge.
• Rendering. The existing list_item_open rule in markdown/toggleStarred.ts adds a "new" class and a badge span when an item's first link is in that file. The markdown source isn't touched, so single-page, the API and the backups are unaffected.
• Styling. A rounded pill, dark grey with white text in dark mode and light grey with dark text in light mode. The "NEW" text comes from CSS, so it doesn't show up in search results or copied text. Hovering shows the date added (for example "Added Nov 9"), which is also the aria-label.
• Expiry. Badges drop off on the first build after 7 days. Pages rebuild on every push, so in practice that's near-daily.

Why a pill
A sparkle is too easy to confuse with starred entries, a plus or circle looks like a button, and a highlighted row clashes with starred entries and search matches. A plain NEW label is the most widely recognised.

@github-actions github-actions Bot added the core Core changes to our VitePress setup label Nov 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core changes to our VitePress setup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant