Skip to content
svedocs

Content

Author pages with frontmatter, GFM, KaTeX, code blocks, diffs, links, assets, and section extraction.

svedocs reads .md, .mdx, and .svx files from the configured content folders. Each file becomes a page with a route, navigation entry, search records, and SEO data.

Route mapping

The default content roots are:

Text
content/docs -> /docscontent/pages -> /

Examples:

FileRoute
content/docs/index.md/docs
content/docs/writing/content.md/docs/writing/content
content/docs/configuration/index.md/docs/configuration
content/pages/changelog.md/changelog

Use index.md for a section landing page. Use nested directories when the sidebar should have groups.

Multilingual projects place the locale path below each content root. See Internationalization for the complete file-to-route mapping.

Frontmatter

Every important page should include at least title and description:

Markdown
---title: Contentdescription: Explain the content pipeline and authoring features.order: 2---

Common fields:

FieldTypePurpose
titlestringPage title, search title, OG title, and default sidebar title.
navTitlestringShorter sidebar label without changing the document title.
descriptionstringSEO description, search excerpt fallback, and page summary.
ordernumberSort weight in navigation and previous/next links.
hiddenbooleanRemove from generated navigation and public lists.
collapsedbooleanCollapse a navigation group by default.
sectionbooleanMark a directory page as a section page.
iconstringIcon hint for the default theme.
canonicalstringOverride the generated canonical URL.
imagestringOpen Graph image URL.
keywordsstring[]SEO and search metadata.
authorstringArticle author; falls back to seo.defaultAuthor.
published, date, publishedTimedatePublication time.
updated, updatedTimedateLast meaningful content update.
type, ogTypestringOpen Graph content type.

If the first Markdown heading matches title, svedocs removes the duplicate heading from rendered content while preserving the page title.

Markdown features

svedocs supports GitHub-flavored Markdown features such as tables, task lists, and autolinks. It also extracts headings for anchors and page table-of-contents data.

Markdown
## Configure search- [x] Create the runtime route.- [x] Choose a provider.- [ ] Add production credentials.

KaTeX is available for inline and block math when your content needs formulas.

Code blocks

Use code metadata to make examples easier to scan:

```ts title="svedocs.config.ts" {1} focus=3
import { defineConfig } from 'svedocs/config';

export default defineConfig({
  site: { name: 'svedocs' }
});
```

The default theme supports:

  • Syntax highlighting.
  • File titles with title="..." or filename="...".
  • Line highlighting with {1,3-5}.
  • Focus hints with focus=3.
  • Optional line numbers and wrapping from theme config.
  • Copy actions.

Diff blocks

Use standard diff fences for small changes:

Text
- const docs = fragmented();+ const docs = svedocs();

Use split diffs when the before/after relationship matters:

Diff+1-1
@@ -1,3 +1,4 @@-export * from './content.js';+export * from './core/content.js';+export * from './core/navigation.js'; export * from './config.js';

Split diffs support horizontal scrolling on both panes, so long code stays inspectable on narrow screens.

Internal links are checked against generated routes and extracted heading anchors:

Diff packages/svedocs/src/core.ts +2-1
Before
After

External links receive a small inline icon in the default theme so readers can distinguish off-site navigation:

Markdown
Read the [SvelteKit docs](https://svelte.dev/docs/kit).

For example, the SvelteKit documentation link is marked as an external web link.

Use a standalone internal link with a card title to render a Fumadocs-style link card:

Markdown
[SEO and OG](/docs/integrations/seo-og "card: Metadata, sitemap, robots, JSON-LD, and Open Graph routes.")

Local assets are checked when checks.assets is enabled:

Markdown
![Dashboard screenshot](/images/dashboard.png)

Use absolute site paths for public assets and stable docs routes for internal links. This keeps links working in search results, Ask AI citations, and static builds.

Search records

svedocs creates two kinds of search records:

RecordCreated fromUseful for
Page recordsThe page title, description, route, and content.Broad queries that should land on the page.
Section recordsHeadings and nearby content.Specific queries that should jump into a long guide.

Clear headings improve search quality more than keyword stuffing. Prefer headings that describe a user task or concept.

Authoring checklist

Before publishing a page:

  • Does the page have a unique title and useful description?
  • Does the route belong in docs or should it be a standalone page?
  • Are headings specific enough to become search targets?
  • Do code examples include file names when context matters?
  • Do internal links point to real routes and anchors?
  • Does the page need canonical, image, published, or updated metadata?