storyblok-scripts
v1.0.8
Published
CLI tools for Storyblok maintenance tasks: find unreferenced assets
Readme
Storyblok Redirects
A CLI tool to fetch and generate redirects from Storyblok.
Installation
npm install -g storyblok-redirects
# or
npx storyblok-redirectsUsage
As a CLI tool
- Create a
.envfile with your Storyblok token:
VITE_STORYBLOK_TOKEN=your_token_here- Run the command:
fetch-redirectsThis will create a public/_redirects file with your Storyblok redirects.
As a module
const generateRedirects = require('storyblok-redirects');
// Use with default options
generateRedirects();
// Or customize the options
generateRedirects({
accessToken: 'your_token_here',
outputPath: 'custom/path/_redirects',
storyPath: 'custom/story/path'
});Options
accessToken: Your Storyblok access token (defaults to VITE_STORYBLOK_TOKEN from .env)outputPath: Where to save the redirects file (defaults to "public/_redirects")storyPath: The Storyblok story path containing redirects (defaults to "config/redirects")
License
MIT
