Introducing the Blog plugin
@binarynoir/vitepress-blog is the newest BinaryNoir plugin. It turns any VitePress page into a blog post.
It works like the Glossary and Markdown Tags plugins: you mark pages in their frontmatter, and the build does the rest.
blogturns a page into a post, with a date, summary, image, authors and tags.blog-indexturns a page into a blog that lists posts: the main blog for the whole site, or a section blog for one folder.- Every blog gets an RSS feed, and every post gets a byline, newer and older links, and social-card tags.
What's different
VitePress doesn't ship a blog. Most sites add one of two ways: a data loader plus a Vue component written for the site, or a blog theme that replaces the documentation theme. We wanted a blog for a docs site that keeps looking like a docs site, so this plugin works the other way around:
- Posts stay next to what they are about. A release note can live beside the page it changes. Frontmatter, not a folder, decides which blog lists it.
- A site can have many blogs. Each section can have its own, and the main blog collects what everyone should see.
- Every blog has its own feed. Readers subscribe to exactly the part of the site they follow, using the "Subscribe" link on each blog.
- Nothing to write in Vue. Lists are built as Markdown at build time, so they work without JavaScript and show up in search. Pages and keyword filters are added in the browser.
Section blogs, in practice
The feature we expect to matter most is the section blog: a blog of one folder, with its own feed, inside a bigger site.
- A docs site for several products gives each product a release notes blog. Someone who only uses one product follows only its feed.
- A monorepo gives each package a changelog blog in its docs folder, and marks the releases that affect everyone
scope: siteso they also reach the main blog. - A team handbook gives each team a blog for its updates, and company-wide announcements go on the main blog.
- A course site gives each course its announcements, so students follow their own course and nothing else.
Section blogs pair with Auto Sidebar's new .sort and .limit settings, which keep a long folder of posts newest first in the sidebar and cut it to the latest few. The same settings help anything dated, like meeting notes or release notes.
This blog is the first to use the plugin. See the plugin page for everything it can do, and the Scopes Demo for a main blog and a section blog side by side.