@stnd/loader
Circle 3 — Specialized Satellite & Plumbing · Active · Utility
Role: Content collection loaders for Obsidian Vaults (
@stnd/loader-vault) and Notion workspaces (@stnd/loader-notion).When to use: Ingest an entire folder of Markdown notes with frontmatter validation and backlink resolution.
Quick Start (TL;DR)
import { loadVault } from "@stnd/loader";
const notes = await loadVault({ dir: "./vault" });
Overview
Content ingestion loaders for the Standard Ecosystem, built as custom Astro Content Collection Loaders.
ELI5
This is how an Astro site’s content collections point at something that isn’t a local src/content/ folder — an Obsidian vault (with wikilinks and frontmatter) or a Notion database. Define the collection once with the right loader, then use getCollection() like any normal Astro content collection.
Usage
Use it (vault):
import { defineCollection } from "astro:content";
import { vaultLoader } from "@stnd/loader-vault";
export const collections = {
vault: defineCollection({ loader: vaultLoader({ path: "../../vault/Atelier" }) }),
};
Loaders
1. Vault Loader (@stnd/loader-vault)
Loads content from a local directory containing Markdown files with Obsidian-style frontmatter, wikilinks ([[link]]), and media files.
Vault Configuration (src/content.config.ts)
import { defineCollection } from "astro:content";
import { vaultLoader } from "@stnd/loader-vault";
const vault = defineCollection({
loader: vaultLoader({
path: "../../vault/Atelier", // path to the local Obsidian vault
flattenDirectories: false, // preserve directory structure in IDs
ignore: [".obsidian", ".trash", ".agent"], // directories to ignore
}),
});
export const collections = { vault };
Reading entries
Entries are stored in Astro’s content layer; query them with getCollection("articles") (or your collection name) from any route, including routes registered via injectRoute().
Loader Behavior & Edge Cases
- Reciprocal symlink deduplication: Vault directories that symlink back into a parent directory containing the vault itself are resolved via
fs.realpathbefore indexing. Every physical Markdown note is loaded once regardless of cyclic symlink paths. - Flexible
publishfrontmatter: Acceptspublish: trueor any parseablepublish: <date>(matching the D1-backed Garden convention). Notes withfalse, missing, or unparseablepublishvalues are skipped. Future dates still load into the collection so consumers (such as RSS feeds) can filter scheduled entries at query time.
2. Notion Loader (@stnd/loader-notion)
Synchronizes content from Notion databases into the Standard Ecosystem.
Notion Configuration (src/content.config.ts)
import { defineCollection } from "astro:content";
import { notionLoader } from "@stnd/loader-notion";
const notion = defineCollection({
loader: notionLoader({
auth: import.meta.env.NOTION_API_KEY,
databaseId: import.meta.env.NOTION_DATABASE_ID,
}),
});
export const collections = { notion };