Permalink
Browse files

Added templating overview

  • Loading branch information...
1 parent 5215520 commit 58042bc9c2417a59e396a934e7ff60107f34f856 @lakshmivyas lakshmivyas committed Mar 13, 2011
Showing with 71 additions and 6 deletions.
  1. +1 −1 content/index.html
  2. +66 −0 content/templates/index.html
  3. +0 −5 content/templates/jinja2.html
  4. +2 −0 links.yaml
  5. +2 −0 site.yaml
View
@@ -87,7 +87,7 @@
[hydeid]: http://groups.google.com/group/hyde-dev/web/hyde-1-0
[Jekyll]: http://jekyllrb.com
[evil twin]: http://ringce.com/blog/2009/introducing_hyde
-[Jinja2]: http://jinja.pocoo.org/
+[Jinja2]: {{ links.jinja2 }}
[object model]: [[template/#variables]]
[hyde]: https://github.com/hyde/hyde
[install]: [[install]]
@@ -0,0 +1,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% sepration, 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]]]
@@ -1,5 +0,0 @@
-===
-title: Jinja2
-subtitle: Using Jinja2 templates in hyde
-index: 6
-===
View
@@ -0,0 +1,2 @@
+jinja2: http://jinja.pocoo.org/
+jinja2docs: http://jinja.pocoo.org/docs/templates/
View
@@ -33,6 +33,8 @@ context:
-
name: hyde-basic-tag-list
description: List of blogs posts with a specific tag
+ providers:
+ links: links.yaml
meta:
extends: doc.j2
default_block: doc

0 comments on commit 58042bc

Please sign in to comment.