1.0.8 • Published 1 year ago
@webbio/strapi-plugin-preview v1.0.8
Strapi plugin preview
Features
- A plugin that enables a preview button on pages
- Links to the Front end page.
Installation
To install this plugin, you need to add an NPM dependency to your Strapi application.
# Using Yarn
yarn add @webbio/strapi-plugin-preview
# Or using NPM
npm install @webbio/strapi-plugin-previewConfiguration
Make sure the correct plugin config is used. When using platforms from the pagebuilder plugin, the preview plugin will first look for the domain within the linked platform as a base url, otherwise it will fallback on the settings inside plugins.ts. Make sure the STRAPI_PREVIEW_SECRET exists. The domains config uses the DTAP_ENV variable to determine the environment. If no config is set for the current environment, it will use the same base domain as Strapi.
./config/plugins.ts
module.exports = ({ env }) => ({
// ...
preview: {
enabled: true,
config: {
secret: env('STRAPI_PREVIEW_SECRET'),
path: '/next/api/preview',
defaultLocale: 'nl',
domains: { default: { development: 'http://localhost:3000' } }
}
}
// ...
});Then, you'll need to build your admin panel:
# Using Yarn
yarn build
# Or using NPM
npm run build