Forked from the original Pattern-Primer for PHP by adactio (Jeremy Keith)
Inspired by Ruby (Sinatra) version
This is a design communication, testing and process tool.
Create little snippets of markup and save them to the "patterns folder" (called _posts in Jekyll). The pattern primer will generate a list of all the patterns in that folder. You will see the pattern rendered as HTML. You will also see the source displayed in a textarea.
Why not? I wanted to implement the a version of Pattern-Primer for my Jekyll projects with only Jekyll dependencies (and no PHP dependencies). It can be built locally with a Jekyll/Ruby environment or uploaded as a static directory on a remote server β here is an example of that. If anything, this tiny effort proves that you can build things other than hacker blogs with Jekyll.
- If you haven't already, install Jekyll.
- Clone this repo.
- Copy your CSS file to css/global.css (replacing adactio's stock CSS) or copy your own CSS to the css directory and direct a link in the HTML to that file.
- IMPORTANT: in the
_config.yml
file, changebaseurl: '/Pattern-Primer-Jekyll'
tobaseurl: ''
- Create your own HTML snippets and add them to the
_posts
folder. - Run the command
jekyll serve
and open localhost:4000 in your browser.
- Clone/Fork this repo.
- Rename repo to
user.github.io
(user = your GH username). - Copy your CSS file to css/global.css (replacing adactio's stock CSS) or copy your own CSS to the css directory and direct a link in the HTML to that file.
- Create your own HTML snippets and add them to the
_posts
folder. - IMPORTANT: in the
_config.yml
file, changebaseurl: '/Pattern-Primer-Jekyll'
tobaseurl: ''
- After pushing all of your changes to GitHub
Master
branch, create a new branch and call itgh-pages
. - Visit your new site (may take up to 10 minutes to populate) at
http://user.github.io/
- Clone/Fork this repo.
- Copy your CSS file to css/global.css (replacing adactio's stock CSS) or copy your own CSS to the css directory and direct a link in the HTML to that file.
- Create your own HTML snippets and add them to the
_posts
folder. - IMPORTANT: in the
_config.yml
file, changebaseurl: '/Pattern-Primer-Jekyll'
tobaseurl: '/projectname'
- After pushing all of your changes to GitHub
Master
branch, create a new branch and call itgh-pages
. - Visit your new site (may take up to 10 minutes to populate) at
http://user.github.io/projectname
Learn all about Jekyll on GitHub Pages
One quirk of using this in Jekyll (or at least the quick way I created it) is that the patterns are stored in the "_posts" folder. Every post must have identical front matter that looks like this:
---
layout: pattern
---
... and each file must be named yyyy-mm-dd-title.html
. The date tag is arbitrary, but this will determine where it appears in order on the index. The default is set to 0001-01-01 for the packaged HTML snippets, but anything named newer than that will appear at the bottom of the list.
http://patternprimer.olivermak.es/
Note: my version uses the standard styles written by adactio.
The original Pattern Primer is by adactio and should be used if you prefer PHP or aren't already using Jekyll. Many thanks to Jeremy for this great tool!