@hello-better/sanity-blog
v0.1.3
Published
Sanity blog module with Blog Stream, Blog Post, Blog Tag documents and Blog Block — inspired by Silverstripe's blog module.
Readme
How to use it in sanity.config.ts
import {sanityBlog, createBlogBlock, createBlogStructureItems} from '@hello-better/sanity-blog' import type {SanityBlogOptions} from '@hello-better/sanity-blog'
const blogOptions: SanityBlogOptions = { // All optional — defaults work out of the box blogStreamTypeName: 'blogStream', defaultPostsPerPage: 9, }
// 1. Add the plugin (registers document types + BlogBlock object type) plugins: [ sanityBlog(blogOptions), sanityCore({ // 2. Add BlogBlock to the page builder blocks: [ {name: 'blogBlock', type: createBlogBlock(blogOptions)}, ], // 3. Wire up the sidebar section additionalStructureItems: (S) => createBlogStructureItems(blogOptions, S), }), ]
