skier. v1.0.0

Config Interfaces

The exported configuration type for every built-in task, in one place. Each factory takes exactly the object shown here. Every block is transcluded from the task's own source, so it's always in step with the shipping code — for the full option-by-option prose, follow the link to the task's Task Reference page.

import type {
  PrepareOutputConfig,
  SetGlobalsConfig,
  SetGlobalFromMarkdownConfig,
  GeneratePagesConfig,
  GenerateItemsConfig,
  GeneratePaginatedItemsConfig,
  GenerateFeedConfig,
  GenerateSitemapConfig,
  GenerateSearchIndexConfig,
  GenerateNavDataConfig,
  BundleCssConfig,
  CopyStaticConfig,
} from 'skier';

Setup

PrepareOutputConfig

For prepareOutputTask:

export interface PrepareOutputConfig {
  outDir: string;
}

Globals

SetGlobalsConfig

For setGlobalsTask:

export interface SetGlobalsConfig {
  values?: SkierGlobals;
  valuesFn?: (globals: SkierGlobals) => SkierGlobals | Promise<SkierGlobals>;
}

SetGlobalFromMarkdownConfig

For setGlobalFromMarkdownTask:

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

Content

GeneratePagesConfig

For generatePagesTask:

export interface GeneratePagesConfig {
  pagesDir: string;
  partialsDir: string;
  outDir: string;
  /**
   * Extension to scan for in pagesDir (e.g., '.html', '.hbs'). Defaults to '.html'.
   */
  pageExt?: string;
  /**
   * Optional function to inject additional variables into the render context for each page.
   * Receives all innate HtmlRenderVars.
   */
  additionalVarsFn?: (
    args: HtmlRenderVars,
  ) => Record<string, unknown> | Promise<Record<string, unknown>>;
}

GenerateItemsConfig

For generateItemsTask:

export interface GenerateItemsConfig {
  /** Directory containing markdown/HTML items */
  itemsDir: string;
  /** Directory containing partials */
  partialsDir: string;
  /** Output directory */
  outDir: string;
  /** Name of the variable to output the item list as */
  outputVar: string;

/** Optional link rewriting config for Markdown output / linkRewrite?: LinkRewriteConfig; /* Extension for section templates (default: .html) / templateExtension?: string; /* Extension for partials (default: .html) / partialExtension?: string; /* If true, treat all files in itemsDir as items (no sections). Default: false */ flatStructure?: boolean;

/** Custom frontmatter parser / frontmatterParser?: (raw: string) => FrontmatterData; /* Custom excerpt extractor / excerptFn?: (raw: string, meta: FrontmatterData) => string | Promise<string>; /* Custom sorting function for items / sortFn?: (a: SkierItem, b: SkierItem) => number; /* Custom link generator / linkFn?: (args: { section: string; itemName: string; meta: FrontmatterData }) => string; /* Custom output path generator / outputPathFn?: (args: { section: string; itemName: string; meta: FrontmatterData }) => string; /* Custom markdown renderer / markdownRenderer?: (md: string) => string | Promise<string>; /* User override for date extraction / extractDate?: (args: ItemFunctionArgs) => Date | string | undefined; /* Optional function to inject additional variables per item */ additionalVarsFn?: ( args: ItemisedRenderVars, ) => Record<string, unknown> | Promise<Record<string, unknown>>; }

GeneratePaginatedItemsConfig

For generatePaginatedItemsTask:

