Skip to content

Add content

Screenshot of MkDocs site with generated pages

With a new MkDocs project bootstrapped and being served with mkdocs serve, you can now modify existing markdown files in your ./docs/ directory, or add new ones, and the site served by the mkdocs command-line tool will update when the contents of the mkdocs.yml file or ./docs/ directory are modified.

Example

Copy and paste the PowerShell code below to generate a few pages. Make sure you are in the root of the repository, and the pages will be created in ./sandbox/docs/ automatically.

Command
'about', 'contact' | ForEach-Object {
    "# $($_[0].ToString().ToUpper() + $_.Substring(1))" | Set-Content -Path (New-Item "./sandbox/docs/$_.md" -Force)
}

1..5 | ForEach-Object {
   "# Step $_`n`n" | Set-Content -Path (New-Item "./sandbox/docs/getting-started/step-0$_.md" -Force)
}