Blurry

Templates: context

Blurry populates Jinja templates with context from multiple sources:

  1. blurry.toml configuration file, using blurry.schema_data (see blurry.toml for more information)
  2. Dynamic variables constructed by Blurry
  3. Front matter from Markdown files

The template context variables are:

Variable(s)Description
bodyan HTML string converted from Markdown
filepaththe Markdown file path for the current page
urlthe absolute URL for the given page
schema_type_taga <script type="application/ld+json"> tag containing Schema.org markup
open_graph_tagsOpen Graph meta tags, like <meta property="og:title" content="..." />
**schema_variablesfront matter from the Markdown file, like datePublished
schema_dataSchema data from blurry.toml
sibling_pagesfor index.md files, includes [{"url", **MarkdownFileData}] for files in the same directory
file_data_by_directoryall file data grouped by directory, like {"path", list[MarkdownFileData]}

Example: this page's context variables

Some of the context variable types are pretty complex, and a real-world example could be helpful to show what data they contain. Below are some context variables available to the template used in this very page.

url

https://blurry-docs.netlify.app/templates/context/

filepath

templates/context.md

schema_data

{"@context": "https://schema.org", "author": {"@type": "Person", "name": "John Franey", "url": "https://johnfraney.ca"}, "sourceOrganization": {"name": "Blurry", "url": "https://blurry-docs.netlify.app"}, "@type": "WebPage", "name": "Templates: context", "abstract": "Documentation for Blurry's template context variables", "datePublished": null, "url": "https://blurry-docs.netlify.app/templates/context/"}

file_data_by_directory

