Core Types
The data that flows through a Skier pipeline. SkierItem and SkierGlobals are
the two types you'll touch most; below them are the structured outputs the
built-in tasks produce and hand to your templates.
All signatures are transcluded from source at build time.
SkierItem
Every piece of itemised content — a blog post, a portfolio entry, any Markdown
file processed by generateItemsTask —
is normalised into a SkierItem. It's what lands in the outputVar array in
globals, and what generateFeedTask
consumes as its articles:
export interface SkierItem {
section?: string;
itemName: string;
itemPath: string;
outPath: string;
type: string; // 'html', 'md', etc.
relativePath?: string;
title: string;
link: string;
body: string;
date?: string;
dateObj?: Date;
dateDisplay?: string;
excerpt?: string;
// If you want to extend with custom fields, extend this interface in your own project.
}| Field | Type | Notes |
|---|---|---|
section |
string? | Content group (e.g. posts), from the item's subdirectory. Absent under flatStructure. |
itemName |
string | Filename without extension — the slug. |
itemPath |
string | Source path of the item file. |
outPath |
string | Path the rendered HTML was written to. |
type |
string | Source type — 'md', 'html', etc. |
relativePath |
string? | Output path relative to outDir. |
title |
string | Resolved title (frontmatter → filename). |
link |
string | Root-relative URL of the item. |
body |
string | Rendered HTML body. |
date / dateObj / dateDisplay |
string? / Date? / string? | Parsed date in three forms, when available. |
excerpt |
string? | Short summary, when extracted. |
To add your own fields, extend
SkierItemin your project — it's an ordinary interface. Custom template variables per item come fromadditionalVarsFn(see generateItemsTask).
SkierGlobals
The shared bag of build-wide data. Each task's run() return value is merged in,
and the whole object is exposed to every template:
export interface SkierGlobals {
[key: string]: unknown;
}It's deliberately open ([key: string]: unknown) — any task can contribute any
key. See the Task Contract for how data
gets in and out.
Produced data types
Some built-ins produce structured objects for your templates rather than plain strings. These are the shapes they emit.
NavData
generateNavDataTask builds a full
sidebar/navigation tree from your docs' frontmatter and exposes it on globals:
/**
* A navigation item representing a single page in the sidebar.
*/
export interface NavItem {
/** Display title of the page */
title: string;
/** URL path to the page (e.g., '/getting-started') */
url: string;
/** Sort order within section (lower = earlier) */
order: number;
/** Whether this is the current page (template-time use) */
active?: boolean;
}
/**
- A section in the navigation sidebar containing multiple items.
/
export interface NavSection {
/* Section display name (e.g., 'Getting Started') /
name: string;
/* Sort order for sections (lower = earlier) /
order: number;
/* Pages within this section /
items: NavItem[];
/* Nested subsections (e.g., for builtin task categories) */
children?: NavSection[];
}
/**
- Complete navigation data structure for the docs sidebar.
/
export interface NavData {
/* Ordered list of navigation sections /
sections: NavSection[];
/* Flat list of all pages for prev/next navigation */
pages: NavItem[];
}
PaginationMeta
generatePaginatedItemsTask
passes a PaginationMeta object to each page template so it can render page
numbers and prev/next links:
/**
* Pagination metadata object exposed to templates.
*/
export interface PaginationMeta {
/** Current page number (1-indexed) */
currentPage: number;
/** Total number of pages */
totalPages: number;
/** Total number of items across all pages */
totalItems: number;
/** Number of items per page */
itemsPerPage: number;
/** Whether there is a next page */
hasNext: boolean;
/** Whether there is a previous page */
hasPrev: boolean;
/** URL to the next page (null if no next page) */
nextUrl: string | null;
/** URL to the previous page (null if no previous page) */
prevUrl: string | null;
/** URL to the first page */
firstUrl: string;
/** URL to the last page */
lastUrl: string;
/** Array of all page links for generating page number navigation */
pages: Array<{
number: number;
url: string;
isCurrent: boolean;
}>;
}SearchIndex
generateSearchIndexTask writes
a JSON document in this shape for a client-side search UI to consume:
/**
* A single heading extracted from a page, in document order.
*
* `id` is populated when the rendered heading carries an `id` attribute (as
* produced once heading-anchor support lands), so search results can deep-link
* straight to the relevant section. It is omitted when no anchor is present.
*/
export interface SearchHeading {
/** Heading text with all inline HTML stripped */
text: string;
/** Heading level, 1–6 (from `<h1>`–`<h6>`) */
level: number;
/** Anchor slug for deep-linking, when the heading has an `id` */
id?: string;
}
/**
- One entry in the search index: everything a client-side search UI needs to
- find and rank a page, and nothing it doesn't.
/
export interface SearchIndexEntry {
/* Clean, extension-free URL of the page (root-relative, or absolute if
siteUrl is set) /
url: string;
/* Page title (first <h1>, falling back to <title>, then filename) /
title: string;
/* Headings in document order, for section-level matching and result grouping /
headings: SearchHeading[];
/* Plain, HTML-stripped, whitespace-collapsed body text for full-text matching */
body: string;
}
/**
- The complete search index document written to disk as JSON.
- This format is a stable public contract consumed by the client-side search
- UI (a separate task). Add fields additively; do not rename or repurpose
- existing ones.
/
export interface SearchIndex {
/* All indexed pages, sorted by URL for deterministic output */
pages: SearchIndexEntry[];
}
Related
- Task Contract —
TaskDef,TaskContext,Logger. - Config Interfaces — the
*Configtype for each built-in task.