
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@multidots/sanity-plugin-blog-listing
Advanced tools
A Sanity plugin that enables creating and displaying blog posts in customizable list or grid layouts with filtering, sorting and pagination options.
Powerful blog listing for Sanity Studio v3 with an optional ready-made React (Next.js) client component. Posts, categories, and authors in Studio and render them in your site with grid/list layout, sorting, filtering, pagination, and more.
Configurable listing:
Sorting & filtering:
Pagination:
Client component:
PostListingWrapper
React componentSchemas included:
mdPost
: Complete blog post document schema with title, slug, author reference, featured image, category references, publish date, excerpt and body contentmdPostCategory
: Category document schema with title, slug and descriptionmdPostAuthor
: Author document schema with name, slug, profile image and biographymdPostListing
: Configurable object schema for customizing how posts are displayednpm install @multidots/sanity-plugin-blog-listing
Peer requirements in your frontend (if using the React component):
npm install @sanity/client @sanity/image-url
Add the plugin in sanity.config.ts
(or .js):
import {defineConfig} from 'sanity'
import {MDBlogListing} from '@multidots/sanity-plugin-blog-listing'
export default defineConfig({
// ...your studio config
plugins: [MDBlogListing()],
})
Example: add a listing section to a Page schema
// page.ts
import {defineType, defineField} from 'sanity'
export default defineType({
name: 'page',
title: 'Page',
type: 'document',
fields: [
defineField({name: 'title', type: 'string'}),
defineField({
name: 'blogListing',
type: 'mdPostListing',
title: 'Blog Listing',
description: 'Display a list of blog posts.',
}),
],
})
mdPostListing
config shape (frontend)type MdPostListingConfig = {
layout?: 'grid' | 'list'
postContent?: {showContent?: boolean}
postMeta?: {displayAuthorName?: boolean; displayDate?: boolean}
featuredImage?: {showFeaturedImage?: boolean}
postCategory?: {showCategory?: boolean}
sortingAndFiltering?: {
orderBy?: 'newestToOldest' | 'oldestToNewest' | 'AtoZ' | 'ZtoA'
displayPostBy?: 'category' | 'author' | 'selectManually' | 'allPosts'
filterByCategory?: Array<{_ref?: string; _id?: string}>
filterByAuthor?: Array<{_ref?: string; _id?: string}>
selectPosts?: Array<{_ref?: string; _id?: string}>
numberOfPosts?: number
paginationType?: 'none' | 'loadMore' | 'pagination'
}
}
Recommended approach: create a small Client Component wrapper, then render it from a Server Component page.
Client wrapper (ensure it runs on the client):
'use client'
import { PostListingWrapper } from '@multidots/sanity-plugin-blog-listing/client'
import type { MdPostListing } from '@/sanity/types'
export default function PostListing({ config }: { config?: MdPostListing | null }) {
return <PostListingWrapper config={config} />
}
Server page usage:
const getPage = async (params: RouteProps['params']) =>
sanityFetch({
query: PAGE_QUERY,
params,
})
export default async function Page({ params }: RouteProps) {
const { data: page } = await getPage(params)
return (
<>
<PostListing config={page?.blogListing} />
</>
)
}
Sample page query:
const PAGE_QUERY = defineQuery(`*[_type == "page" && slug.current == $slug][0]{
...,
title,
blogListing
}`)
Environment variables required:
NEXT_PUBLIC_SANITY_PROJECT_ID
NEXT_PUBLIC_SANITY_DATASET
You can style the plugin using the following CSS classes:
post-listing
post-card
post-content
post-title
post-meta
post-category
load-more-btn
pagination-btn
Error: defineLive can only be used in React Server Components
sanity-plugin-blog-listing/client
.defineLive
utilities (from next-sanity) into client components. Keep those in server files (e.g. live.server.ts
) and only use them in Server Components.No posts found
mdPost
documents and assign categories/authors as needed.MDBlogListing
from sanity-plugin-blog-listing
PostListingWrapper
(and its types) from sanity-plugin-blog-listing/client
This plugin uses @sanity/plugin-kit for build & watch scripts.
Local development tips:
npm run link-watch
or npm run watch
to develop against a local Studionpm publish
(build runs on prepublishOnly
)MIT © Multidots
FAQs
A Sanity plugin that enables creating and displaying blog posts in customizable list or grid layouts with filtering, sorting and pagination options.
We found that @multidots/sanity-plugin-blog-listing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.