@@ -102,20 +102,29 @@ Some popular choices:
102
102
[:octicons-tag-24 : 9.0.0][Code actions support] ·
103
103
:octicons-unlock-24 : Feature flag
104
104
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.
109
108
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"
111
120
112
121
` ` ` yaml
113
122
theme:
114
123
features:
115
124
- content.action.edit
116
125
` ` `
117
126
118
- === ":material-eye : View source of this page"
127
+ === ":material-file- eye-outline : View source of this page"
119
128
120
129
` ` ` yaml
121
130
theme:
@@ -145,10 +154,11 @@ theme:
145
154
146
155
[Code actions support] : https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0
147
156
[repository URL] : # repository
148
- [edit_uri] : https://www.mkdocs.org/user-guide/configuration/#edit_uri
149
157
[GitHub] : https://github.com/
150
158
[GitLab] : https://about.gitlab.com/
151
159
[Bitbucket] : https://bitbucket.org/
160
+ [MkDocs] : https://www.mkdocs.org
161
+ [edit_uri] : https://www.mkdocs.org/user-guide/configuration/#edit_uri
152
162
153
163
# ## Revisioning
154
164
0 commit comments