Skip to content

Commit 3b6c142

Browse files
committed
Improved edit_uri documentation
1 parent 8796d90 commit 3b6c142

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

docs/setup/adding-a-git-repository.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,29 @@ Some popular choices:
102102
[:octicons-tag-24: 9.0.0][Code actions support] ·
103103
:octicons-unlock-24: Feature flag
104104

105-
If the [repository URL] points to a [GitHub], [GitLab] or [Bitbucket] repository,
106-
buttons for code actions can be added at the top of each document. Currently,
107-
two types of code actions are supported: `edit` and `view` (GitHub only). Add
108-
the following lines to `mkdocs.yml`:
105+
If the [repository URL] points to a valid [GitHub], [GitLab] or [Bitbucket]
106+
repository, [MkDocs] provides a setting called [`edit_uri`][edit_uri], which
107+
resolves to the subfolder where your documentation is hosted.
109108

110-
=== ":material-pencil: Edit this page"
109+
If your default branch is called `main`, change the setting to:
110+
111+
``` yaml
112+
edit_uri: blob/main/docs/
113+
```
114+
115+
After making sure that `edit_uri` is correctly configured, buttons for code
116+
actions can be added. Two types of code actions are supported: `edit` and `view`
117+
(GitHub only):
118+
119+
=== ":material-file-edit-outline: Edit this page"
111120

112121
``` yaml
113122
theme:
114123
features:
115124
- content.action.edit
116125
```
117126

118-
=== ":material-eye: View source of this page"
127+
=== ":material-file-eye-outline: View source of this page"
119128

120129
``` yaml
121130
theme:
@@ -145,10 +154,11 @@ theme:
145154

146155
[Code actions support]: https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0
147156
[repository URL]: #repository
148-
[edit_uri]: https://www.mkdocs.org/user-guide/configuration/#edit_uri
149157
[GitHub]: https://github.com/
150158
[GitLab]: https://about.gitlab.com/
151159
[Bitbucket]: https://bitbucket.org/
160+
[MkDocs]: https://www.mkdocs.org
161+
[edit_uri]: https://www.mkdocs.org/user-guide/configuration/#edit_uri
152162

153163
### Revisioning
154164

docs/setup/setting-up-a-blog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ the [built-in blog plugin] would create it:
12791279
├─ docs/
12801280
│ └─ blog/
12811281
│ ├─ category/
1282-
│ │ └─ hello.md #(1)!
1282+
│ │ └─ hello.md # (1)!
12831283
│ ├─ posts/
12841284
│ └─ index.md
12851285
└─ mkdocs.yml

0 commit comments

Comments
 (0)