Skip to content

Commit 1e41056

Browse files
Merge pull request #29 from encode/loaders-config
Loaders configuration
2 parents 41e5536 + dfdc569 commit 1e41056

File tree

12 files changed

+55
-145
lines changed

12 files changed

+55
-145
lines changed

docs/configuration.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

docs/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ nav = [
3535
{path: "README.md", title: "Introduction"},
3636
{path: "CREDITS.md", title: "Credits"},
3737
]
38-
loaders = [
39-
{package: "mkdocs:theme"},
40-
{directory: "docs"},
41-
]
38+
39+
[loaders]
40+
theme = "pkg://mkdocs/default"
41+
docs = "dir://docs"
42+
43+
[context]
44+
title = "Documentation"
45+
favicon = "📘"
4246
```
4347

4448
*Use either [`README.md` or `index.md`](navigation.md#url-structure) for the homepage.*
@@ -49,7 +53,3 @@ Styling adaptations can be kept simple, such as customising the colour scheme, o
4953

5054
1. Modify [the HTML templating](styling.md#templates) to customise the layout.
5155
2. Override or add [CSS and JavaScript](styling.md#statics) static assets.
52-
53-
## Compatibility
54-
55-
*Work is planned to handle compatibility for both [mkdocs 2.x](https://www.encode.io/mkdocs/) sites, and [mkdocs 1.x](https://www.mkdocs.org/) sites.*

docs/styling.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,40 +121,33 @@ Controlling how resources are loaded for the theme and documentation is handled
121121
*The default theme supplied by the `mkdocs` package, and the documentation served directly from the project directory. This is the default configuration...*
122122

123123
```toml
124-
[mkdocs]
125-
resources = [
126-
{package="mkdocs:theme"},
127-
{directory="."},
128-
]
124+
[loaders]
125+
theme = "pkg://mkdocs/default"
126+
docs = "dir://"
129127
```
130128

131129
*The default theme as a `.zip` URL, and a local `docs` directory...*
132130

133131
```toml
134-
[mkdocs]
135-
resources = [
136-
{url="https://github.com/lovelydinosaur/mkdocs-theme/archive/refs/heads/main.zip"},
137-
{directory="docs"},
138-
]
132+
[loaders]
133+
theme = "https://github.com/lovelydinosaur/mkdocs-theme/archive/refs/heads/main.zip"
134+
docs = "dir://docs"
139135
```
140136

141137
*A theme downloaded locally, and a `docs` directory...*
142138

143139
```toml
144-
[mkdocs]
145-
resources = [
146-
{directory="theme"},
147-
{directory="docs"},
148-
]
140+
[loaders]
141+
theme = "dir://theme"
142+
docs = "dir://docs"
149143
```
150144

151145
*Both the theme and the documentation included in a single directory...*
152146

153147
```toml
154148
[mkdocs]
155-
resources = [
156-
{directory="docs"},
157-
]
149+
theme = "dir://docs"
150+
docs = "dir://docs"
158151
```
159152

160153
<br/>

mkdocs.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ nav = [
55
{title="Interlinking & Navigation", path="navigation.md"},
66
{title="Themes & Styling", path="styling.md"}
77
]
8-
resources = [
9-
{package="mkdocs:theme"},
10-
{directory="docs"},
11-
]
8+
9+
[loaders]
10+
theme = "pkg://mkdocs/default"
11+
docs = "dir://docs"
1212

1313
[context]
1414
title = "MkDocs"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)