2.5 KiB
2.5 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
uuidtitledisqus_urldisqus_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_urlthe PRODUCTION canonical_url for this entityproduction_urlthe PRODUCTION url for this entityproduction_paththe PRODUCTION path for this entityurlthe full url in the current environment (might be production, development, etc)paththe non-host part (i.e./compiled_dev/articles/my-first-post.html)previousthe previous entity in this collectionnextthe next entitiy in this collection
NOTE: Plugins, widgets, etc SHOULD NOT modify config, site, authors, author, or env.
desi.posts
, posts: { collated: desi.collated }