diff --git a/editor.mdx b/editor.mdx index bae5ff72d..a293be73a 100644 --- a/editor.mdx +++ b/editor.mdx @@ -186,6 +186,40 @@ To delete a page, click the kebab menu icon for the file you want to delete. Sel /> +### Duplicate files and folders + +Duplicate existing files or folders to quickly create copies with similar content or structure. + +To duplicate a file or folder, click the kebab menu icon for the item you want to duplicate. Select **Duplicate** from the dropdown menu. + + + Duplicate file in the visual editor. + + Duplicate file in the visual editor in dark mode. + + +#### File duplication + +When you duplicate a file, the editor creates a new file with the same content and adds a `-copied-N` suffix to the filename, where `N` is an incrementing number. For example, duplicating `quickstart.mdx` creates `quickstart-copied-1.mdx`. If you duplicate again, it creates `quickstart-copied-2.mdx`. + +The duplicated file includes all the original content and is automatically added to your navigation in `docs.json`. + +#### Folder duplication + +When you duplicate a folder, the behavior depends on the structure of the files inside: + +- **Files share a common folder**: If all files in the folder share the same parent directory (for example, `guides/getting-started/intro.mdx` and `guides/getting-started/setup.mdx`), the editor duplicates the entire folder structure. The new folder gets a `-copied-N` suffix (for example, `guides/getting-started-copied-1/`), and all file paths are updated to reflect the new folder name. + +- **Files in different folders**: If files don't share a common parent directory, the editor creates individual duplicates of each file with the `-copied-N` suffix and updates the navigation accordingly. + ### Organize your navigation Edit your `docs.json` file to add new pages and remove deleted pages from your site navigation. See [Navigation](/organize/navigation) for more information on how to organize pages.