skier. v1.0.0

setGlobalFromMarkdownTask

Set a global variable from a rendered Markdown file.


When to Use

✅ Use setGlobalFromMarkdownTask for:

  • Site-wide content blocks (about, legal notices)
  • Rendered Markdown you need in multiple templates
  • Content that should be editable as Markdown

❌ Use setGlobalsTask instead for:

  • Simple key-value configuration
  • Computed values from other globals

Quick Start

setGlobalFromMarkdownTask({
  mdPath: 'content/about.md',
  outputVar: 'aboutContent',
})

Input: Markdown file Output: globals.{outputVar} containing rendered HTML


Configuration

Option Type Required Description
mdPath string ✅ Path to Markdown file
outputVar string ✅ Global variable name for the HTML output

Type signature

The exact SetGlobalFromMarkdownConfig interface, transcluded from source so it stays in step with the shipping code:

export interface SetGlobalFromMarkdownConfig {
  mdPath: string; // Path to markdown file
  outputVar: string; // Variable name for output HTML
}

Every task's config type together: API Reference → Config Interfaces.


Using in Templates

<section class="about">
  {{{aboutContent}}}  {{!-- Triple braces for raw HTML --}}
</section>

Real-World Example

Footer with Markdown content:

setGlobalFromMarkdownTask({
  mdPath: 'content/footer-legal.md',
  outputVar: 'footerLegal',
}),
{{!-- partials/footer.html --}}
<footer>
  <div class="legal">
    {{{footerLegal}}}
  </div>
</footer>