-
Notifications
You must be signed in to change notification settings - Fork 1
Contentful Features
Contentful previews enable work in progress on Contentful to be rendered on a dedicated preview environment without the need for content to be in the published stage and shown in the staging environment.
The preview environment is currently accessible through
You will need a username and password to access the preview environment. You can find this information in our LastPass under Shared-LearningResources
Issue: Implement Contentful previews
We have been using Contentful to manage our content. It provides us with an API so developers can design the website and pull the content as necessary. A downside to having the content delivered via API is that content designers are unable to preview their content changes and see how it works with the website without first having to publish.
Contentful does provide a few ways to view unpublished content-- one of the simplest ways is through their preview API, a separate endpoint from their production API.
The codebase now has the ability to show Contentful work in progress on a live preview environment. To set this up, we rely on an environment variable called PREVIEW_ENV
to be set to true. Once this is set, you will have to make sure that the access tokens for the preview environment are set as well, as they will be needed to query the Contentful preview API.
PREVIEW_ENV=true
contentful_cpa_access_token=<preview access token>
You still need the regular, production Contentful access token to be set as this is needed during build. When nuxt generate
is run, it pulls the published content to generate the static files.
Once your webserver is running, hitting the website will show you published data unless:
- You have a
preview
as a subdomain in your URL (e.g. http://en.preview.learning-resources:3000/) - You are querying for
preview
in your query parameters (e.g. http://en.learning-resources:3000/topic/accessibility?preview=true)
npm run generate
npm run start
Can I see UI and other frontend updates in Preview?
WIP (Work in progress)
.....
Footer