This is a Jamstack kit helping you build secure (Mozilla Observatory: A+ score), fast (Lighthouse: 100 scores), multilingual and highly maintainable sites with Contentful (Compose ready) and Hugo.
Hugo Modules
hugo-modules/core
contains Hugo templates and utilities that support Contentful and/or Storybook projects.Packages
packages/create-wekit-app
contains a CLI tool to scaffold your WEKit app.packages/contentful-migrations
contains migration files for content models used in your app.packages/contentful-apps
contains ui extensions / apps used in your appApp Templates
templates/app
combines everything and shows a production-ready example.templates/theme-default
contains all components, modules and templates.Make sure all dependencies have been installed:
Set up Contentful:
npx contentful-cli login
.The easiest way to kickstart a new WEKit project using Contentful and Hugo is by using @jungvonmatt/create-wekit-app
.
This CLI tool enables you to quickly setup a new WEKit application, with everything set up for you.
To get started, use the following command:
npx @jungvonmatt/create-wekit-app@latest
The script takes care of the most important settings:
After that, you can try out the new app. To do so, change to the newly created directory and run
npm run storybook
. This will start the Storybook development environment with all the UI components
you selected. You can also start the Hugo development server by running npm start
. However,
you will only see an empty page because no entries have been created in Contentful yet.
Nice job so far. Now you can easily deploy your site to Netlify.
First, push the app to GitHub:
# Replace the origin with the correct URL to your repo
git remote add origin git@github.com:{ACCOUNT}/{REPO}.git`
git branch -M main
git push -u origin main
Create and configure a continuous deployment for a new site in Netlify:
npx netlify login
.npx netlify init
configures a continuous deployment for a new site.npx netlify env:import .env
imports the current environment variables.And last but not least we set up a webhook in Contentful:
You are now ready to deploy. Open the "Deploy to production" content entry and click Deploy. Switch to Netlify and check whether the webhook has run in. The build should now start and after a short while... Site is live ✨
We appreciate any help on our repositories. For more details about how to contribute, see our CONTRIBUTING.md document.
This repository is published under the MIT license.