- check! initial branding seems broken currently, at least for Premium Starter. Maybe a consequence of failed merges with Lughausen repository
- add section pointing at and explaining DSA DS
- document global component / reference usage
- document token extraction (and how to add values)
- document image optimizations
- document initial schema mismatch in Storyblok after init (needs hard refresh in browser to load correct component schemas)
- document index page configuration: https://github.com/kickstartDS/storyblok-starter/blob/main/helpers/storyblok.ts#L324
- fix global element error on initial
push-components
This project provides a starter template for building marketing websites using Storyblok and a Design System backed by kickstartDS. It includes pre-configured components, content schema, and best practices to streamline development and ensure consistency.
You can learn more about it on our dedicated landing page for these starters:
https://about.design-system.agency/
To start, you'll need some environment variables defined here, and accounts with Netlify, Github and Storyblok, see here.
TODO add note about continuing with "Manual" if you don't need / want this... refer to other options (Vercel et al), too. But those just as a side note
For other hosting options have a look at our hosting section. You can also do everything manually, too!
- TODO
- Features
- Requirements
- Getting Started
- Local Development
- Configuration
- Customization
- Technical background
- Contributing
- License
- Support
TODO maybe split this into some topical sections to make it more digestible
This CMS Starter comes prepared with a nice list of features out-of-the-box:
- Easy theming for brand compliance
- Flexible landing pages, build up freely from sections
- Perfect Lighthouse scores for Performance, A11y, Seo and Best Practices
- Structured blog / news posts, and blog / news overview
- Editable, global header and footer
- Basic and free: 10 ready-to-use components with a total of 30 variants
- Premium: 14 ready-to-use components with a total of 43 variants
- Layout components for sections (with 9 variants) and sliders (with 3 variants)
- Presets for all components, including preview screenshots
- Global element support, selectively manage content in a central place (e.g., blog authors)
- Full TypeScript support, including content schemas
- Editable 404 pages, add any content you like yourself
- Icon picker for custom icon sprite, as a Storyblok field plugin
- Image optimization (blurhashes, responsive image resizing, Design System token connected)
- Content alt-tag support, with fallback to general asset alt if not defined
- Optimized font loading, with granular control over swapping behaviour
- High performance option, to render completely without React + Next.js ("fully static")
- Sitemaps + robots.txt automatically generated
- Built-in page, settings, and Seo templates
- Easy custom template support (e.g., structured page types like products, events, etc)
- Fully automated initial setup, < 30 minutes to production
- Config automatically generated from Design System component APIs
- Automated content generation from Storyblok Ideas with AI prompter
- Node /
npm
: Ensure you're using the correct Node version (18+) locally;nvs use
,nvm use
for automatic selection, if you use one of those tools. mkcert
: for local setup, to get a locally trusted SSL certificate... needed to run inside the Visual Editor iframe ofapp.storyblok.com
- If you want to go with the default hosting setup, you'll need an account with Github (code repository hosting) and Netlify (website hosting and build process)
- A Space: Create a new Storyblok Space to host your project (you can just go with the free "Community" tier here, to start): https://app.storyblok.com/#/me/spaces/new
- If you want to use video files in your space, you'll also need a verified space by adding a credit card to it... or by contacting support to add that flag for you (TODO additional note about this being required in premium)
- If you want to go with the default hosting setup, you'll need an account with Github, for code repository hosting,
- and one with Netlify, for website and build process hosting
TODO add general note that nothing here needs to be done with Github and / or Netlify, and while some commands might change slightly... everything should be much the same no matter where you want to host
The following variables depend on you already having created a Storyblok Space: see here.
Variable | Description | Where to find |
---|---|---|
NEXT_STORYBLOK_API_TOKEN |
The Preview API Token for your Storyblok Space. | You can find the needed Preview API Token in those same "Settings", but in the sub page called "Access Tokens". You can just use the initially created Preview -Token (just copy it using the handy icon).This is used to consume your content when building or previewing your website |
NEXT_STORYBLOK_OAUTH_TOKEN |
The Management API OAUTH Token for your Storyblok account. | Your Management API OAUTH Token needs to be created in your "My account" settings, just follow this guide: https://www.storyblok.com/docs/api/management/getting-started/authentication This is only used initially, to set up your project (adding components, presets, content and assets). |
NEXT_STORYBLOK_SPACE_ID |
The Space ID for your Storyblok Space. | You can find the Space ID in your Storyblok Spaces "Settings", on the initially opened page (called "Space"). Make sure to exclude(!) the # sign in front of it (297364 instead of #297364 ) |
STORYBLOK_LOGIN_EMAIL |
The email address for the account you created the Storyblok Space with. | If you're not sure about this, just double check here: https://app.storyblok.com/#/me/account?tab=account |
STORYBLOK_REGION |
The region your Storyblok Space is hosted in. | This is the one you selected when creating your new Space. Can also be found on the same page the Space ID is displayed on (see above) |
NEXT_PUBLIC_SITE_URL |
The URL of your site. | The full URL with protocol, without a trailing slash, where your production setup will live. For new projects this can be the *.netlify.app one provided by Netlify, later on this will be your real production URL |
The Netlify Deploy button provides an easy and convenient way to deploy your project to Netlify. By clicking the button, you can quickly set up your project on Netlify and Github without manually configuring the deployment settings. It automates the process and ensures that your project is deployed correctly with just a few clicks. This saves time and effort, especially for users who are new to Netlify or want a streamlined deployment process:
For other options see hosting or go down the manual route.
When going the manual route, you'll need the same environment variables, but you'll start the project initialization locally. This can all be done without involving any specific hosting.
Setup consists of creating your own code repository, cloning the project and running the Storyblok project inititialization locally.
ℹ️ initialization itself can take a while (2-3 minutes), as in the process of adding all demo content, components and presets we also upload quite a lot of assets (especially component and preset previews) according to the throttling imposed by Storyblok
- Fork the starter to your own account or organisation, this way you can easily benefit from future improvements: https://github.com/kickstartDS/storyblok-starter/fork
- Clone the forked repository to your local machine
- Switch to the freshly cloned directory, and inside:
npm i
to install dependencies- Copy
.env.local.sample
to.env.local
, and replace all placeholders, see above for definitions... and where to find them - (Re-)login to the Storyblok CLI:
npm run storyblok-logout
followed bynpm run storyblok-login
. The logout first ensures the CLI can actually see all projects, especially newly created ones (which would be likely for a starter like this) can error out otherwise. Use your Storyblok-Login and the region chosen when creating your Space here - Run the project initialization:
npm run init
. This removes demo content, adds all the needed preset and demo content images (into distinct folders, as not to pollute your future project), all components and preset configuration, and creates an initial demo page - Final small adjustment you need to make is to add your future site url in
.env
(variableNEXT_PUBLIC_SITE_URL
) - You can now commit & push all the locally updated files (
git add --all && git commit -m "Initial Storyblok setup" && git push origin main
)
Changed files in detail:
Filename | Description |
---|---|
cms/components.123456.json |
The automatically generated component schema, which was already part of the repository when forked (you can regenerate it with npm run create-storyblok-config ). It now includes the correct asset references for visual component previews |
cms/presets.123456.json |
The same for presets, now with updated asset references for visual preset previews and correct space and component id references |
types/components-schema.json |
Your live component schema pulled from Storyblok (seeded by cms/components.123456.json , this now includes all correct ids and references, pulled by npm run pull-content-schema ) |
types/components-presets.json |
The same for presets |
types/components-schema.d.ts |
Includes TypeScript types matching your content and component schemas. This is generated based off your components-schema.json by using storyblok-generate-ts |
.env |
Contains general project related configuration, should contain your updated website url |
If you want to add this project to Netlify without using the Netlify Deploy button:
- Add a new site in your Netlify dashboard, choose "Import an existing project"
- Select the repository you forked here, presumably from Github
- Choose a fitting name, and leave the rest of the settings as is... only add the following variables through "New variable" in "Environment variables" (see here for definitions / where to find those):
NEXT_STORYBLOK_API_TOKEN
NEXT_STORYBLOK_OAUTH_TOKEN
NEXT_STORYBLOK_SPACE_ID
STORYBLOK_LOGIN_EMAIL
STORYBLOK_REGION
- Run the first deployment for your project by hitting the final button
- You should be able to open the site url configured in Netlify now
Irrespective of going the manual route, or using the Netlify Deploy button, you'll want to configure some more integration between Storyblok and Netlify.
ℹ️ As for all those hosting options, this works the same for other hosters like Vercel as well... you'll just have to change some values around a bit.
To automitcally trigger your build process in Netlify, deploying a new version of the site in the background whenever an editor adds, deletes or changes a Story in Storyblok:
- Open the settings for your Netlify site ("Site configuration"), and switch to "Build & deploy" -> "Continuous deployment". Scroll down to the section titled "Build hooks", and click "Add build hook"
- Give that hook a distinct name (e.g. "Storyblok"), and probably keep
main
as the branch to build from - Save and copy the generated hook URL
- Open your Storyblok Space "Settings", and switch to "Webhooks"
- Click "+ New Webhook", and give hook a distinct name, too (e.g. "Netlify")
- Replace the "Endpoint URL" with the copied URL from Netlify
- For "Triggers", open "Story" and select all 4 entries
- Save the hook
Read more about Webhooks and Storyblok: https://www.storyblok.com/docs/guide/in-depth/webhooks
To view a hosted preview inside the Storyblok Visual Editor, e.g. after your first successful Netlify deployment:
- Open the Storyblok Spaces "Settings", and switch to "Visual Editor"
- For "Location (default environment)" enter the site URL configured in Netlify, with
/api/preview
added to it (e.g. if your site URL happens to behttps://storyblok.netlify.app
, the URL you'd enter would have to behttps://storyblok.netlify.app/api/preview/
) - Save your changes by hitting "Save" at the top right
- On the main "Content" pane, open the page "Getting Started", that was created on initial project setup
- If you already went through configuring a local preview URL, you will most likely have to change back to the default preview environment now by clicking on the settings icons (cogs) on the top right of the preview frame
Read more about the Visual Editor: https://www.storyblok.com/docs/guide/essentials/visual-editor
TODO
TODO, possibly document switching authors to be global
TODO, also document switching Blog Teasers to Blog Post references
TODO
TODO
Using this, you can essentially forego any hosting setup to start testing or developing. Start using just your local setup and a Storyblok Space.
This is also the setup we encourage to use to test changes before commiting / pushing them to production, even if already using a hosting setup.
- Inside the project directory start by creating a local certificate for the project:
mkcert localhost
. This generates local key and cert files used when starting the local server (you don't commit those, which is why they're on the.gitignore
) - Run a first full build with
npm run build
- Start the local server (including proxy) with
npm run dev
- Open your Space in Storyblok (https://app.storyblok.com)
- Go into the projects "Settings", and open the entry "Visual Editor"
- Add a new "Preview URL" called "Development", and set its value to
https://localhost:3010/api/preview/
- Save your changes by hitting "Save" at the top right
- On the main "Content" pane, open the page "Getting Started", that was created on initial project setup
- At the top of the window, inside the simulated address bar of the page preview, click on the small settings icon to the right... and select your "Development" Preview URL
- Et voila... you should see your locally hosted page preview
TODO: check initial npm run init
locally again... failed for push-components
in initial try, because of missing environment variable NEXT_STORYBLOK_SPACE_ID
in push-components
script
There's a lot that needs to be configurable, to make a good starter. This involves stuff like applying your branding, configuring technical SEO aspects or generally changing the setup to your liking. Here you'll find short descriptions for all of those aspects.
When getting started with your Design System, you will find the current Design Token set to be pretty bland and boring... this is because you are looking at the default, pretty much unstyled versions of components.
TODO link https://design-system.agency/
There are two concepts involved with design and token application in kickstartDS:
- Branding Token: Small set of expressive values to seed your initial Design Token set
- Design Token: Managed Style Dictionary containing your semantic Design Token set
Branding Token are set in src/token/branding-token.json
, while your Design Token set lives at src/token/dictionary
. Initialization of token happens through yarn init-tokens
, while compiling your Design Token set to Component Token (among other formats) is done by running yarn build-tokens
.
Component Token are the third type of token involved, but those only come into play later. They are not concerned with the general styling / theming of your Design System, but rather map your Design Token set to components in a layered way.
To learn more about this process, follow the section "2. Design Application" of our "Create your Design System" guide.
TODO link theming page https://about.design-system.agency/theming/
Use this to adjust the included component and preset previews, shown when working with content inside your Storyblok Space. By default, these will feature the demo design included with this starter. After you've applied your own branding to this starter TODO link this to section about design application, you'll probably want to update said previews, too!
TODO link https://design-system.agency/
YOUR_WEBSITE
should be the path pointing to your website project, the one you want to update the previews for.
TODO adjust this to ds-agency
on non-premium version
- Clone the Design System this is based on locally: https://github.com/kickstartDS/ds-agency-premium
- Switch to the freshly cloned directory, and inside (ensure you're using the correct Node version 18+;
nvs use
,nvm use
for automatic selection, if you use one of those tools):yarn
to install dependenciesrm -rf src/token
to remove the existing default themecp -r YOUR_WEBSITE/token src/token
to copy your Design Token / Style Dictionary configuration to the Design System project- Adjust the
background-color
for the.preview--wrapper
CSS class inglobal.scss
, to a color suitable for your component screenshots (depends on your applied design)- Optionally, if you've done customizations in
index.scss
, you should add an import to the file.storybook/preview.tsx
(e.g. right after the already existingimport "./preview.css";
):import YOUR_WEBSITE/index.scss
- If you've also changed your fonts, you should probably change the content of
fonts.scss
accordingly (if not done already). Finally uncomment the font import inindex.scss
temporarily, to include the correct fonts in preview generation. Fonts are normally loaded by Next.js, which is missing when building from Storybook.
- Optionally, if you've done customizations in
yarn build-storybook
to build a Storybook that can then be used to create screenshotsyarn create-component-previews
to re-create the existing previews with your brandingmkdir -p YOUR_WEBSITE/public/img && rm -rf YOUR_WEBSITE/public/img/screenshots && cp -r static/img/screenshots YOUR_WEBSITE/public/img/
to copy the generated screenshots to your projectcd YOUR_WEBSITE
to switch to your website projectnpm run update-previews
to update those newly created screenshots in your Storyblok space (can take 2-3 mins)
- That's it!
Reminder: Undo the import for fonts.scss
in index.scss
if you had to change that for your previews, otherwise you'd load redundant fonts on your page later.
TODO update this, outdated... but still a good idea to document
Generate ts types according to the content schema by running
NEXT_STORYBLOK_SPACE_ID=<your-space-id> npm run generate-content-types
.
When changing the content schema we recommend sticking to Storyblok's Best Practices.
TODO
TODO
TODO
TODO
TODO
TODO
- TODO document customizing DSA component token / SCSS
- TODO document new component (example Info Table; add notices about providers / image optimization)
- TODO document customizing a new component
- TODO document adding a custom template type
- TODO document switching to your own Design System instance
TODO detail Design System concept of components, templates and globals
Contributions are welcome. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.
This project is licensed under either of
at your option.
The SPDX license identifier for this project is MIT OR Apache-2.0.
For more information and updates, please visit the project's GitHub repository.
Join our Discord community for support, or leave an issue on this repository!