setGlobalFromMarkdownTask

Set a global variable from a rendered Markdown file.


When to Use

✅ Use setGlobalFromMarkdownTask for:

❌ Use setGlobalsTask instead for:


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

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>

Related Tasks