Skip to content

kaliberjs/sanity-plugin-nav-extend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sanity plugin nav extend

Extends the nav bar of Sanity Studio

Installation

> yarn add @kaliber/sanity-plugin-nav-extend

config/default.js

{
  kaliber: [
    compileWithBabel: [
      /@kaliber\/sanity-plugin-nav-extend/,
      ...
    ],
    ...
  ],
  ...
}

admin/sanity.config.js

Minimal version

defineConfig({
    ...

    plugins: [
      sanityPluginNavExtend({ clientConfig, reportError }),
      ...
    ],
})

Showing a context switch (e.g. language switch)

defineConfig({
    ...

    plugins: [
      sanityPluginNavExtend({
        contextSwitch: {
          profileKey: 'language',
          schemaType: '', // optionally overwrite schema type, default 'profile'
          options: Object.values(clientConfig.multiLanguage.languages).map(
            ({ flagIcon, title, language }) => ({
              id: language,
              label: title,
              icon: <Flag country={flagIcon} />,
            })
          ),
          defaultValue: clientConfig.multiLanguage.defaultLanguage,
        },
        clientConfig,
        reportError
      }),
      ...
    ],
})

Development

> yarn
> yarn link
project/> yarn link @kaliber/sanity-plugin-nav-extend
project/> yarn add @kaliber/sanity-plugin-nav-extend@link:./node_modules/@kaliber/sanity-plugin-nav-extend

Publish

yarn publish
git push
git push --tags

Disclaimer

This library is intended for internal use, we provide no support, use at your own risk.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Generated from kaliberjs/library