1 / 21

RubyAZ Jekyll Presentation Slides

Curtis Miller of Flatterline presents for the Ruby AZ meeting December 2011 on Jekyll, a blog-aware, static site generator in the Ruby programming language. /nJekyll was originally created by Tom Preston-Werner and Nick Quaranto for use on GitHub./nJekyll takes a template directory (representing the raw form of a website), runs it through Textile or Markdown and Liquid converters, and spits out a complete, static website suitable for serving with Apache or your favorite web server. It can be used to host a project’s page or blog.

Flatterline
Télécharger la présentation

RubyAZ Jekyll Presentation Slides

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. jekyll Blogging for Hackers Curtis Miller / Flatterline

  2. Static Site Generator

  3. Ruby + Liquid + YAML = Awesome!

  4. 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

  5. Configurable _config.yml

  6. 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

  7. What’s Built In? • Pagination • Custom permalink structure • Related post extraction (use with GSL for faster generation) • Syntax highlighting • Markdown / Textile conversion

  8. Plugin Architecture (easily extensible) _plugins/*.rb

  9. Need a Custom Generator?

  10. No Problem. module Jekyll class CategoryGenerator < Generatordef generate(site) end endend

  11. Need a Custom Liquid Tag?

  12. No Problem. module Jekyll class RenderTimeTag < Liquid::Tagdef render(context) end endend Liquid::Template.register_tag(‘render_time’, Jekyll::RenderTimeTag )

  13. Deployment • Heroku free instance • GitHub Pages • Directly to Amazon S3 • Anywhere that can serve static pages!

  14. What If I Want Blog Comments? Extend with Disqus, Intense Debate or Facebook comments

  15. What If I Need Something Dynamic? Extend with Sinatra

  16. 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

  17. 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

  18. A Few Stats (as of 2011-12-20) • Over 400 documented sites using Jekyll • ~50 plugins • >4,500 watchers • >700 forks

  19. How Do I Get Started?!

  20. gem install jekyll

  21. Thanks! Any questions? Curtis Miller / Flatterline / curtis@flatterline.com https://github.com/flatterline/flatterline.com

More Related