Stacks API

Come build with us.
Stacks API v13 for Stacks 5.0


  <   Theme API


This content is open source. You can edit it and submit a pull request on GitHub.
This page is generated from this file.


© . YourHead Software all rights reserved.

Theme Runtime Properties

Theme properties are supplied at render time. The bundled schema says the Theme API version is injected by the runtime rather than read from Info.plist.

The following values are demonstrated by bundled themes. This is not yet a complete object reference.

content

These values insert content generated by Stacks and other page components:

Do not omit these casually. Other stacks can publish page-scoped templates into the above/below insertion points.

page

The Sample theme demonstrates:

Additional page properties may be present. Rendering :(page): during development can help inspect the current runtime object, but debug output should not be shipped in a production theme.

site

The Sample theme demonstrates:

Items from site.pages.children demonstrate:

Nested navigation can be built by iterating over children or by passing the page item to an included partial.

The Sample theme iterates over breadcrumbs. Each demonstrated breadcrumb has:

Theme identity

Base contains debug examples for:

The complete relationship between the top-level theme object and site.theme is not yet specified.

Output paths

Blank demonstrates:

Base also refers to assetPath in its comments. Themes with static assets should prefer runtime-generated paths over hard-coded page-relative URLs.

Inspecting objects safely

Sample suggests temporarily outputting an object during development:

<pre>:(site):</pre>

Use this only in a local test theme. Runtime objects may contain verbose implementation details and their unescaped representation may not be appropriate for public output.

© . YourHead Software all rights reserved.