Work in progress. 👨💻
Live: https://sveltekit-headless-wp-rest-demo.vercel.app/
Content is fetched from WordPress demo backend https://nature-blog.mandrasch.eu/. Please use your own backend if you run big tests. The backend API URL can be configured in .env
-file.
npm install
# Copy .env.example to .env
npm run dev -- --open
See https://github.com/mandrasch/sveltekit-headless-wp-rest-demo-backend and switch in .env
-file to the following:
# .env
PUBLIC_WP_REST_API_DOMAIN=https://sveltekit-headless-wp-rest-demo.ddev.site
.env.example
and deploy# Frontend - SvelteKit
npm create svelte@latest frontend
cd frontend
npm install
npm i @picocss/pico
# Add picocss - https://joyofcode.xyz/using-pico-css-with-svelte
npm i -D sass
npm i -D svelte-preprocess
# Gutenberg styles:
npm install @wordpress/block-library --save
My own work (mostly config stuff) is available as CC0 / Public Domain, no need for attribution. Due to compatibility to SvelteKit and other packages, I also licensed this as MIT license.
Please see package.json
for a list of all used Open Source libraries and their respective licenses.