2.6 KiB
2.6 KiB
Data
Every template gets an object with the exact same structure - whether it's a template or a widget or a page or a post.
Here we only document Desirae's default behavior, but there are many objects added for compatibility with Ruhoh that are not documented.
config.yml vs site.yml
site.yml is for anything that changes the content of the site (navigation, title, analytic and ad ids, default author, etc)
config.yml is for anything that doesn't change the site (from where to read directories, which order to load plugins)
desi = {}
desi
config
- literallyconfig.yml
, parsedsite
- literallysite.yml
, parsedauthors
- literally the authors fromauthors/*.yml
, parsedauthor
- the primary author of the siteenv
- urls and paths for this build (be it production, development, staging, etc)content
- pre-rendered content (i.e. content rendered into the post layout rendered into the default layout)collection
- config related to this collectionentity
- the page, post, article, etc that is the focus of the present template processthemes
- all themestheme
- the default themelayout
- the selected layout for this themesatch
- the selected swatch for this themecategories
- all categoriestags
- all tagsstyles
- ??? goes into the final template in the headscripts
- ?? that goes into the final template just before the body close
desi.entity
stuff
uuid
title
disqus_url
disqus_identifier
more stuff
type
-post
,page
, etcauthors
- literally the relevant authors fromauthors/*.yml
, parsedauthor
- the primary author of this entitytheme
- null or a non-default themelayout
- null or a non-default layout for this themeswatch
- null or a non-default swatch for this themecategories
: [] // all categories in all collectionstags
: [] // all categories in all collectionsproduction_canonical_url
the PRODUCTION canonical_url for this entityproduction_url
the PRODUCTION url for this entityproduction_path
the PRODUCTION path for this entityurl
the full url in the current environment (might be production, development, etc)path
the non-host part (i.e./compiled_dev/articles/my-first-post.html
)previous
the previous entity in this collectionnext
the next entitiy in this collection
NOTE: Plugins, widgets, etc SHOULD NOT modify config, site, authors, author, or env.
desi.posts
, posts: { collated: desi.collated }