initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
|
|
@ -0,0 +1,47 @@
|
|||
liquid
|
||||
|
||||
A templating language have 3 components ie objects, tags and filter
|
||||
1. objects are for values of variables. `{{page.title}}` will display value of `page.title`
|
||||
2. tags : for control flow
|
||||
```html
|
||||
{% if page.show_sidebar %}
|
||||
<div class="sidebar">
|
||||
sidebar content
|
||||
</div>
|
||||
{% endif %}
|
||||
```
|
||||
3. fllter : to change output
|
||||
eg: `{{ "hi" | capitalize }}` will display `Hi`
|
||||
|
||||
|
||||
**Front matter**
|
||||
Front matter is a snippet of YAML placed between two triple-dashed lines at the start of a file.
|
||||
- front matter variables
|
||||
```
|
||||
---
|
||||
my_number: 5
|
||||
---
|
||||
```
|
||||
calling value front end matter variable
|
||||
```
|
||||
{{ page.my_number }}
|
||||
```
|
||||
example
|
||||
```html
|
||||
---
|
||||
# front matter tells Jekyll to process Liquid
|
||||
title: home
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ page.title | capitalize }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{ "Hello World!" | downcase }}</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
```
|
||||
Loading…
Reference in a new issue