export interface GeneratePaginatedItemsConfig {
  /**
   * Path to a JSON file containing the data.
   * Mutually exclusive with dataVar.
   */
  dataFile?: string;

/**

  • Variable name from globals to use as data source.
  • Use ${varName} syntax (e.g., '${thoughtsList}').
  • Mutually exclusive with dataFile. */ dataVar?: string;

/**

  • Optional key within the JSON data to read the array from.
  • E.g., 'timeline' to read from data.timeline. */ dataKey?: string;

/** Number of items per page */ itemsPerPage: number;

/** Path to the Handlebars template for each page */ template: string;

/** Directory containing Handlebars partials */ partialsDir: string;

/** Output directory for generated pages */ outDir: string;

/**

  • Base path for URLs and output files.
  • E.g., '/life-fitness' results in:
    • /life-fitness.html (page 1)
    • /life-fitness/page/2.html (page 2) */ basePath: string;

/**

  • Variable name for the items array in templates.
  • Defaults to 'items'. */ outputVar?: string;

/**

  • Variable name for the pagination metadata in templates.
  • Defaults to 'pagination'. */ paginationVar?: string;

/**

  • Optional function to transform each item before passing to the template.
  • Receives the item and its index. */ itemTransformFn?: (item: unknown, index: number) => unknown;

/**

  • Optional function to inject additional variables per page.
  • Receives page context including pageNumber, totalPages, and items. */ additionalVarsFn?: (args: { pageNumber: number; totalPages: number; items: unknown[]; }) => Record<string, unknown> | Promise<Record<string, unknown>>; }

Feeds & SEO

GenerateFeedConfig

For generateFeedTask:

export interface GenerateFeedConfig {
  articles: SkierItem[];
  outDir: string;
  site: {
    title: string;
    description: string;
    id: string;
    link: string;
    language: string;
    favicon: string;
    copyright: string;
    feedLinks: {
      json: string;
      atom: string;
    };
    author: {
      name: string;
      email: string;
      link: string;
    };
  };
}

GenerateSitemapConfig

For generateSitemapTask:

export interface GenerateSitemapConfig {
  /** Directory to scan for .html files */
  scanDir: string;
  /** Directory to output sitemap file to */
  outDir: string;
  /** (Optional) site base URL for <loc> tags */
  siteUrl?: string;
  /** (Optional) glob patterns to exclude from sitemap. Merged with defaults (404.html, 404/**). */
  excludes?: string[];
}

GenerateSearchIndexConfig

For generateSearchIndexTask:

export interface GenerateSearchIndexConfig {
  /** Directory to scan for rendered `.html` pages */
  scanDir: string;
  /** Directory to write the search index JSON into */
  outDir: string;
  /** Output filename for the index (default: `'search-index.json'`) */
  fileName?: string;
  /** Site root URL for absolute page URLs (default: root-relative URLs) */
  siteUrl?: string;
  /**
   * Tag name whose contents are indexed, scoping out shared chrome (sidebar,
   * header, footer). Default: `'main'`. Use `'body'` to index the whole body.
   * If the tag is not found on a page, the task falls back to `<body>`.
   */
  contentSelector?: string;
  /** Glob patterns to exclude from the index. Merged with defaults (`404.html`, `404/**`). */
  excludes?: string[];
  /** If set, the index object is also exposed on `globals[outputVar]` for downstream tasks. */
  outputVar?: string;
  /** Cap each page's body text to this many characters (default: `0` = no limit). */
  maxBodyLength?: number;
  /** Pretty-print the JSON (default: `false` — compact output keeps the payload lean). */
  pretty?: boolean;
}

GenerateNavDataConfig

For generateNavDataTask:

export interface GenerateNavDataConfig {
  /** Directory containing documentation files to scan */
  docsDir: string;
  /** Output variable name for the navigation data (default: 'navData') */
  outputVar?: string;
  /** Base URL path for generated links (default: '') */
  basePath?: string;
  /** File extensions to consider as docs (default: ['.md']) */
  extensions?: string[];
  /** Default section name for ungrouped docs (default: 'Docs') */
  defaultSection?: string;
  /** Section ordering configuration */
  sectionOrder?: Record<string, number>;
  /** Subcategory ordering configuration (for nested groups within sections) */
  subcategoryOrder?: Record<string, number>;
}

Assets

BundleCssConfig

For bundleCssTask:

export interface BundleCssConfig {
  from: string; // source directory
  to: string; // output directory
  output: string; // output filename (e.g. styles.min.css)
  minify?: boolean;
}

CopyStaticConfig

For copyStaticTask:

export interface CopyStaticConfig {
  from: string;
  to: string;
}

  • Task Contract — the TaskDef these factories return.
  • Core Types — the data types configs reference (SkierItem, SkierGlobals, and produced types).
  • Task Reference — full per-task documentation.