Giter Site home page Giter Site logo

mandrasch / sveltekit-headless-wp-rest-demo Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 21.77 MB

Connect SvelteKit to WordPress REST API. Styling via PicoCSS. Keep it simple!

Home Page: https://sveltekit-headless-wp-rest-demo.vercel.app/

License: MIT License

JavaScript 29.21% HTML 2.10% Svelte 49.26% SCSS 19.43%
ddev picocss wordpress sveltekit

sveltekit-headless-wp-rest-demo's Introduction

SvelteKit Headless WP REST API demo

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.

Screenshot of website

Screenshot of website

Local setup

npm install
# Copy .env.example to .env
npm run dev -- --open

Local backend (optional)

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

Deployment

TODOs

How was this created?

# 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

Resources used

Credits

License

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.

sveltekit-headless-wp-rest-demo's People

Contributors

mandrasch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sveltekit-headless-wp-rest-demo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.