21
jekyll Blogging for Hackers Curtis Miller / Flatterline

Jekyll Presentation Slides

Embed Size (px)

DESCRIPTION

Presentation slides from the December 2011 RubyAZ meeting. Curtis Miller of Flatterline presented on Jekyll, a static site generator that uses Ruby, Liquid and YAML.

Citation preview

Page 1: Jekyll Presentation Slides

jekyllBlogging for Hackers

Curtis Miller / Flatterline

Page 2: Jekyll Presentation Slides

Static Site Generator

Page 3: Jekyll Presentation Slides

Ruby + Liquid + YAML = Awesome!

Page 4: Jekyll Presentation Slides

How Does It Work?

• Gathers content from _posts, _includes and other files

• Applies a template

• Converts Markdown and Textile to HTML

• Runs Liquid converters

• Outputs static HTML pages

Page 5: Jekyll Presentation Slides

Configurable

_config.yml

Page 6: Jekyll Presentation Slides

YAML Configuration

• Global configuration options

• Per page / post configuration options (YAML Front Matter)

• Add your own key / value pairs and use them as you see fit

Page 7: Jekyll Presentation Slides

What’s Built In?

• Pagination

• Custom permalink structure

• Related post extraction (use with GSL for faster generation)

• Syntax highlighting

• Markdown / Textile conversion

Page 8: Jekyll Presentation Slides

Plugin Architecture(easily extensible)

_plugins/*.rb

Page 9: Jekyll Presentation Slides

Need a Custom Generator?

Page 10: Jekyll Presentation Slides

No Problem.

module Jekyll class CategoryGenerator < Generator def generate(site) ... end endend

Page 11: Jekyll Presentation Slides

Need a Custom Liquid Tag?

Page 12: Jekyll Presentation Slides

No Problem.module Jekyll class RenderTimeTag < Liquid::Tag def render(context) ... end endend

Liquid::Template.register_tag( ‘render_time’, Jekyll::RenderTimeTag)

Page 13: Jekyll Presentation Slides

Deployment

• Heroku free instance

• GitHub Pages

• Directly to Amazon S3

• Anywhere that can serve static pages!

Page 14: Jekyll Presentation Slides

What If I Want Blog Comments?

Extend with Disqus, Intense Debate or Facebook comments

Page 15: Jekyll Presentation Slides

What If I Need Something Dynamic?

Extend with Sinatra

Page 16: Jekyll Presentation Slides

Typical Workflow

$ cd <my blog dir>$ foreman start

[Runs whatever you specified - e.g., Jekyll, Compass, Sinatra, etc.]

$ mate _posts/2011-12-20-jekyll-blogging-presentation-at-rubyaz.md

[Add content to file...]

$ git add _posts/2011-12-20-jekyll-blogging-presentation-at-rubyaz.md$ git commit -m “New post about Ruby AZ presentation”$ git push && git push heroku

Page 17: Jekyll Presentation Slides

Any Gotchas?

• YAML Front Matter means it’s a special file; No YAML, no special processing

• Pagination only works with HTML files (i.e., no Markdown or Textile pagination)

• No generator for initial directory structure

Page 18: Jekyll Presentation Slides

A Few Stats(as of 2011-12-20)

• Over 400 documented sites using Jekyll

• ~50 plugins

• >4,500 watchers

• >700 forks

Page 19: Jekyll Presentation Slides

How Do I Get Started?!

Page 20: Jekyll Presentation Slides

gem install jekyll

Page 21: Jekyll Presentation Slides

Thanks!

Any questions?

Curtis Miller / Flatterline / [email protected]

https://github.com/flatterline/flatterline.com