4.0 KiB
name, description
| name | description |
|---|---|
| add-feed-post | Add a new Feed post (short announcement / social-style update) to the Data Controller marketing site. Use when the user wants to publish a Feed post, add a /feed/ entry, or create a short announcement that also goes out via RSS. |
Add a Feed post
The Feed section (/feed/) is for short announcements and social-media style updates - things that don't warrant a full content/blog/ article but are still worth publishing and syndicating via RSS. Feed posts work exactly like blog posts (one markdown file per post, in its own directory) but live under content/feed/ and publish under /feed/.
Both Blog and Feed share a single combined RSS feed at /rss.xml (via gatsby-plugin-feed in gatsby-config.js), so a new Feed post appears in RSS automatically on the next build - no extra config.
Steps
1. Create the post directory
Create a folder under content/feed/, named after the post slug (this becomes the URL):
content/feed/my-new-announcement/index.md
Pick a short, hyphenated, lowercase slug.
2. Write the front matter + content
---
title: 'My New Announcement'
description: A one or two sentence summary used for SEO and RSS.
date: '2024-06-01 09:00:00'
author: 'Your Name'
authorLink: https://www.linkedin.com/in/yourprofile/
tags:
- Announcements
---
Your announcement content goes here, written in regular Markdown.
Front matter fields:
| Field | Required | Notes |
|---|---|---|
title |
Yes | Used on the page, in the sidebar and in the RSS item. |
description |
Yes | Short summary for SEO meta tags and the RSS item description. |
date |
Yes | Format 'YYYY-MM-DD HH:MM:SS'. Controls sort order and the archive. |
author |
Yes | Displayed under the post title. |
authorLink |
No | If set, the author name links out (e.g. to a LinkedIn profile). |
tags |
Yes | One or more tags. Drives the sidebar category list and RSS category. |
previewImg |
No | Relative path to an image in the same folder (e.g. './cover.png'). Feed posts usually omit this since they're short-form. |
Use regular dashes (-) in content, not em-dashes.
3. Add images (optional)
If you set previewImg or reference images in the body, place the image files in the same post directory and reference them with a relative path.
4. Build / preview
npm run develop
The post will be available at /my-new-announcement/ and will appear on the /feed/ listing page, in the site search index, and in /rss.xml alongside blog posts.
How Feed differs from Blog
| Aspect | Blog | Feed |
|---|---|---|
| Content directory | content/blog/ |
content/feed/ |
| Listing page | /blog/ |
/feed/ |
| Year archive | /{year}/ |
/feed/{year}/ |
| Category page | /category/{tag}/ |
/feed/category/{tag}/ |
| Template | src/templates/blog-post.tsx, src/templates/blog-list.tsx |
src/templates/feed-post.tsx, src/templates/feed-list.tsx |
| RSS | Included in /rss.xml |
Included in /rss.xml |
Feed archive/category routes are prefixed with /feed/ to avoid colliding with the equivalent Blog routes, since both are rendered by the shared src/templates/sidebar.tsx component (via its basePath prop).
Notes
- To add a blog post instead, follow the same steps but use
content/blog/and the/blog/routes. - The canonical human-readable version of this guide is
docs/adding-feed-posts.md.