Templates are used to contain a page’s or post’s content. All templates have access to a global site object variable:
site as well as a page object variable:
page. The site variable holds all accessible content and metadata relative to the site. The page variable holds accessible data for the given page or post being rendered at that point.
Create a Template
Templates are created by properly formatting a file and placing it in the _layouts directory.
Templates should be coded in HTML and contain YAML Front Matter. All templates can contain Liquid code to work with your site’s data...
Content in Jekyll is either a post or a page. These content “objects” get inserted into one or more templates to build the final output for its respective static-page.
#####Working With Posts Posts and Pages Both posts and pages should be written in markdown, textile, or HTML and may also contain Liquid templating syntax. Both posts and pages can have meta-data assigned on a per-page basis such as title, url path, as well as arbitrary custom meta-data.
Creating a Post
Posts are created by properly formatting a file and placing it the
A post must have a valid filename in the form
YYYY-MM-DD-title.MARKUP and be placed in the _posts directory. If the data format is invalid Jekyll will not recognize the file as a post. The date and title are automatically parsed from the filename of the post file. Additionally, each file must have YAML Front-Matter prepended to its content. YAML Front-Matter is a valid YAML syntax specifying meta-data for the given file.
Ordering is an important part of Jekyll but it is hard to specify a custom ordering strategy. Only reverse chronological and chronological ordering is supported in Jekyll....
installing jekyll you’ll need to format your website directory in a way jekyll expects. Jekyll expects your website directory to be laid out like so:
my-awesome-site ├── assets │ ├── css │ │ └── style.css │ └── js ├── _config.yml ├── _includes ├── index.html ├── _layouts │ ├── default.html │ └── post.html ├── _posts │ ├── 2015-04-08-consectetur-elit.md │ └── 2015-04-09-consectetur-elit-2.md └── _site
assets This directory is not part of the standard jekyll structure. The assets directory represents any generic directory you happen to create in your root directory. Directories and files not properly formatted for jekyll will be left untouched for you to serve normally....
#####So what is “Jekyll” and why use “Jekyll”?
“Jekyll” is a static site generator, it transforms your plain texts into static sites and blogs. Jekyll is Not Blogging Software. Jekyll is a parsing engine. There is no database to inject and no CMS, there’s only files. It is written in “Ruby” programming language and uses “RubyGems” package manager.
There’s a hand full of static site generator out there. But “Jekyll” is most popular of them.
It’s so easy to integrate that you don’t need any separate hosting, you can use github pages to deploy your site!
“Jekyll” is well documented, you can find full documentation on jekyllrb.com website...