sanity-plugin-dashboard-dad-jokes
v2.0.0
Published
A dashboard widget for Sanity Content Studio to obtain dad jokes
Maintainers
Readme
sanity-plugin-dashboard-dad-jokes
This is a Sanity Studio v4+ plugin (works on Studio v4, v5, and v6).
Why???
Who doesn't like jokes. A dad joke is lame enough to make you laugh and cry at the same time.

What is happening in the background?
This widget takes dad jokes from https://icanhazdadjoke.com/
Installation
npm install sanity-plugin-dashboard-dad-jokesThis widget is rendered by @sanity/dashboard, which is a peer dependency. Install it too if you haven't already:
npm install @sanity/dashboardUsage
Add dashboardTool to your plugins and pass jokesWidget() as one of its widgets in sanity.config.ts (or .js):
import {defineConfig} from 'sanity'
import {dashboardTool} from '@sanity/dashboard'
import {jokesWidget} from 'sanity-plugin-dashboard-dad-jokes'
export default defineConfig({
// ...
plugins: [
dashboardTool({
widgets: [jokesWidget()],
}),
],
})Size config
The widget size can be controlled using layout.width:
dashboardTool({
widgets: [jokesWidget({layout: {width: 'small'}})],
})Inspiration
I took inspiration from the Cats Widget official plugin of Sanity.
License
MIT © Sachin Sancheti
Develop & test
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.
