Skip to content

Commit 64b56a9

Browse files
authored
Add info about how to use move-content.js script (github#36530)
1 parent 3c039b6 commit 64b56a9

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

script/move-content.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@
22

33
// [start-readme]
44
//
5-
// Helps you move (a.k.a. rename) a file or a folder and does what's
6-
// needed with frontmatter redirect_from.
5+
// Use this script to help you move or rename a single file or a folder. The script will move or rename the file or folder for you, update relevant `children` in the index.md file(s), and add a `redirect_from` to frontmatter in the renamed file(s). Note: You will still need to manually update the `title` if necessary.
6+
//
7+
// By default, the `move-content.js` script will commit the changes it makes. If you don't want the script to run any git commands for you, run it with the `--no-git` flag. Note: In most cases it will be easier and safer to let the script run the git commands for you, since git can get confused when a file is both renamed and edited.
8+
//
9+
// To learn more about the script, you can run `script/move-content.js --help`.
10+
//
11+
// To run the script for a file:
12+
// - `script/move-content.js PATH/TO/CURRENT-FILE.md PATH/TO/DESIRED-FILE-LOCATION-OR-NAME.md`
13+
//
14+
// To run the script for a folder:
15+
// - `script/move-content.js PATH/TO/CURRENT-FOLDER PATH/TO/DESIRED-FOLDER-LOCATION-OR-NAME`
16+
//
17+
// To undo the script, run the same command that you used to run the script, but add an `--undo` flag:
18+
// - `script/move-content.js --undo PATH/TO/OLD PATH/TO/NEW`
719
//
820
// [end-readme]
921

0 commit comments

Comments
 (0)