prosberry/pocisti-cta.sh

16 lines
666 B
Bash
Executable File

#!/bin/bash
# Poišči vse HTML datoteke, razen predlog
FILES=$(find . -name "*.html" ! -path "./footer-template.html" ! -path "./header-template.html" ! -path "./blog/template.html" ! -path "./blog/article-template.html")
echo "Začenjam odstranjevati podvojene CTA razdelke..."
for file in $FILES; do
# Uporabimo Perl za brisanje večvrstičnega bloka od <section class="final-cta"> do </section>
# To bo odstranilo vse ročno vpisane verzije.
perl -0777 -i -pe 's/<section class="final-cta">.*?<\/section>//sg' "$file"
echo "Očiščeno: $file"
done
echo "Končano. Zdaj zaženi ./update-footer.sh, da ponovno vstaviš pravilen (enojni) CTA."