Skip to content

feature: add OutdatedBanner component for outdated articles#113

Open
snappygrav wants to merge 2 commits into
BearStudio:mainfrom
snappygrav:feature/obsolete-banner
Open

feature: add OutdatedBanner component for outdated articles#113
snappygrav wants to merge 2 commits into
BearStudio:mainfrom
snappygrav:feature/obsolete-banner

Conversation

@snappygrav

Copy link
Copy Markdown

Description

Adds an OutdatedBanner component that can be displayed on top of blog articles to warn readers that the content may no longer be valid.

Closes #111

Changes

  • src/schemas/posts.ts — added optional outdated boolean field to zPost schema
  • src/components/outdated-banner.astro — new component with i18n support
  • src/pages/fr/blog/articles/[id]/index.astro — conditionally renders the banner when outdated: true
  • src/i18n/fr/blog.json — added blog.article.outdated translation keys
  • src/i18n/en/blog.json — added blog.article.outdated translation keys

Usage

First of all, you need to locate into src/content/posts/

Then, look for an article that you want to modify the state to "Outdated", for example: src/content/posts/start-ui/en.md

To mark an article as outdated, add outdated: true to its frontmatter:

---
title: 'Start UI'
slug: 'start-ui-opinionated-ui-starter'
date: 2021-11-01
[other information about the article]
outdated: true
---

Screenshots

Without banner With banner
🇫🇷 fr-without-banner fr-outdated-banner
🇬🇧 en-without-banner en-outdated-banner

Notes

  • Since articles are split into separate language files (fr.mdx / en.mdx), the outdated flag needs to be set manually in each file independently.

- Add `outdated` boolean field to zPost schema
- Create OutdatedBanner component with i18n support
- Display banner conditionally in blog article page
- Add translation keys in fr and en blog.json
@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown

@Maximiliem is attempting to deploy a commit to the Team Bearstudio Team on Vercel.

A member of the Team first needs to authorize it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a "We don't do this anymore" like card on outdated articles

2 participants