UNPKG

astro-loader-obsidian

Version:
77 lines (70 loc) 2.73 kB
export type ObsidianMdLoaderOptions = { /** The glob pattern to match files, relative to the base directory. Defaults to **\/*.md */ pattern?: string | Array<string>; /** The glob pattern to match assets, relative to the base directory. Defaults to **\/*.{svg,png,jpg,jpeg,avif,webp,gif,tiff,ico} */ assetsPattern?: string | Array<string>; /** The base directory to resolve the glob pattern from. Relative to the root directory, or an absolute file URL. Defaults to `.` */ base?: string | URL; /** Enables i18n routing */ i18n?: boolean; /** Base URL where this content should be served. Defaults to collection name. Used for autogenerated permalink */ url?: string; /** Default author */ author?: string; /** Broken links strategy. Defaults to "plaintext". * warn: logs a warning but renders the link anyway * plaintext: removes the link but keeps the label * 404: replaces the link with a parametrised link to 404 page **/ brokenLinksStrategy?: "warn" | "label" | "404"; /** Remove h1 from document. Useful if your h1 is the same as the document title. Default true */ removeH1?: boolean; /** Additional fields to be parsed as wikilinks */ wikilinkFields?: string[]; /** Transform tag references in body into links. Default is true */ parseTagsIntoLinks?: boolean; /** Whether should include links with publish: false or not. Default is true */ skipUnpublishedEntries?: boolean; /** Base URL for tags. Default to /tags. Used for autogenerated permalink */ tagsUrl?: string; zettelkasten?: { enabled?: boolean; /** Whether zettelkasten id parsing is enabled or not */ format?: 'niklas-luhmann' | 'timestamp_id' | 'date_id'; /** Format for note id. Default to 'timestamp_id' */ pattern?: string; /** Pattern to parse/validate the id. Default depends on format */ template?: string; /** File name mask to identify zettel id and title. Use {{zettelId}} and {{title}} inside the mask. Default to '{{zettelId}} {{title}}' */ } }; export type ObsidianContext = { author: string | undefined; assets: string[]; entry: string; files: string[]; base: string | URL | undefined; baseUrl: string; publicUrl: string; i18n: boolean | undefined; defaultLocale: string | undefined; options: ObsidianMdLoaderOptions; }; type Heading = { depth: number; slug: string; text: string; }; export type StoreDocument<T = unknown> = { id: string; data: T; body: string; filePath: string; digest: string; rendered: { html: string; metadata: { headings: Heading[]; localImagePaths: Array<string>; remoteImagePaths: Array<string>; frontmatter: unknown; imagePaths: Array<string>; } } }