-
Notifications
You must be signed in to change notification settings - Fork 4
Development
- Clone the repository in Terminal
- Run
nvm installto install the correct version of Node - Run
npm installto install all Node dependencies
- Change to the project directory in Terminal
- Run
nvm useto ensure you're using the correct version of Node - Run
npm startto start a local development server and resume building
Type Control-C to shut down the dev server and get back to your life.
Pages live in the ./src/pages/ directory.
There's a 1:1 correlation between the file path in ./src/pages and their URL:
touch src/pages/about.html
open http://localhost:3000/about.htmlWant pretty permalinks? Use directories instead.
mkdir src/pages/about
touch src/pages/about/index.html
open http://localhost:3000/about/Magic ✨!
The starter project comes with one page -- the prototype index -- which renders a list of all pages. If you don't need it or want to build your own, feel free to remove it.
Pages can be authored in Twig. They'll be compiled to HTML when you run npm start or npm run build thanks to Gulp and Twig.js.
The ./src/templates directory is aliased to the puppy namespace, giving you a clean way to separate your pages from your base layouts and partials:
{# Will extend the template at `./src/templates/layouts/base.twig` #}
{% extends "@puppy/layouts/base.twig" %}
{# Will load the partial at `./src/templates/partials/header.twig` #}
{% include "@puppy/partials/header.twig" %}You can annotate your HTML or Twig pages with YAML front matter headers (as popularized by Jekyll) if you like:
---
title: About
tags:
- Awesome
- Amazing
---Attributes defined here will be exposed to Twig via the page variable:
<h1>{{ page.title }}</h1>
<ul>
{{ for tag in page.tags }}
<li>{{ tag }}</li>
</ul>The default index will use the title attribute to label your page.
- Sass
- PostCSS
- Referencing static assets
- Modernizr
- Babel
- Third party dependencies
- eslint
- stylelint
- Gulp
- Webpack