contentful-link-cleaner

1.3.4 • Public • Published

Contentful Link Cleaner

npm Build Status Coverage Status Dependency Status devDependency Status

semantic-release js-standard-style

This tool cleans up unresolved Entry links in Contentful spaces.

When you have a link to an Entry or Asset on a Published Entry, if you delete the linked Entry the Entry that links to it will have a reference to a non existing entity.

This tool goes through all of your entries, figures out which links don't exist anymore, and removes them.

This might be particularly relevant to users of contentful-space-sync.

If you're not entirely clear on what Links are, check out the Links page for more information.

This tool will ask you if the entries which have had their links fixed should also be published. This is the default, and we recommend that we do.

Any entries that don't get their links fixed will stay in "updated" state and will need to be published manually.

Changelog

Check out the releases page.

Install

npm install -g contentful-link-cleaner

Usage

Usage: contentful-link-cleaner [options]

Options:
  --version                       Show version number

  --space                         ID of Space with source data
                                  [string] [required]

  --delivery-token                Delivery API token
                                  [string] [required]

  --management-token              Management API token
                                  [string]

  --pre-publish-delay             Delay in milliseconds to account for delay
                                  after creating entities, due to internal
                                  database indexing
                                  [default: 5000]

  --config                        Configuration file with required values

Check the example-config.json file for an example of what a configuration file would look like. If you use the config file, you don't need to specify the other options for tokens and space ids.

Example usage

contentful-link-cleaner \
  --space sourceSpaceId \
  --delivery-token spaceDeliveryToken \
  --management-token spaceManagementToken

or

contentful-link-cleaner --config example-config.json

You can create your own config file based on the example-config.json file.

Package Sidebar

Install

npm i contentful-link-cleaner

Weekly Downloads

2

Version

1.3.4

License

MIT

Last publish

Collaborators

  • contentful-ecosystem
  • cf-admin
  • kgarbaya
  • trodrigues