-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.html
More file actions
66 lines (50 loc) · 1.81 KB
/
index.html
File metadata and controls
66 lines (50 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
===
title: Creating layouts
subtitle: Overview on writing nice templates for hyde
index: 6
===
§§ blurb
Hyde is designed to support more than one template language for creating
layouts. However, hyde currently only supports [jinja2][]. This section of the
documentation will focus on creating templates using jinja2.
If you are not familiar with jinja2 its a good idea to go through the
[most excellent jinja2 documentation][jinja2docs].
§§ /blurb
## Site structure
Hyde encourages sepration of content from layout. The following shows a
typical structure of a hyde website.
~~~~~sh~~~~~~~~~
- content
- media
- css
- js
- images
about.html
index.html
- blog
- projects
- portfolio
- layout
base.j2
macros.j2
site.yaml
~~~~~~~~~~~~~~~~
A good objective is to have all the files in content contain as little layout
as possible and be written with a text oriented markup language like
`markdown`. While its not always possible to achieve 100% separation, hyde
provides several nice tools to get very close to that goal.
## Context Variables
Hyde by default makes the following variables available for templates:
* `site` - Represents the container object of the entire site
* `node` - The node (folder) where the current file resides
* `resource` - The resource (file) that is currently being processed
* Context Variables - All variables defined under the `context` section of
the site configuration are available to the templates.
Read more information about `site`, `node` & `resource` variables in
[site model documentation][sitemodel].
Read more information about context variables in the
[configuration documentation][ctxconfig].
[jinja2]: {{ links.jinja2 }}
[jinja2docs]: {{ links.jinja2docs }}
[ctxconfig]: [[config#context_data]]
[sitemodel]: [[[site_model]]]