kirby-devkit
kirby-devkit copied to clipboard
This repo is a starting point for using Kirby with Gulp and Npm. It is made for developers to bootstrap their own projects quickly.
Kirby Dev Kit v4
This repo is a starting point to use Kirby 4 with Gulp and Npm and a minimal Bootstrap 5. It is made for developers to bootstrap their own projects quickly.
Requirements
You will need Npm and GIT (for the Kirby submodules) to use this project.
Setup a new project
- clone this repo :
git clone https://github.com/julien-gargot/kirby-devkit.git path/to/your-project
cd path/to/your-project
git submodule update --init
- install Npm :
npm ci
Configure your server and site settings
-
rename the file in
site/config/config.localhost.php
to your local development site URL check out Multi-environment setup. Theenvironment
variable is used to load minified or unminified CSS/JS versions (checkoutsnippets/header.php
andsnippets/footer.php
). -
setup your localDevUrl in
assets/manifest.js
to be able to use live reload (see Compile Assets).
Compile Assets
- to compile all files, for development and production :
gulp
- To make it faster, while developing, you can watch for changes to CSS and JS files in the assets folder. This task only compiles development files.
gulp watch
for dev purpose you can also use:
gulp watch --no-purge
NB As a CSS purge is configured globally by default, if you want to save particular class (created by JS, load from external API, etc.), the easiest way is to create a site/snippets/purge.php
with your custom HTML.