Please tell me how to create a basic Jekyll site. I am especially confused about the file _config.yml and the YAML front matter.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t quite understand the wording of you questions, but I’ll take a shot. I’m guessing you are referring to one of two things. Either the config file or the YAML front matter. Whichever one, see below for a basic primer to get a jekyll site up and running. It shows the usage of both in context.
In an empty directory, create the following:
A new directory named
_layouts.A new directory named
_posts.A new directory named
_site.A file named
index.mdwith the following content:(Note: the “layout: default” surrounded by the two lines of dashes is the YAML Front Matter. Specifying “default” means that jekyll will use the “default.html” file in the _layouts directory listed below.)
A file named
_config.ymlwith the following default content:There are two more files you’ll want to create for the example,
Inside the “_layouts” directory, a file named
default.htmlwith the following:Inside the “_posts” directory, a file named
2011-07-29-my-first-jekyll-post.mdwith the following:(Note: Once again, the “layout: default” surrounded by the two lines of dashes is the YAML Front Matter and specifies that “default.html” will be used for the template.)
At this point the directory structure should look like this:
Once all that is setup, from the command line go to the directory that has the index.md file in it and run
jekyll. You should see a quick report like:Two output file will have been created:
Those files correspond to the two markdown files after the were transformed to HTML and dropped into the default.html wrapper replacing the “{{ content }}” string.
That should get your started with the basics.