3.1.3 • Published 10 days ago

sanity-plugin-taxonomy-manager v3.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

Sanity Taxonomy Manager

NPM Version License

Create and manage SKOS compliant taxonomies, thesauri, and classification schemes in Sanity Studio.

taxonomy manager plugin screenshot

Documentation

For full documentation, visit sanitytaxonomymanager.com.

Features

  • Adds two document types to your Sanity schema which are used to generate SKOS compliant concepts and taxonomies: skosConcept and skosConceptScheme
  • Includes reference filter helpers to allow you to easily include a specific taxonomy, or particular branch of a taxonomy in your Sanity documents
  • Encourages taxonomy and thesaurus design best practices by enforcing disjunction between Broader and Related relationships and disjunction between Preferred and Alternate/Hidden labels
  • Standards compliant architecture means that taxonomy terms and structures can be migrated to standards compliant standalone tools when you need higher level taxonomy and knowledge graph support.

Installation

In your Sanity project folder, run

npm i sanity-plugin-taxonomy-manager

or

yarn add sanity-plugin-taxonomy-manager

Configuration

Add the plugin to your project configuration to add the Taxonomy Manager Tool to your studio workspace.

// sanity.config.js

import {defineConfig} from 'sanity'
import {deskTool} from 'sanity/desk'
import {taxonomyManager} from 'sanity-plugin-taxonomy-manager'
import {schemaTypes} from './schemas'

export default defineConfig({
  name: 'default',
  title: 'Sanity Studio',
  projectId: '<projectId>',
  dataset: 'production',
  plugins: [
    deskTool(),
    // Include the taxonomy manager plugin
    taxonomyManager({
      // Optional: Set a Base URI to use for new concepts & concept schemes
      baseUri: 'https://example.com/',
    }),
  ],
  schema: {
    types: schemaTypes,
  },
})

The plugin adds skosConcept and skosConceptScheme document types to your studio. Use a filter on documentTypeListItems in the desk tool configuration to exclude taxonomy manager document types from your main document view.

// sanity.config.js

import {defineConfig} from 'sanity'
import {deskTool} from 'sanity/desk'
import {taxonomyManager} from 'sanity-plugin-taxonomy-manager'
import {schemaTypes} from './schemas'

export default defineConfig({
  name: 'default',
  title: 'Sanity Studio',
  projectId: '<projectId>',
  dataset: 'production',
  plugins: [
    deskTool({
      structure: (S) =>
        S.list()
          .title('Content')
          .items([
            ...S.documentTypeListItems().filter(
              (listItem) => !['skosConcept', 'skosConceptScheme'].includes(listItem.getId())
            ),
          ]),
    }),
    taxonomyManager({
      baseUri: 'https://example.com/',
    }),
  ],
  schema: {
    types: schemaTypes,
  },
})

Contributing

Community collaboration is highly encouraged. To make sure your contributions are aligned with project goals and principles, please read the contributing docs before submitting a pull request.

License

MIT © Andy Fitzgerald See LICENSE

3.1.3

10 days ago

3.1.2

14 days ago

3.1.1

4 months ago

3.1.0

5 months ago

3.1.0-beta.1

6 months ago

3.1.0-beta.2

6 months ago

3.1.0-beta.0

6 months ago

2.3.0

10 months ago

2.2.1

10 months ago

2.2.0

10 months ago

2.3.1

9 months ago

2.2.2

10 months ago

3.0.2

7 months ago

3.0.1

9 months ago

3.0.0

9 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

11 months ago

2.0.4

1 year ago

2.0.6

11 months ago

2.0.0-beta.0

1 year ago

2.1.0

11 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

2 years ago

1.0.3

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago