mirror of
https://github.com/MichaelCurrin/mkdocs-quickstart.git
synced 2026-07-06 09:51:06 +02:00
feat: Create docs site
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Deploy
|
||||
> How to deploy a MkDocs site
|
||||
|
||||
|
||||
See [Deploying Your Docs](https://www.mkdocs.org/user-guide/deploying-your-docs/) on the Mkdocs site for more details.
|
||||
|
||||
|
||||
## Github Pages
|
||||
|
||||
_Note this is for a Project Page and not Organization and User Pages._
|
||||
|
||||
Run this command locally to deploy to Github Pages by building and pushing to `gh-pages` branch.
|
||||
|
||||
```sh
|
||||
mkdocs gh-deploy
|
||||
```
|
||||
|
||||
See options:
|
||||
|
||||
```sh
|
||||
mkdocs gh-deploy --help
|
||||
```
|
||||
|
||||
_Note you cannot view the site before its pushed, so use the `build` or `serve` commands for that._
|
||||
@@ -0,0 +1,5 @@
|
||||
# MkDocs Quickstart
|
||||
|
||||
A demo of a MkDocs docs site, including instructions for how to setup further sites.
|
||||
|
||||
This is based on the [mkdocs.org/](https://www.mkdocs.org/) tutorial.
|
||||
@@ -0,0 +1,43 @@
|
||||
# Setup and run
|
||||
> How to setup and run the docs site
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
Install in a virtual environment.
|
||||
|
||||
```sh
|
||||
pip install mkdocs
|
||||
```
|
||||
|
||||
|
||||
## Server docs locally
|
||||
|
||||
This will build the docs in memory (not to disk) and serve an auto-reloading server.
|
||||
|
||||
```sh
|
||||
mkdocs serve
|
||||
```
|
||||
|
||||
Open URL:
|
||||
|
||||
- [localhost:8000](http://localhost:8000)
|
||||
|
||||
|
||||
|
||||
## Build docs
|
||||
|
||||
Build docs site to `site` directory.
|
||||
|
||||
```sh
|
||||
mkdocs build
|
||||
```
|
||||
|
||||
Useful for production build or simulating that locally.
|
||||
|
||||
|
||||
Remove stale files.
|
||||
|
||||
```sh
|
||||
mkdocs build --clean
|
||||
```
|
||||
@@ -0,0 +1,26 @@
|
||||
# Tutorial
|
||||
> How to create a MkDocs site.
|
||||
|
||||
This is a summary of the tutorial on [mkdocs.org](https://www.mkdocs.org/).
|
||||
|
||||
|
||||
### Setup site
|
||||
|
||||
1. Create pages.
|
||||
1. Create `docs` directory.
|
||||
2. Create `index.md`
|
||||
3. Create other pages.
|
||||
2. Setup config.
|
||||
1. Create `mkdocs.yml` at project root.
|
||||
2. Setup navbar in `mkdocs.yml`.
|
||||
```yaml
|
||||
nav:
|
||||
- Home: index.md
|
||||
- About: about.md
|
||||
```
|
||||
3. Choose a theme.
|
||||
```yaml
|
||||
theme: readthedocs
|
||||
```
|
||||
3. Create a favicon.
|
||||
- It will be picked up this path: `docs/img/favicon.ico`.
|
||||
Reference in New Issue
Block a user