mirror of
https://github.com/MichaelCurrin/mkdocs-quickstart.git
synced 2026-06-21 10:35:18 +02:00
Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e568b53c0b | |||
| 5dd48b2724 | |||
| 7b27555c9c | |||
| f124cfed0c | |||
| ad7a922caf | |||
| 3b42b265ed | |||
| dae5dbde87 | |||
| 2018fa399b | |||
| 0484dbbb36 | |||
| 898c72051c | |||
| e5bcc9ac5f | |||
| 158e6dc938 | |||
| 828bf66208 | |||
| 16e004a200 | |||
| acd0ac400d | |||
| 1bcc5ce191 | |||
| 4fb05cb607 | |||
| a0e179cf37 | |||
| aef52ecef8 | |||
| c847fcad63 | |||
| 12e2d22aeb | |||
| 8781bdacc6 | |||
| 1a7fb2188e | |||
| bab097381d | |||
| a29dcb851f | |||
| f78e2a23b9 | |||
| a90d16525f | |||
| 4cb7066ac6 | |||
| b0ce48a07c | |||
| e7f49d04b7 | |||
| 2c0468d4bc | |||
| 3de9789c2a | |||
| 17919978b1 | |||
| 8a1ad62921 | |||
| 48218d64da | |||
| 6f2b3c818e | |||
| e49c7ae2b3 | |||
| 619a224358 | |||
| adf4d392f8 | |||
| dacf3464e2 |
+14
-10
@@ -1,22 +1,24 @@
|
|||||||
name: Deploy docs
|
name: Deploy Docs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-deploy:
|
build-deploy:
|
||||||
name: Build and deploy to GH Pages
|
name: Build and deploy docs
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- name: Checkout 🛎️
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Python 3.x
|
- name: Set up Python 3 ⚙️ 🐍
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies 💾
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: ~/.cache/pip
|
||||||
@@ -25,8 +27,10 @@ jobs:
|
|||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
${{ runner.os }}-
|
${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies 🔧
|
||||||
run: cd docs && make install
|
working-directory: docs
|
||||||
|
run: make install
|
||||||
|
|
||||||
- name: Build and deploy
|
- name: Build and deploy to GitHub Pages 🏗️ 🚀
|
||||||
run: cd docs && make deploy
|
working-directory: docs
|
||||||
|
run: make deploy
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
site/
|
|
||||||
|
|
||||||
venv
|
venv
|
||||||
|
|
||||||
|
site/
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 MichaelCurrin
|
Copyright (c) 2020 - 2021 MichaelCurrin
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,33 +1,54 @@
|
|||||||
# MkDocs Quickstart
|
# MkDocs Quickstart
|
||||||
> A template, live demo and tutorial for how to setup a MkDocs docs site on GitHub Pages
|
> Starter template for a MkDocs docs site on GH Pages - including CI
|
||||||
|
|
||||||
[](https://github.com/MichaelCurrin/mkdocs-quickstart/actions)
|
[](https://github.com/MichaelCurrin/mkdocs-quickstart/actions)
|
||||||
[](https://www.mkdocs.org/)
|
[](https://github.com/MichaelCurrin/mkdocs-quickstart/releases/)
|
||||||
[](https://github.com/features/actions)
|
[](#license)
|
||||||
[](https://GitHub.com/MichaelCurrin/mkdocs-quickstart/tags/)
|
|
||||||
[](#license)
|
|
||||||
|
|
||||||
|
[](https://python.org)
|
||||||
|
[](https://www.mkdocs.org/)
|
||||||
|
[](https://github.com/features/actions)
|
||||||
|
|
||||||
|
A template, live demo and tutorial for how to set up a MkDocs docs site on GH Pages. Using GitHub Actions to automated deploys.
|
||||||
|
|
||||||
|
MkDocs is a Python package when turns your docs directory and YAML config into a static website. No Python coding needed. Just Markdown and some light configuration including a theme choice and menu.
|
||||||
|
|
||||||
<!-- TODO When creating a new project copied from this template, you can delete this README.md and start over -->
|
<!-- TODO When creating a new project copied from this template, you can delete this README.md and start over -->
|
||||||
|
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
A low-code way to setup and host a markdown-based docs site with a professional look.
|
This project provides low-code content-focused way to set up and host a markdown-based documentation site, with a professional look and themes. Built with MkDocs - a Python package which is a static site generator specializing in documentation.
|
||||||
|
|
||||||
|
A GitHub Actions workflow is provided with this template so you can easily deploy to GitHub Pages too.
|
||||||
|
|
||||||
|
|
||||||
## Preview
|
## Preview
|
||||||
|
|
||||||
[](https://michaelcurrin.github.io/mkdocs-quickstart/)
|
<div align="center">
|
||||||
|
|
||||||
This project uses the _Read the Docs_ theme as seen above. It comes with MkDocs so you don't need to add to your dependencies. But you can switch to the MkDocs default or install and configure another theme.
|
[](https://michaelcurrin.github.io/mkdocs-quickstart/ "Sample screenshot")
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
This template project is configured to use the _Read the Docs_ theme, as shown above.
|
||||||
|
|
||||||
|
Thus looks like the the [Read The Docs][] site, but without having to have to overhead of using Sphinx.
|
||||||
|
|
||||||
|
[Read The Docs]: https://docs.readthedocs.io
|
||||||
|
|
||||||
|
This Read the Docs theme for MkDocs comes with MkDocs already, so you don't need to add to your dependencies. But you can switch to the MkDocs default or install and configure another theme.
|
||||||
|
|
||||||
|
You can switch to the default theme or install some others, based on the instructions in this template project.
|
||||||
|
|
||||||
|
|
||||||
## How to use this project
|
## How to use this project
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
[](https://michaelcurrin.github.io/mkdocs-quickstart/)
|
[](https://michaelcurrin.github.io/mkdocs-quickstart/)
|
||||||
[](https://github.com/MichaelCurrin/mkdocs-quickstart/generate)
|
|
||||||
|
[](https://github.com/MichaelCurrin/mkdocs-quickstart/generate)
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -60,9 +81,17 @@ Change the content and theme to suit your needs, based on the tutorial site or t
|
|||||||
To isolate the MkDocs flow from the rest of your code, you can put the configs and the `docs` folder of content inside the `docs` directory. That means you end up having `docs/docs`, which is okay. Just make sure you select the `/docs` directory when setting up GH Pages.
|
To isolate the MkDocs flow from the rest of your code, you can put the configs and the `docs` folder of content inside the `docs` directory. That means you end up having `docs/docs`, which is okay. Just make sure you select the `/docs` directory when setting up GH Pages.
|
||||||
|
|
||||||
|
|
||||||
## Why use MkDocs?
|
## About MkDocs
|
||||||
|
|
||||||
If you're new to MkDocs, look at the tutorial added on this project's site, otherwise go to the MkDocs documentation.
|
### Resources
|
||||||
|
|
||||||
|
- Homepage: [mkdocs.org](http://www.mkdocs.org/)
|
||||||
|
- Repo: [](https://github.com/mkdocs/mkdocs) [](https://github.com/mkdocs/mkdocs)
|
||||||
|
- PyPI package: [mkdocs](https://pypi.org/project/mkdocs/)
|
||||||
|
|
||||||
|
### Why MkDocs?
|
||||||
|
|
||||||
|
If you're new to MkDocs, look at the tutorial added on this project's site, otherwise go to the MkDocs homepage for documentation.
|
||||||
|
|
||||||
This project provides a way to write your docs in markdown and build a professional-looking docs site on top of it, without having to write HTML or CSS code and using a selection of themes. While MkDocs CLI has functionality to deploy from a local command-line, this project makes deploying effortless by using GitHub Actions to build and deploy the site to a `gh-pages` branch and GitHub Pages to serve the site.
|
This project provides a way to write your docs in markdown and build a professional-looking docs site on top of it, without having to write HTML or CSS code and using a selection of themes. While MkDocs CLI has functionality to deploy from a local command-line, this project makes deploying effortless by using GitHub Actions to build and deploy the site to a `gh-pages` branch and GitHub Pages to serve the site.
|
||||||
|
|
||||||
@@ -84,4 +113,4 @@ Or submit a code change:
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Released under [MIT](/LICENSE).
|
Released under [MIT](/LICENSE) by [@MichaelCurrin](https://github.com/MichaelCurrin).
|
||||||
|
|||||||
+9
-2
@@ -2,19 +2,26 @@
|
|||||||
|
|
||||||
default: install
|
default: install
|
||||||
|
|
||||||
|
all: install build
|
||||||
|
|
||||||
|
|
||||||
h help:
|
h help:
|
||||||
@egrep '(^\S)|(^$$)|\s+@echo' Makefile
|
@grep '^[a-z]' Makefile
|
||||||
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
pip install --upgrade pip
|
pip install pip --upgrade
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
pip install pip --upgrade
|
||||||
|
pip install -r requirements.txt --upgrade
|
||||||
|
|
||||||
|
|
||||||
s serve:
|
s serve:
|
||||||
mkdocs serve --strict
|
mkdocs serve --strict
|
||||||
|
|
||||||
|
|
||||||
b build:
|
b build:
|
||||||
mkdocs build --strict
|
mkdocs build --strict
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ If you are new to markdown, see the [Getting Started](https://www.markdownguide.
|
|||||||
- [mkdocs.org](https://www.mkdocs.org) homepage
|
- [mkdocs.org](https://www.mkdocs.org) homepage
|
||||||
- [mkdocs/mkdocs ](https://github.com/mkdocs/mkdocs)
|
- [mkdocs/mkdocs ](https://github.com/mkdocs/mkdocs)
|
||||||
- [MkDocs Wiki](https://github.com/mkdocs/mkdocs/wiki) - covering themes, plugins, recipes and more.
|
- [MkDocs Wiki](https://github.com/mkdocs/mkdocs/wiki) - covering themes, plugins, recipes and more.
|
||||||
- [Release notes](https://www.mkdocs.org/about/release-notes/)
|
- [Release notes](https://www.mkdocs.org/about/release-notes/) for MkDocs.
|
||||||
|
|
||||||
|
|
||||||
## Reasons to use MkDocs
|
## Reasons to use MkDocs
|
||||||
|
|||||||
+2
-3
@@ -1,10 +1,9 @@
|
|||||||
# MkDocs Quickstart
|
# MkDocs Quickstart
|
||||||
> A template, live demo and tutorial for how to setup a MkDocs docs site on GitHub Pages
|
> Started template for a MkDocs docs site on GH Pages - including CI
|
||||||
|
|
||||||
[](https://github.com/MichaelCurrin/mkdocs-quickstart)
|
[](https://github.com/MichaelCurrin/mkdocs-quickstart)
|
||||||
|
|
||||||
|
Use the MkDocs (_make docs_) tool to create build a docs site around markdown docs.
|
||||||
Use the MkDocs (make docs) tool to create build a docs site around markdown docs.
|
|
||||||
|
|
||||||
Follow the tutorial to add an existing project or create a project from scratch. The result will look like this project.
|
Follow the tutorial to add an existing project or create a project from scratch. The result will look like this project.
|
||||||
|
|
||||||
|
|||||||
@@ -11,10 +11,11 @@ See [Deploying Your Docs](https://www.mkdocs.org/user-guide/deploying-your-docs/
|
|||||||
Follow one of the approaches below:
|
Follow one of the approaches below:
|
||||||
|
|
||||||
- [Run deploy command](#run-deploy-command) - Run a MkDocs CLI command locally to deploy.
|
- [Run deploy command](#run-deploy-command) - Run a MkDocs CLI command locally to deploy.
|
||||||
- [Deploy with GitHub Actions](#deploy-with-github-actions) - use the project's workflow to build and deploy to GH Pages on commits pushed to master.
|
- [Deploy with GitHub Actions](#deploy-with-github-actions) - Use the project's CI workflow in the cloud to build and deploy to GH Pages on commits pushed to master.
|
||||||
|
|
||||||
|
Then go to your repo's _Settings_ and _Pages_ then enable _GitHub Pages_ on the `gh-pages` branch's root.
|
||||||
|
|
||||||
_Note this is for a Project Page on a subpath and not an Organization or User Page._
|
_Note this is for a Project Page on a subpath, you will have to make adjustments to the command below if you want an Organization or User Page on the root path._
|
||||||
|
|
||||||
### Run deploy command
|
### Run deploy command
|
||||||
> Run a MkDocs CLI command locally to deploy
|
> Run a MkDocs CLI command locally to deploy
|
||||||
@@ -30,23 +31,21 @@ $ make d
|
|||||||
That will use `Makefile` to run the following:
|
That will use `Makefile` to run the following:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ mkdocs gh-deploy --strict
|
$ mkdocs gh-deploy --strict --force
|
||||||
```
|
```
|
||||||
|
|
||||||
That will do the following:
|
That will do the following:
|
||||||
|
|
||||||
1. Clean and build to `site` directory.
|
1. Clean and build to `site` directory.
|
||||||
2. Push to `gh-pages` branch. Note: You must not edit this branch directly.
|
2. Force push to `gh-pages` branch, overwriting any changes which were pushed from another build.
|
||||||
3. Enable GitHub Pages if it was not yet enabled
|
|
||||||
|
|
||||||
Then go to your repo on GitHub, see the *environment* tab and click _View deployment_.
|
Then go to your repo on GitHub, look at the *Environment* tab.
|
||||||
|
|
||||||
e.g.
|
When it is done building, click _View deployment_ to see your site.
|
||||||
|
|
||||||
- [michaelcurrin.github.io/mkdocs-quickstart/](https://michaelcurrin.github.io/mkdocs-quickstart/)
|
e.g. [michaelcurrin.github.io/mkdocs-quickstart/](https://michaelcurrin.github.io/mkdocs-quickstart/)
|
||||||
|
|
||||||
|
See deploy options in the help:
|
||||||
See deploy options:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ mkdocs gh-deploy --help
|
$ mkdocs gh-deploy --help
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
- [Python 3](https://www.python.org/)
|
- [Python 3](https://www.python.org/)
|
||||||
|
- [Make](https://www.gnu.org/software/make/) - standard on macOS and Linux but can be installed on Windows too.
|
||||||
|
|
||||||
|
|
||||||
## Install system dependencies
|
## Install system dependencies
|
||||||
@@ -12,18 +13,15 @@
|
|||||||
<script src="https://gist.github.com/MichaelCurrin/57caae30bd7b0991098e9804a9494c23.js"></script>
|
<script src="https://gist.github.com/MichaelCurrin/57caae30bd7b0991098e9804a9494c23.js"></script>
|
||||||
|
|
||||||
|
|
||||||
## Setup repo
|
## Set up a new repo
|
||||||
|
|
||||||
Choose or setup a MkDocs project.
|
Follow the Tutorial page to set up a project from scratch.
|
||||||
|
|
||||||
|
Or click this create your own copy of the repo.
|
||||||
Follow the tutorial page to setup a project.
|
|
||||||
|
|
||||||
Or click the button on this repo to create your own copy of the repo.
|
|
||||||
|
|
||||||
[](https://github.com/MichaelCurrin/mkdocs-quickstart/generate)
|
[](https://github.com/MichaelCurrin/mkdocs-quickstart/generate)
|
||||||
|
|
||||||
Then clone it.
|
Then clone your repo.
|
||||||
|
|
||||||
e.g.
|
e.g.
|
||||||
|
|
||||||
@@ -38,36 +36,39 @@ $ cd mkdocs-quickstart
|
|||||||
|
|
||||||
For more info, see the [Installation](https://www.mkdocs.org/#installation) page on the MkDocs site.
|
For more info, see the [Installation](https://www.mkdocs.org/#installation) page on the MkDocs site.
|
||||||
|
|
||||||
### Use a virtual environment
|
### Install in a virtual environment
|
||||||
|
|
||||||
Create a virtual environment at the project root.
|
Create a virtual environment at the project root - this is used to isolate project packages from the global packages.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ python3 -m venv venv
|
$ python3 -m venv venv
|
||||||
```
|
```
|
||||||
|
|
||||||
Activate it.
|
Activate the environment.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ source venv/bin/activate
|
$ source venv/bin/activate
|
||||||
```
|
```
|
||||||
|
|
||||||
Install `mkdocs` from the project dependencies list.
|
Install `mkdocs` - this is covered in the project requirements file.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cd docs
|
$ cd docs
|
||||||
$ pip install -r requirements.txt
|
$ make install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note - `mkdocs` 1.2 causes a break on force pushes, so this is excluded in the requirements. See issue [#2447](https://github.com/mkdocs/mkdocs/issues/2447).
|
||||||
|
|
||||||
### Install globally
|
### Install globally
|
||||||
|
|
||||||
If you prefer to install MkDocs once and reuse it across projects, then you can install it globally.
|
If you prefer to install MkDocs once and reuse it across projects, then you can install it globally instead.
|
||||||
|
|
||||||
MkDocs is available using package managers like `apt-get`, `homebrew` and `yum`.
|
MkDocs is available using package managers like `apt-get`, `homebrew` and `yum`.
|
||||||
|
|
||||||
You can install like this too:
|
Or you can install like this:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python3 -m pip install mkdocs
|
$ python3 -m pip install mkdocs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you get prompted for `sudo` use, then cancel and run again with `-U` flag for user-level install.
|
||||||
|
|||||||
@@ -11,15 +11,23 @@ Use one of the approaches below:
|
|||||||
- Create a quickstart project with the `new` command covered in [Create a starter site](#create-a-starter-site).
|
- Create a quickstart project with the `new` command covered in [Create a starter site](#create-a-starter-site).
|
||||||
- Follow the extended guide to create a [Set up up docs site](#setup-a-docs-site) by hand.
|
- Follow the extended guide to create a [Set up up docs site](#setup-a-docs-site) by hand.
|
||||||
|
|
||||||
|
|
||||||
### Basic structure
|
### Basic structure
|
||||||
|
|
||||||
This is the simplest MkDocs site you can make:
|
This is the simplest MkDocs site you can make:
|
||||||
|
|
||||||
- `docs/`
|
- `docs/`
|
||||||
- `index.md` - Homepage in the `docs` directory (by default).
|
- `index.md` - Homepage in the `docs` directory (by default).
|
||||||
- `mkdocs.yml` - Config at the root.
|
- `mkdocs.yml`
|
||||||
|
- Config at the root - control appearance and navigation of your site.
|
||||||
|
- See this project's [docs/mkdocs.yml](https://github.com/MichaelCurrin/mkdocs-quickstart/blob/master/docs/mkdocs.yml) file on GitHub.
|
||||||
|
|
||||||
|
Notes on fields for the config:
|
||||||
|
|
||||||
|
- `site_name` - title of your site.
|
||||||
|
- `site_description` - used as a description for SEO and you could use it somewhere in your template.
|
||||||
|
- `site_url` - now a _required_ field when running a deploy. Include the subpath on the domain. If your site is not ready to be hosted, set this field to an empty string.
|
||||||
|
- `repo_url` - for _Edit on GitHub_ button. See [docs](https://www.mkdocs.org/user-guide/configuration/#repo_url).
|
||||||
|
- `edit_uri` - defaults to `edit/master/docs/`, which includes `docs` directory of markdown files inside your repo root. But, if the site's root is in an outer `docs` directory, then you need to _also_ add that, so paths do not break. e.g. `edit/master/docs/docs`. See [docs](https://www.mkdocs.org/user-guide/configuration/#edit_uri)
|
||||||
|
|
||||||
### Requirements file
|
### Requirements file
|
||||||
|
|
||||||
@@ -27,7 +35,6 @@ A requirements file is optional but it can make it easier to manage dependencies
|
|||||||
|
|
||||||
If you want to add, then include `requirements.txt` at the root. If your project is already a Python project, you might prefer to add `mkdocs` in `requirements-dev.txt` or at `docs/requirements.txt` to keep it isolated.This file should have `mkdocs` in it and also any themes if needed.
|
If you want to add, then include `requirements.txt` at the root. If your project is already a Python project, you might prefer to add `mkdocs` in `requirements-dev.txt` or at `docs/requirements.txt` to keep it isolated.This file should have `mkdocs` in it and also any themes if needed.
|
||||||
|
|
||||||
|
|
||||||
### Create a starter site
|
### Create a starter site
|
||||||
|
|
||||||
Run this command to create a starter site. This make the steps below go quicker.
|
Run this command to create a starter site. This make the steps below go quicker.
|
||||||
@@ -50,7 +57,7 @@ _Tip: Optionally use the `new` command covered above to setup the config and ind
|
|||||||
- Use placeholder content if you want to move on and then come back to expand them.
|
- Use placeholder content if you want to move on and then come back to expand them.
|
||||||
- If you have any existing markdown docs, these will work too.
|
- If you have any existing markdown docs, these will work too.
|
||||||
2. Set up config.
|
2. Set up config.
|
||||||
1. Create `mkdocs.yml` at project root.
|
1. Create `mkdocs.yml` at the project root.
|
||||||
2. Set up a navbar there.
|
2. Set up a navbar there.
|
||||||
3. Choose a theme.
|
3. Choose a theme.
|
||||||
3. Create a favicon (optional).
|
3. Create a favicon (optional).
|
||||||
@@ -63,7 +70,7 @@ You project should now look this this:
|
|||||||
|
|
||||||
- `docs/`
|
- `docs/`
|
||||||
- `index.md`
|
- `index.md`
|
||||||
- Other pages...
|
- More pages...
|
||||||
- `mkdocs.yml`
|
- `mkdocs.yml`
|
||||||
- `.gitignore`
|
- `.gitignore`
|
||||||
- `venv`
|
- `venv`
|
||||||
@@ -75,7 +82,6 @@ You project should now look this this:
|
|||||||
### Ignore file
|
### Ignore file
|
||||||
|
|
||||||
`.gitignore`
|
`.gitignore`
|
||||||
|
|
||||||
```
|
```
|
||||||
site/
|
site/
|
||||||
|
|
||||||
@@ -84,6 +90,7 @@ venv
|
|||||||
|
|
||||||
### Navbar
|
### Navbar
|
||||||
|
|
||||||
|
`mkdocs.yml`
|
||||||
```yaml
|
```yaml
|
||||||
nav:
|
nav:
|
||||||
- Home: index.md
|
- Home: index.md
|
||||||
@@ -115,12 +122,13 @@ Find more [supported themes](https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes
|
|||||||
|
|
||||||
See below using [mkdocs-rtd-dropdown](https://github.com/cjsheets/mkdocs-rtd-dropdown).
|
See below using [mkdocs-rtd-dropdown](https://github.com/cjsheets/mkdocs-rtd-dropdown).
|
||||||
|
|
||||||
`requirements.txt`
|
`requirements.txt`:
|
||||||
```
|
```
|
||||||
mkdocs-rtd-dropdown
|
mkdocs-rtd-dropdown
|
||||||
```
|
```
|
||||||
|
|
||||||
`mkdocs.yml`
|
`mkdocs.yml`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
theme:
|
theme:
|
||||||
name: 'rtd-dropdown'
|
name: 'rtd-dropdown'
|
||||||
@@ -130,12 +138,12 @@ theme:
|
|||||||
|
|
||||||
See the [MkDocs for Material](https://squidfunk.github.io/mkdocs-material/) homepage. See the Set up page for config options.
|
See the [MkDocs for Material](https://squidfunk.github.io/mkdocs-material/) homepage. See the Set up page for config options.
|
||||||
|
|
||||||
`requirements.txt`
|
`requirements.txt`:
|
||||||
```
|
```
|
||||||
mkdocs-material-extensions>=1.0
|
mkdocs-material-extensions>=1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
`mkdocs.yml`
|
`mkdocs.yml`:
|
||||||
```yaml
|
```yaml
|
||||||
theme:
|
theme:
|
||||||
name: 'material'
|
name: 'material'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Usage
|
# Usage
|
||||||
> Build and preview a site locally
|
> Build and preview a site locally
|
||||||
|
|
||||||
Make sure to run all commands from the `docs` directory.
|
Make sure to run all commands from the `docs` directory, as that is where `Makefile` is.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cd docs
|
$ cd docs
|
||||||
@@ -14,21 +14,13 @@ $ cd docs
|
|||||||
$ make help
|
$ make help
|
||||||
```
|
```
|
||||||
```
|
```
|
||||||
.PHONY: docs
|
|
||||||
|
|
||||||
default: install
|
default: install
|
||||||
|
all: install build
|
||||||
|
|
||||||
h help:
|
h help:
|
||||||
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
upgrade:
|
||||||
|
|
||||||
s serve:
|
s serve:
|
||||||
|
|
||||||
b build:
|
b build:
|
||||||
|
|
||||||
d deploy:
|
d deploy:
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -38,13 +30,7 @@ d deploy:
|
|||||||
This will build the docs in memory (not to disk) and serve an auto-reloading server.
|
This will build the docs in memory (not to disk) and serve an auto-reloading server.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ make s
|
$ make serve
|
||||||
```
|
|
||||||
|
|
||||||
That will use `Makefile` to run the following:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ mkdocs serve --strict
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open in your browser:
|
Then open in your browser:
|
||||||
@@ -57,11 +43,5 @@ Then open in your browser:
|
|||||||
Build docs site to `site` directory. This is useful for a CI flow.
|
Build docs site to `site` directory. This is useful for a CI flow.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ make b
|
$ make build
|
||||||
```
|
|
||||||
|
|
||||||
That will use `Makefile` to run the following:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ mkdocs build --strict
|
|
||||||
```
|
```
|
||||||
|
|||||||
+11
-7
@@ -1,6 +1,15 @@
|
|||||||
|
### Site metadata ###
|
||||||
|
|
||||||
site_name: MkDocs Quickstart
|
site_name: MkDocs Quickstart
|
||||||
# SEO description.
|
site_description: Starter template for a MkDocs docs site on GH Pages - including CI
|
||||||
site_description: "A concise recipe for setting up a MkDocs docs site on GitHub Pages"
|
site_url: https://michaelcurrin.github.io/mkdocs-quickstart/
|
||||||
|
|
||||||
|
repo_url: https://github.com/MichaelCurrin/mkdocs-quickstart
|
||||||
|
edit_uri: edit/master/docs/docs
|
||||||
|
|
||||||
|
### Build settings ###
|
||||||
|
|
||||||
|
theme: readthedocs
|
||||||
|
|
||||||
nav:
|
nav:
|
||||||
- Home: index.md
|
- Home: index.md
|
||||||
@@ -12,8 +21,3 @@ nav:
|
|||||||
- Advanced: tutorial/advanced.md
|
- Advanced: tutorial/advanced.md
|
||||||
- Usage: tutorial/usage.md
|
- Usage: tutorial/usage.md
|
||||||
- Deploy: tutorial/deploy.md
|
- Deploy: tutorial/deploy.md
|
||||||
|
|
||||||
theme: readthedocs
|
|
||||||
|
|
||||||
# Target for Edit in GitHub button.
|
|
||||||
repo_url: https://github.com/MichaelCurrin/mkdocs-quickstart/
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
mkdocs~=1.1
|
mkdocs~=1.1,!=1.2
|
||||||
|
|||||||
Reference in New Issue
Block a user