WordCamp Bristol 2017 talk project files
Get Twig. Use Twig. Smile.
Three example themes for you to play with:-
- Twig - Uses Twig via the Timber plugin. Includes an integrated styleguide via Spress.
- Child - Child of Twig theme, demonstrates how you can override twig templates in child themes.
- Normal - Same design as the Twig theme but no Twig.
Getting up and running
- Setup a WordPress install and add these three themes
- Install the Timber plugin https://en-gb.wordpress.org/plugins/timber-library
The styleguide is integrated into the
twig-theme. It is a static site generated by Spress.
You can view the styleguide in two ways:-
Setup a dev domain to point at the
Install Spress and run Spress local server
- Follow the getting started page on the Spress.
- Using the command line
cdinto that directory and run
./watch.sh, this will start Spress's built in server and serve the site from
Notes on symlinks
The partials directory in
twig-theme/styleguide/src/includes contains all the twig templates shared by
twig-theme and the styleguide. Unfortunately I could not get symlinked folders to work inside the styleguide so I've had to place the files within the styleguide and symlink them out to the main folder of
It would be better if there was a way in Spress to specify other directories outside of the Spress folder to look in when generating the static site.
I think this might not be too hard to do so I plan on giving it a go an submitting it patch to Spress if I manage it.