--- title: Jekyll layout: default jekyll_escape: true --- ### Installation $ gem install jekyll ### Directories _config.yml _drafts/ _includes/ header.html footer.html _layouts/ default.html _posts/ 2013-09-02-hello.md _site/ ... ## [Front-matter](http://jekyllrb.com/docs/frontmatter/) --- layout: post title: Hello --- ### Other frontmatter stuff permalink: '/hello' published: false category: apple categories: ['html', 'css'] tags: ['html', 'css'] Configuration ------------- source: . destination: _site exclude: [dir, file, ...] include: ['.htaccess'] ### Reference * [Configuration](http://jekyllrb.com/docs/configuration/) ## [Variables](http://jekyllrb.com/docs/variables/) {\{ site }} - from config.yml {\{ page }} - from frontmatter, and page-specific info {\{ content }} - html content (use in layouts) {\{ paginator }} - ... ### Site {\{ site.time }} - current time {\{ site.pages }} - list of pages {\{ site.posts }} - list of posts {\{ site.related_posts }} - list {\{ site.categories.CATEGORY }} - list {\{ site.tags.TAG }} - list {\{ site.static_files }} ### Page {\{ page.content }} - un-rendered content {\{ page.title }} {\{ page.excerpt }} - un-rendered excerpt {\{ page.url }} {\{ page.date }} {\{ page.id }} - unique id for RSS feeds {\{ page.categories }} {\{ page.tags }} {\{ page.path }} {\{ post.excerpt | remove: '
' | remove: '
' }} {\{ post.excerpt | strip_html }} {\{ page.next }} {\{ page.previous }} ### [Paginator](http://jekyllrb.com/docs/pagination/) {\{ paginator.page }} - page number {\{ paginator.total_posts}} {\{ paginator.total_pages}} {\{ paginator.per_page }} {\% for post in paginator.posts %} ... {\% endfor %} {\% if paginator.previous_page %} Previous {\% else %} {\% endif %} {\{ paginator.next_page }} - page number {\{ paginator.next_page_path }} ... {\% if paginator.total_pages > 1 %} {\% endif %} Add this to `_config.yml`: paginate: 5 paginate_path: "blog/:num" ### Code {\% highlight ruby linenos %} def show ... end {\% endhighlight %} Markup ------ ### Loops {\% for post in site.posts %}