Boilerplate with Twig / Bootstrap / SCSS / jQuery
- Build assets using Vite.js
- Twig support
- Bootstrap support
- jQuery support
This project uses Yarn as package manager
npm install --global yarn
Clone the project
git clone https://github.com/Romaixn/boilerplate-vite-twig.git
Go to the project directory
cd boilerplate-vite-twig
Install dependencies
yarn install
Start the server
yarn dev
Create a twig file in the templates folder with this minimal content:
{% extends "base.html.twig" %}
{% block body %}
Your content here
{% endblock %}
The content of the page will go between the
block body
and theendblock
Add the page in .html format to the root of the project. (next to index.html and about.html) With this minimal content:
<script type="application/json" data-template="templates/name-of-your-page.html.twig">
{
}
</script>
Replace
name-of-your-page
by the name of your template
You can add any variables you want in JSON. (a list of items for use in loop, the title of the page, etc..)
Add your page in vite.config.js
file in the root of the project.
To build your assets run
yarn build
Contributions are always welcome!
See contributing.md
for ways to get started.
Romain Herault - @Romaixn
Project Link: https://github.com/Romaixn/boilerplate-vite-twig