studio-umzu/scripts/youtube_rewrite.sh
2025-08-27 16:56:14 +02:00

11 lines
432 B
Bash
Executable file

#!/bin/bash
# Set the path to the content folder
CONTENT_DIR="../content"
# Loop through all markdown files in the content folder
find "$CONTENT_DIR" -type f -name "*.md" | while read -r file; do
# Use sed to replace the old format with the new format while preserving the YouTube ID
sed -i '' -E 's|{% include video id="([a-zA-Z0-9_-]+)" provider="youtube" %}|{{ youtube(id="\1") }}|g' "$file"
echo "Processed: $file"
done