-
Notifications
You must be signed in to change notification settings - Fork 6
Theme Creation
Ram Kaniyur edited this page Nov 22, 2017
·
1 revision
Themes are just Git repositories with a tree like this:
- assets/
- Images, CSS, etc.
- templates/
- index.html
- archive.html
- post.html
- Other templates.
- Other files, such as README.md.
The assets
folder is copied as out/assets
during the build step.
Templates are written in Tenjin. Each template has a specific set of variables passed to it, as documented below.
-
config: { ... }
- the contents ofLeven.toml
. -
posts: [{ content, title, date, slug }]
- theconfig.recents
most recent posts, from newest to oldest.
-
config: { ... }
- the contents ofLeven.toml
. -
posts: [{ content, title, date, slug }]
- every single post, from newest to oldest.
-
config: { ... }
- the contents ofLeven.toml
. -
post: { content, title, date, slug }
- the post currently being rendered. -
prev: { content, title, date, slug }
- the previous post. -
next: { content, title, date, slug }
- the next post.
Note: Dates have an iso8601
property that formats the date into an ISO 8601 string, rather than a user-formatted string. This can be used for client-side scripts.