Warning
UPDATE: Localization is now a paid feature in Builder.io so this repo doesn't really work anymore if you don't choose one of Builder's paid plans :( I personally won't be using Builder.io for future client projects because they are not transparent regarding pricing changes and broke my personal site in prod without informing me.
CMS boilerplate repos suck. This one doesn't.
π¦Ί Typescript
β‘ Next13 (no app dir yet)
π·ββοΈ βBuilderβ.io
π TailwindCSS
π Localization
- Create a Builder.io account and get your API key (in your space under Account)
- You most likely want to disable Builder's built-in components (this step ensures editors only use the components you've built)
- Get a primer on how Builder works over in their Docs
Get familiar with the repo's structure before you start building your site. I added some comments to help you understand what's going on.
π¦ your-project
β£ π node_modules
β£ π public
β£ π components
β β£ π builder I recommend separating builder components from other components
β β β π Card.tsx example builder component
β β π LanguageSwitch.tsx example language switch component
β£ π styles
β β π globals.css
β£ π pages
β β£ π _app.tsx used to import styles, you probably won't need to edit this
β β π [[...page]].tsx catch-all route for all pages, including index
β£ π builder.config.ts register your components here
β£ π .eslintrc.json
β£ π postcss.config.js
β£ π tailwind.config.js
β£ π tsconfig.json
β£ π.gitignore
β£ π.env.local.example reference for your .env.local file, don't fill out this file
β£ π READMEβ.md
β£ π next.config.js update locales here
β£ π package-lock.json
β π package.json
- Create a
.env.local
in the root of the project and add your API key as specified in.env.example
Warning Don't fill out
env.local.example
- Specify the locals you want to use in
next.config.js
(see Next.js docs for more info) - Run the following commands
npm i
npm run dev
- In builder, create a new page and drag and drop the 'Card' component onto the page
- Localize some of the card's content to test the i18n setup
- Create a new react component in
/components
- Update
builder.config.ts
to include the new component (see Builder docs for more info) - If everything is working correctly, you should be able to see the component in the Builder UI and add it to a page
- I recommend using Vercel for deployment
- Add the environment variable to your project before deploying
- Deploy!
- When you're done, update the preview URL in Builder (in your space settings) to point to your deployment URL
Please feel free to contribute to this repo!
- Add fetch example for CMS Data models
- Add example on how to use Section models (prob commented out code block on how to use section for home)
- Remove
any
in page - Look into loc pricing plan changes