more translation, add unity for defences
This commit is contained in:
parent
a41be821c1
commit
205c953752
768 changed files with 75229 additions and 21035 deletions
35
scripts/convert_alerts_to_github.sh
Executable file
35
scripts/convert_alerts_to_github.sh
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Script to convert old alert syntax to GitHub-style alerts
|
||||
|
||||
# Change to workspace root
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# File to process
|
||||
FILE="content/project/2021-03-01-philosophy/index.md"
|
||||
|
||||
if [ ! -f "$FILE" ]; then
|
||||
echo "Error: File not found: $FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create backup
|
||||
cp "$FILE" "$FILE.backup"
|
||||
|
||||
# Convert {% alert(note=true) %} to > [!NOTE]
|
||||
# and {% end %} to empty line (removing the closing tag)
|
||||
|
||||
# Use sed to do the transformation
|
||||
sed -i.tmp '
|
||||
# Convert opening alert tag
|
||||
s/{% alert(note=true) %}/> [!NOTE]/g
|
||||
|
||||
# Remove closing tag
|
||||
/^{% end %}$/d
|
||||
' "$FILE"
|
||||
|
||||
# Remove temporary file
|
||||
rm -f "$FILE.tmp"
|
||||
|
||||
echo "Conversion complete!"
|
||||
echo "Backup saved as: $FILE.backup"
|
||||
Loading…
Add table
Add a link
Reference in a new issue