interface MarkdownInstance<T> {
    Content: AstroComponentFactory;
    default: AstroComponentFactory;
    file: string;
    frontmatter: T;
    url: undefined | string;
    compiledContent(): string;
    getHeadings(): MarkdownHeading[];
    rawContent(): string;
}

Type Parameters

Properties

Component to render content in .astro files. Usage: <Content />

file: string

Absolute file path (e.g. /home/user/projects/.../file.md)

frontmatter: T
url: undefined | string

Browser URL for files under /src/pages (e.g. /en/guides/markdown-content)

Methods

  • Markdown file compiled to HTML, excluding layout HTML

    Returns string

  • List of headings (h1 -> h6) with associated metadata

    Returns MarkdownHeading[]

  • raw Markdown file content, excluding layout HTML and YAML frontmatter

    Returns string