Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add move-pages script #842

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Add move-pages script #842

merged 2 commits into from
Dec 16, 2024

Conversation

benface
Copy link
Contributor

@benface benface commented Dec 16, 2024

This is a follow-up to #838. I realized that while the fix-pages-structure script was super useful when adding or deleting pages, moving pages was still a pain because if you only did it in English and then ran fix-pages-structure, it would delete the translated pages at the old paths (because those paths no longer exist in English) and then copy the English pages to the new paths, thus reverting all translations to English until Crowdin synced and the next Crowdin PR was merged. So I created a move-pages script that moves (or simply renames) a page (or a directory of pages) across all languages/locales:

Usage: pnpm run move-pages <source-path> <destination>
Examples:
  pnpm run move-pages page.mdx new-directory             Move page (keeping name)
  pnpm run move-pages page.mdx new-name.mdx              Rename page
  pnpm run move-pages page.mdx new-dir/new-name.mdx      Move and rename page
  pnpm run move-pages developing subgraphs/developing    Move directory
  pnpm run move-pages developing subgraphs               Rename directory

@benface benface requested a review from a team as a code owner December 16, 2024 22:40
@benface benface merged commit 150f812 into main Dec 16, 2024
4 checks passed
@benface benface deleted the benface/move-pages-script branch December 16, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant