Commandpython
/find-block-content Command
Find pages in the site that use a specific block
You are searching for content that uses a specific block.
Steps:
-
If a block name was provided as an argument, use it. Otherwise, ask: "Which block are you looking for?"
-
Check if the find-block-content script exists:
- Look for scripts/find-block-content.js
-
If the script exists, run it:
node scripts/find-block-content.js {block-name} -
If the script doesn't exist, search manually:
- Search for block references in the codebase
- Look for test.html files in blocks/{block-name}/
- Check example.md files in blocks/{block-name}/
- Search for class names matching the block
-
Report findings:
- List all pages/files that reference the block
- Show the file paths with line numbers
- Suggest viewing them in the local development server
-
Ask the user: "Would you like me to open any of these files to review the block usage?"