Building an Spress Svbtle Theme – Responsive Static Blogs!
You may have heard of Sculpin – a static site generator for PHP. Static blogs are, as you may know, blogs which you dynamically write in your app or on your local machine, and then export as a pure HTML version for hosting on static-only servers, for speed, reliability, and offline-first friendliness.
While easy to use and fast to set up, Sculpin’s development has stagnated a bit and the documentation leaves much to be desired. Spress is, in a way, its spritual successor. Much better documentation, much more flexible configuration, much easier to extend, and just as easy to use with almost the same API and commands.
In this tutorial, we’ll be building an Spress setup for generating a static blog with a custom theme.
Bootstrapping
This tutorial will assume you have a working PHP environment like Homestead Improved. For convenience, the following few lines will get you started immediately:
git clone https://github.com/swader/homestead_improved hi_spress
cd hi_spress
bin/folderfix.sh
vagrant up; vagrant ssh
After we’re in the VM, we can install Spress with:
wget https://github.com/spress/Spress/releases/download/v2.0.0/spress.phar
sudo mv spress.phar /usr/local/bin/spress
sudo chmod +x /usr/local/bin/spress
Spress is now available system-wide (or VM-wide if you’re using a VM), which can be verified by running spress
:
To create a sample site, we can use the instructions from the docs:
cd ~/Code
spress site:new myblog spresso
cd myblog
spress site:build --server
The site should now be accessible via http://localhost:4000
or if you’re in a VM like Homestead Improved, you should first forward port 4000 in Homestead.yaml
, run vagrant provision
outside of the VM, and then access the site via http://homestead.app:4000
:
Continue reading %Building an Spress Svbtle Theme – Responsive Static Blogs!%
LEAVE A REPLY
You must be logged in to post a comment.