restprint.blogg.se

Liquid notes tutorial
Liquid notes tutorial




For each new level in YAML, you indent two spaces.If you have just one extra space somewhere, it can cause the whole file to be invalid. Because YAML does use white space for the structure, YAML is extremely picky about the exactness of spaces.

liquid notes tutorial

This makes YAML much more human readable. It uses white space as a way to form the structure. This means you won’t see any kind of angle brackets. YAML (“YAML Ain’t Markup Language”) doesn’t use markup tags.Here are some basic characteristics of YAML: You can read about YAML from a lot of different sources. YAML itself doesn’t do anything on its own - it’s just a way of storing your data in a specific structure that other utilities can parse. However, because Jekyll uses Liquid, it gives you a lot of power to parse through your YAML data and make use of it. YAML is used in a lot of other systems and is a format completely independent of Jekyll. Note that you don’t actually have to use Jekyll when using YAML. Rather than just jump into YAML at the most advanced level, I’m going to start from ground zero with an introduction to YAML and how you access basic values in your data files using Jekyll. This will become more clear as we go through some examples.

liquid notes tutorial

Then, using Liquid syntax for loops and conditions, you access all of those values from the data file and splice them into HTML formatting. You might leverage one of the many different table of content frameworks (such as Navgoco) that have been created for this HTML structure. (I’ll go over more about YAML syntax in a later section.) You then create your HTML structure in another file, such as sidebar.html. You store your data items in a YAML file using YAML syntax. Here’s the basic approach in creating a table of contents.

liquid notes tutorial

Not many Jekyll themes actually have a robust table of contents, which is critical when you are creating any kind of documentation or reference material that has a lot of pages. This setup is most common when you’re trying to create a table of contents. One of the most interesting features of Jekyll is the ability to separate out data elements from formatting elements using a combination of YAML and Liquid.






Liquid notes tutorial