Your first site
Create a docs root, write a page, and see it in the browser.
This walks through creating a minimal SharpDocs site from scratch. Assumes you've already installed the package.
1. Create the docs root
Pick a folder — site/ is the convention:
MyApp/
Program.cs
appsettings.json
site/
sharpdocs.json
index.md
2. Write sharpdocs.json
This file is required. It declares the site title and the sidebar.
{
"title": "My library",
"description": "A small library.",
"github": "https://github.com/you/my-library",
"sidebar": [
{
"label": "Overview",
"items": [
{ "label": "Introduction", "slug": "index" }
]
}
]
}
Every slug in the sidebar must correspond to a markdown file. If index is the slug, you need index.md (or index/index.md). Missing slugs throw at startup.
3. Write a page
site/index.md:
---
title: My library
description: A small library.
---
Welcome.
## Quick start
Install the package and get going.
4. Run it
dotnet run
Open the site at whatever port your host uses. The landing page is /, article pages are at /{slug}, and /search?q=foo returns results.
(Multi-project sites use a different URL shape — /docs/{projectId}/{slug} and /docs/{projectId}/search. See Multi-project setup.)