Skip to main content
{% partial file="new_partial" /%}

Creating Partials

Partials are created as regular markdown files in your project structure. To create a partial, click the + button in the sidebar of a project and select “New Partial”. Then add the content you want to reuse to the partial.

Referencing Partials

Reference partials in your markdown by using the {% partial %} tag.
{% partial file="new_partial" /%}
To access from a slash command start typing /partial. Partials can be organized in directories just like regular pages. The path becomes the identifier used to reference the partial
new_partial             # Referenced as file="new_partial"
components/
    └── footer          # Referenced as file="components/footer"

Naming Conventions

Partials should be named using snake_case as this makes referencing straightforward.

Variables

Partials have an isolated scope for variables. They can be defined in frontmatter, or passed as variables.

Frontmatter

Partials can define their own variables using frontmatter at the top of the partial file:
---
title: Developments in Technology
category: Technology
---

<!-- Available in partial:              -->
<!-- $title: Developments in Technology -->
<!-- $category: Technology              -->

Passing Variables

You can pass variables to partials when referencing them. Variables of the same name will override those defined in the partial’s frontmatter.
---
title: Developments in Data Tooling
category: Technology
---

{% partial 
    file="my_partial" 
    variables={
        title = "New Data Tools" 
        main_category = $category
    } 
/%}

<!-- Available in partial:      -->
<!-- $title: New Data Tools     -->
<!-- $main_category: Technology -->

Scoping Rules

  • Isolation: Partials cannot access variables from the parent page unless explicitly passed
  • Precedence: Passed variables take precedence over frontmatter variables
  • Fallback: If no variable is provided, the partial uses its frontmatter variable
I