setGlobalFromMarkdownTask

Reads a Markdown file, renders it to HTML, and sets the result as a global variable for use in templates and tasks. Ideal for site-wide content like an About section, footer, or legal notices.

Summary

Reads a Markdown file, renders it to HTML, and sets the result as a global variable for use in templates and tasks. Ideal for site-wide content like an About section, footer, or legal notices.

Default Behavior

With minimal config, reads the specified Markdown file, renders it to HTML, and sets it as a global variable with the given key.

Configuration Options

Example config:

setGlobalFromMarkdownTask({
  mdPath: 'src/about.md',
  outputVar: 'aboutHtml',
})

Input Expectations

Output

Practical Example

const { setGlobalFromMarkdownTask } = require('skier/builtins');

module.exports = [
  setGlobalFromMarkdownTask({
    mdPath: 'src/about.md',
    outputVar: 'aboutHtml',
  }),
  // ...other tasks
];

Common Pitfalls & Tips

Related Tasks/Docs