You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 22, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/setup/README.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -37,17 +37,19 @@ This creates the following structure in the directory:
37
37
38
38
## Update mkdocs.yml
39
39
40
-
So that the template displays properly, in `mkdocs.yml` insert the relevant values for `site_name` and `repo_url`, and set the `theme` so that it uses our MkDocs tech docs template:
40
+
So that the template displays properly, copy the following into `mkdocs.yml`:
41
41
42
42
```
43
-
- site_name: <your-website-name>
44
-
- repo_url: <your-website-url>
45
-
- theme:
43
+
repo_url: <your-website-url>
44
+
repo_name: <your-repo-name>
45
+
theme:
46
46
name: tech_docs_template
47
47
plugins:
48
48
- material/search
49
49
```
50
50
51
+
This sets the theme to use the MkDocs Tech Docs Template and enables the search bar plugin. After copying, insert the relevant values for `site_name`, `repo_url` and `repo_name`.
52
+
51
53
## Preview your documentation
52
54
53
55
MkDocs includes a live preview server that automatically rebuilds when you save a file, so you can preview your changes as you write. To start the server, in your terminal run:
@@ -60,11 +62,11 @@ To stop the server, in your terminal press Ctrl+C. If the page stops loading, ch
60
62
61
63
## Build your documentation
62
64
63
-
If you are using GitHub, you can use [GitHub Actions][gh_actions] to automate the deployment of your documentation to [GitHub Pages](https://pages.github.com/)when a commit is pushed to either the master or main branches. See the [Material for MKDocs documentation][material_publishing] for more details and alternatives.
65
+
If you are using GitHub, you can use [GitHub Actions][gh_actions] to automate the deployment of your documentation to [GitHub Pages](https://pages.github.com/)whenever someone pushes a commit to the master or main branch. See the [Material for MKDocs documentation][material_publishing] for more details and alternatives.
64
66
65
-
## Customise your documentation
67
+
## Configure page layout
66
68
67
-
We have provided some customisation options in [customise](customise.md), but we encourage you to read the [Material for MkDocs documentation][material_docs] for more detailed information on customisation.
69
+
This template is flexible. For examples of how you can structure navigation and table of contents, as well as other customisation options, see [Customise](customise.md).
Copy file name to clipboardExpand all lines: docs/setup/customise.md
+39-19Lines changed: 39 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,23 @@
1
1
# Customise your template
2
2
3
-
This page explains the customisation used in the demo. You are encouraged to read the Material for MkDocs [guidance][material] for more detailed information on customisation.
3
+
This page explains the different components we use to configure page layout for the demo site you are currently viewing. You can apply these to your template to make your site look similar.
4
4
5
-
When customising, be mindful of your users. Make sure you do not overcomplicate things for them or anyone else who might contribute to your documentation.
5
+
When customising, keep your users in mind. The template is flexible, but try not to complicate things for readers, or anyone contributing to your documentation.
6
+
7
+
For more information on customisation, see the [Material for MkDocs guidance][material].
6
8
7
9
## Page Layout
8
10
9
-
The `nav`configuration setting in your `mkdocs.yml` file defines which pages are included in the global site navigation menu as well as the structure of that menu.
11
+
The `nav` setting in your `mkdocs.yml` file defines which pages to include in your table of contents and their structure.
10
12
11
-
If not provided, the navigation will be automatically created by discovering all the Markdown files in the documentation directory. See [Configure Pages and Navigation][pageNav] for more details.
13
+
If you do not define `nav`, the template automatically search for Markdown files in the docs directory and creates a table of contents. For more information on how this works, see the [MkDocs documentation on configuring pages and navigation][pageNav].
12
14
13
15
### Nesting pages
14
16
15
-
Parent items can either contain a single page or a nested list of child pages, but not both:
17
+
Parent items can contain a single page or a nested list of child pages, but not both:
16
18
17
19
```
20
+
nav:
18
21
- Home: index.md
19
22
- Parent:
20
23
- 'Nested Page': 'somepage.md'
@@ -24,7 +27,7 @@ Parent items can either contain a single page or a nested list of child pages, b
24
27
25
28
### Top bar navigation
26
29
27
-
Top bar navigation tabs are disabled by default. To enable them, update `mkdocs.yml` with the following:
30
+
Top bar navigation tabs do not display by default. To display them, update `mkdocs.yml` with the following:
28
31
```
29
32
theme:
30
33
features:
@@ -35,21 +38,27 @@ theme:
35
38
36
39
### Right-hand navigation
37
40
38
-
By default, this template displays page sections on the right-hand table of contents. To merge the sections into the left-hand table of comments, in `mkdocs.yml`, uncomment `toc.integrate`.
41
+
By default, this template displays page sections on the right-hand table of contents. To merge the sections into the left-hand table of comments, add `toc.integrate` in `mkdocs.yml`:
42
+
43
+
```
44
+
theme:
45
+
features:
46
+
- toc.integrate
47
+
```
39
48
40
-
For more information on how you can customise navigation, see [setting up navigation][navSetup].
49
+
For more information on how you can customise navigation, see the [Material for MkDocs documentation on setting up navigation][navSetup].
41
50
42
51
## Logos and Images
43
52
44
-
To use your department's images you can use one of the provided [logos][logos] and [favicons][favicons] and specify the path in the `mkdocs.yml` for example:
53
+
To use government images on your site you can use one of the provided [logos][logos] and [favicons][favicons] and specify the path in `mkdocs.yml`, for example:
45
54
46
55
```
47
56
theme:
48
57
logo: logos/moj.png
49
58
favicon: favicons/moj.ico
50
59
```
51
60
52
-
Alternatively you can add the images to the `docs/assets` directory in your own repository and specify the path for example:
61
+
Alternatively, you can add images to the `docs/assets` directory in your own repository and specify the path, for example:
53
62
54
63
```
55
64
theme:
@@ -59,14 +68,11 @@ theme:
59
68
60
69
## Admonitions
61
70
62
-
Admonitions, also known as call-outs, are an excellent choice for including side content without significantly interrupting the document flow. They can also be used to provide structure and coloured headingsas in used on the [home page][home]. Please refer to [admonitions][admonitions] for more details. Do consider adding the images to the template for sharing with colleagues!
71
+
[Admonitions][admonitions] (also known as call-outs) are a way of including content without interrupting the flow of your content. They can also help to provide structure and coloured headings, such as those on the [homepage][home].
63
72
64
-
## Footer
73
+
## Social links
65
74
66
-
### Social links
67
-
68
-
Social links are rendered above the copyright notice as part of the
69
-
footer of your project documentation. Add a list of social links in `mkdocs.yml`
75
+
Social links are rendered above the copyright notice as part of the footer of your project documentation. Add a list of social links in `mkdocs.yml` using the following:
70
76
with:
71
77
72
78
```yaml
@@ -78,11 +84,25 @@ extra:
78
84
79
85
Please refer to [social links][social] for more details.
80
86
81
-
## Dark Mode
87
+
## Dark Mode (experimental)
82
88
83
-
Use the sun icon in the top bar to switch between light and dark mode.
89
+
To enable Dark Mode, add the following in `mkdocs.yml`
90
+
91
+
```
92
+
palette:
93
+
# Palette toggle for light mode
94
+
- scheme: default
95
+
toggle:
96
+
icon: material/brightness-7
97
+
name: Switch to dark mode
98
+
# Palette toggle for dark mode
99
+
- scheme: slate
100
+
toggle:
101
+
icon: material/brightness-4
102
+
name: Switch to light mode
103
+
```
84
104
85
-
See [Changing the colors](https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/) for more details.
105
+
Use the sun icon in the top bar to switch between light and dark mode.
0 commit comments