Getting started with Sculpin post
Download, install and configure
Sculpin is a static site generator written in PHP. It converts Markdown files, Twig templates and standard HTML into a static HTML site that can be easily deployed. As this site, it can be hosted on GITHUB pages.
- fork the sculpin-blog-skeleton repo
clone the repo and install Sculpin dependencies:
git clone git@github.com:benIT/github-blog.git cd github-blog composer installedit blog settings in app/config/sculpin_site.yml
run a local webserver on port 8000 to see your edits
php vendor/bin/sculpin generate --watch --serveradd content in
/source/_postsfolder
Create content
- edit your post content
- check result at localhost:8000
when result is enough good, generate site using :
php vendor/bin/sculpin generate --env=prodYour site html content should be available at
output_prod, it's the content of that folder that must be hosted on your github page
Deploy on github
About github pages
You can host html generated at 3 different locations :
- on
masterbranch - or
masterbranch indocsfolder on
gh-pagesbranchBut for your personal pages, you can only host in repo named
benit.github.ioon themasterbranch. This means, that we need 2 repos : one for source control and another one for hosting our github pages. Thus, I create the following repos :github-blog.gitandbenit.github.io
How to publish the content to the repo that hosts your github pages ?
I edit the shell script named publish.sh.
The script is in charge of:
- generating the html
- rsyncing the
output_prodfolder of the source control repo with thebenit.github.iorepo. - commiting on the 2 repos with the same commit message
- pushing on the 2 repo
Usage:
./publish.sh "edit post about Setting up a cool php development environment"
Categories: Sculpin