{
  'configuration': [
    {
      'body': '<h1 id="configuration-environment-variables">...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Configuration: environment variables', 'abstract': "Documentation for Blurry's settings configuration using environment variables", 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2024, 1, 3), 'url': 'https://blurry-docs.netlify.app/configuration/environment-variables/'},'path': 'configuration/environment-variables.md',
      
    },
    {
      'body': '<h1 id="blurrytoml">blurry.toml</h1><p>Blurr...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Configuration: blurry.toml', 'abstract': "Documentation for Blurry's blurry.toml configuration file", 'datePublished': datetime.date(2023, 4, 9), 'url': 'https://blurry-docs.netlify.app/configuration/blurry.toml/'},'path': 'configuration/blurry.toml.md',
      
    },
    {
      'body': '<h1 id="configuration-settings">Configuration...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Configuration: settings', 'abstract': "Documentation for Blurry's available settings", 'datePublished': datetime.date(2023, 4, 9), 'url': 'https://blurry-docs.netlify.app/configuration/settings/'},'path': 'configuration/settings.md',
      
    },
    
  ],

  '.': [
    {
      'body': '<h1 id="blurry-a-static-site-generator-for-se...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebSite', 'name': 'Introduction', 'abstract': 'An extensible static site generator with exceptional SEO and page speed.', 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2025, 1, 9), 'url': 'https://blurry-docs.netlify.app/'},'path': 'index.md',
      
    },
    
  ],

  'content': [
    {
      'body': '<h1 id="content-dynamic">Content: dynamic</h1...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Content: dynamic', 'abstract': "Documentation for Blurry's dynamic file handling using Jinja", 'datePublished': datetime.date(2024, 12, 12), 'url': 'https://blurry-docs.netlify.app/content/dynamic/'},'path': 'content/dynamic.md',
      
    },
    {
      'body': '<h1 id="content-videos">Content: videos</h1>...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Content: videos', 'abstract': "Documentation for Blurry's video handling", 'datePublished': datetime.date(2023, 6, 4), 'url': 'https://blurry-docs.netlify.app/content/videos/'},'path': 'content/videos.md',
      
    },
    {
      'body': '<h1 id="content-images">Content: images</h1>...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Content: images', 'abstract': "Documentation for Blurry's image handling", 'datePublished': datetime.date(2023, 4, 9), 'url': 'https://blurry-docs.netlify.app/content/images/'},'path': 'content/images.md',
      
    },
    {
      'body': '<h1 id="content-markdown">Content: Markdown</...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Content: Markdown', 'abstract': "Documentation for Blurry's Markdown handling", 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2023, 6, 4), 'url': 'https://blurry-docs.netlify.app/content/markdown/'},'path': 'content/markdown.md',
      
    },
    
  ],

  'plugins': [
    {
      'body': '<h1 id="plugins-write-an-jinja-extension-plug...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Plugins: write a Jinja extension plugin', 'abstract': "Documentation for Blurry's Jinja extension plugins", 'datePublished': datetime.date(2024, 4, 28), 'url': 'https://blurry-docs.netlify.app/plugins/write-a-jinja-extension-plugin/'},'path': 'plugins/write-a-jinja-extension-plugin.md',
      
    },
    {
      'body': '<h1 id="plugins-write-an-jinja-filter-plugin"...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Plugins: write a Jinja filter plugin', 'abstract': "Documentation for Blurry's Jinja filter plugins", 'datePublished': datetime.date(2024, 2, 29), 'url': 'https://blurry-docs.netlify.app/plugins/write-a-jinja-filter-plugin/'},'path': 'plugins/write-a-jinja-filter-plugin.md',
      
    },
    {
      'body': '<h1 id="plugins-intro">Plugins: intro</h1><a...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Plugins: intro', 'abstract': "Documentation for Blurry's plugin architecture", 'datePublished': datetime.date(2023, 4, 15), 'dateModified': datetime.date(2024, 1, 3), 'url': 'https://blurry-docs.netlify.app/plugins/intro/'},'path': 'plugins/intro.md',
      
    },
    {
      'body': '<h1 id="plugins-write-a-markdown-plugin">Plug...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Plugins: write a Markdown plugin', 'abstract': "Documentation for Blurry's Markdown plugins", 'datePublished': datetime.date(2023, 4, 15), 'url': 'https://blurry-docs.netlify.app/plugins/write-a-markdown-plugin/'},'path': 'plugins/write-a-markdown-plugin.md',
      
    },
    {
      'body': '<h1 id="plugins-write-an-html-plugin">Plugins...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Plugins: write an HTML plugin', 'abstract': "Documentation for Blurry's HTML plugins", 'datePublished': datetime.date(2023, 4, 15), 'url': 'https://blurry-docs.netlify.app/plugins/write-an-html-plugin/'},'path': 'plugins/write-an-html-plugin.md',
      
    },
    
  ],

  'commands': [
    {
      'body': '<h1 id="commands-codeinitcode">Commands: <cod...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Commands: init', 'abstract': 'The init command for Blurry, a Python static site generator focused on page speed and SEO', 'datePublished': datetime.date(2025, 1, 8), 'dateModified': datetime.date(2025, 1, 9), 'url': 'https://blurry-docs.netlify.app/commands/init/'},'path': 'commands/init.md',
      
    },
    {
      'body': '<h1 id="commands-codecleancode">Commands: <co...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Commands: clean', 'abstract': 'The clean command for Blurry, a Python static site generator focused on page speed and SEO', 'datePublished': datetime.date(2024, 12, 28), 'dateModified': datetime.date(2024, 1, 8), 'url': 'https://blurry-docs.netlify.app/commands/clean/'},'path': 'commands/clean.md',
      
    },
    {
      'body': '<h1 id="commands-coderunservercode">Commands:...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Commands: runserver', 'abstract': 'The runserver command for Blurry, a Python static site generator focused on page speed and SEO', 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2024, 1, 8), 'url': 'https://blurry-docs.netlify.app/commands/runserver/'},'path': 'commands/runserver.md',
      
    },
    {
      'body': '<h1 id="commands-codebuildcode">Commands: <co...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Commands: build', 'abstract': 'The build command for Blurry, a Python static site generator focused on page speed and SEO', 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2025, 1, 8), 'url': 'https://blurry-docs.netlify.app/commands/build/'},'path': 'commands/build.md',
      
    },
    
  ],

  'templates': [
    {
      'body': '<h1 id="templates-components">Templates: comp...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Templates: components', 'abstract': "Documentation for Blurry's template components using JinjaX", 'datePublished': datetime.date(2023, 12, 6), 'dateModified': datetime.date(2024, 1, 3), 'url': 'https://blurry-docs.netlify.app/templates/components/'},'path': 'templates/components.md',
      
    },
    {
      'body': '<h1 id="templates-examples">Templates: exampl...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Templates: examples', 'abstract': 'Example Jinja templates for your Blurry project', 'datePublished': datetime.date(2023, 4, 9), 'url': 'https://blurry-docs.netlify.app/templates/examples/'},'path': 'templates/examples.md',
      
    },
    {
      'body': '<h1 id="templates-context">Templates: context...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Templates: context', 'abstract': "Documentation for Blurry's template context variables", 'datePublished': datetime.date(2023, 4, 9), 'url': 'https://blurry-docs.netlify.app/templates/context/'},'path': 'templates/context.md',
      
    },
    {
      'body': '<h1 id="templates-syntax">Templates: syntax</...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Templates: syntax', 'abstract': "Documentation for Blurry's template files and Jinja syntax", 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2023, 4, 28), 'image': {'contentUrl': 'https://blurry-docs.netlify.app/images/schema.org-logo.png'}, 'url': 'https://blurry-docs.netlify.app/templates/syntax/'},'path': 'templates/syntax.md',
      
    },
    
  ],

  'getting-started': [
    {
      'body': '<h1 id="getting-started-quick-start">Getting ...',
      'front_matter': {'author': {'@type': 'Person', 'name': 'John Franey', 'url': 'https://johnfraney.ca'}, 'sourceOrganization': {'name': 'Blurry', 'url': 'https://blurry-docs.netlify.app'}, '@type': 'WebPage', 'name': 'Getting started: quick start', 'abstract': 'Documentation for how to get started with Blurry', 'datePublished': datetime.date(2023, 4, 9), 'dateModified': datetime.date(2025, 1, 3), 'url': 'https://blurry-docs.netlify.app/getting-started/quick-start/'},'path': 'getting-started/quick-start.md',
      
    },
    
  ],
}

open_graph_tags

<meta property="og:type" content="website">
<meta property="og:url" content="https://blurry-docs.netlify.app/templates/context/">
<meta property="og:description" content="Documentation for Blurry's template context variables">
<meta property="og:site_name" content="Blurry">

schema_type_tag

<script type="application/ld+json">{"@context": "https://schema.org", "author": {"@type": "Person", "name": "John Franey", "url": "https://johnfraney.ca"}, "sourceOrganization": {"name": "Blurry", "url": "https://blurry-docs.netlify.app"}, "@type": "WebPage", "name": "Templates: context", "abstract": "Documentation for Blurry's template context variables", "datePublished": null, "url": "https://blurry-docs.netlify.app/templates/context/"}</script>