knktc's Notes

python, cloud, linux...

0%

Disable the "Edit this page" Link in Docusaurus

I recently used Docusaurus V2.0 to write product documentation and noticed that every generated page included an “Edit this page” link in the lower-left corner. Since the final docs were meant for customers, that edit link was not really necessary.

Disable globally

If you want to disable the link everywhere, edit docusaurus.config.js and set editUrl to undefined inside the docs preset configuration:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/',
editUrl: undefined,
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],

Disable for selected pages

If you only want to disable the link for certain pages, set custom_edit_url to null in the page front matter:

1
2
3
4
---
title: Test Page
custom_edit_url: null
---

Reference

如果我的文字帮到了您,那么可不可以请我喝罐可乐?