User Tools

Site Tools


blogging_with_jekyll

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
blogging_with_jekyll [2021/03/22 21:43] – [Output markup] hc9blogging_with_jekyll [2021/03/22 21:44] – [Output markup] hc9
Line 42: Line 42:
 ==== Output markup ==== ==== Output markup ====
  
-Output markup is fairly simple. The basic format is ''<nowiki>{{</nowiki> variable | filter <nowiki>}}</nowiki>''. The variables are typically built into Jekyll, so one usually doesn't have to worry about declaring them. ''site'' is a variable that stores site-wide information in sub-variables. For example, ''site.posts'' is a list of all the site's posts. Each post has its own ''post'' variable, which includes information such as ''post.title'', ''post.url'', and ''post.date'' Another important variable is "content", which is used in templates to denote where the content will be inserted. A complete list of template data can be found [[http://wiki.github.com/mojombo/jekyll/template-data|here]]. Filters are used to manipulate theoutput of variables. When a filter is not specified (''<nowiki>{{</nowiki> variable <nowiki>}}</nowiki>''), the variable is simply printed. Liquid has a bunch of built-in filters that can be found, along with a whole summary of using Liquid, [[http://wiki.github.com/tobi/liquid/liquid-for-designers|here]]. Jekyll also has some of its own filters, such as ''number_of_words'' and ''array_to_sentence_string'', which turns an array variable into a list of words separated by commas and an "and." The complete list can be found [[http://wiki.github.com/mojombo/jekyll/liquid-extensions| here]], along with Jekyll's extra tags.+Output markup is fairly simple. The basic format is ''<nowiki>{{</nowiki> variable | filter <nowiki>}}</nowiki>''. The variables are typically built into Jekyll, so one usually doesn't have to worry about declaring them. ''site'' is a variable that stores site-wide information in sub-variables. For example, ''site.posts'' is a list of all the site's posts. Each post has its own ''post'' variable, which includes information such as ''post.title'', ''post.url'', and ''post.date'' Another important variable is ''content'', which is used in templates to denote where the content will be inserted. A complete list of template data can be found [[http://wiki.github.com/mojombo/jekyll/template-data|here]]. Filters are used to manipulate theoutput of variables. When a filter is not specified (''<nowiki>{{</nowiki> variable <nowiki>}}</nowiki>''), the variable is simply printed. Liquid has a bunch of built-in filters that can be found, along with a whole summary of using Liquid, [[http://wiki.github.com/tobi/liquid/liquid-for-designers|here]]. Jekyll also has some of its own filters, such as ''number_of_words'' and ''array_to_sentence_string'', which turns an array variable into a list of words separated by commas and an "and." The complete list can be found [[http://wiki.github.com/mojombo/jekyll/liquid-extensions| here]], along with Jekyll's extra tags.
  
 ==== Tag markup ==== ==== Tag markup ====
blogging_with_jekyll.txt · Last modified: 2021/03/22 21:46 by hc9