Update contact.html #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Static SEO Autogenerator (Full & Hardened) | ||
| on: | ||
| push: | ||
| branches: ["main"] | ||
| paths-ignore: | ||
| - "**/*.md" | ||
| - ".github/workflows/seo-static-autogen.yml" | ||
| workflow_dispatch: | ||
| jobs: | ||
| seo: | ||
| if: "!contains(github.event.head_commit.message, '[skip seo]')" | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Enable strict shell mode | ||
| run: | | ||
| set -Eeuo pipefail | ||
| - name: Define SEO configuration | ||
| run: | | ||
| cat << 'EOF' > seo.env | ||
| BRAND="Gravity Group RSA" | ||
| DOMAIN="https://www.ggrsa.co.za" | ||
| PHONE="+27826300543" | ||
| WHATSAPP="27826300543" | ||
| SERVICES=("towing" "locksmith" "battery-jumpstart" "fuel-delivery" "tyre-change") | ||
| GAUTENG_CITIES=( | ||
| "Johannesburg" | ||
| "Pretoria" | ||
| "Sandton" | ||
| "Midrand" | ||
| "Centurion" | ||
| "Randburg" | ||
| "Roodepoort" | ||
| "Kempton Park" | ||
| "Boksburg" | ||
| "Benoni" | ||
| "Brakpan" | ||
| "Springs" | ||
| "Edenvale" | ||
| "Germiston" | ||
| "Alberton" | ||
| "Krugersdorp" | ||
| "Vanderbijlpark" | ||
| "Vereeniging" | ||
| "Sebokeng" | ||
| ) | ||
| JOHANNESBURG_SUBURBS=( | ||
| "Rosebank" | ||
| "Fourways" | ||
| "Bryanston" | ||
| "Melrose" | ||
| "Sandton CBD" | ||
| ) | ||
| EOF | ||
| - name: Generate SEO pages | ||
| run: | | ||
| source seo.env | ||
| mkdir -p services areas/gauteng/johannesburg | ||
| slugify() { | ||
| echo "$1" | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g' | ||
| } | ||
| html_page() { | ||
| TITLE="$1" | ||
| DESC="$2" | ||
| BODY="$3" | ||
| SERVICE_LINKS="" | ||
| for S in "${SERVICES[@]}"; do | ||
| SERVICE_LINKS="$SERVICE_LINKS<li><a href=\"/services/${S}.html\">${S//-/ }</a></li>" | ||
| done | ||
| cat <<HTML | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>${TITLE}</title> | ||
| <meta name="description" content="${DESC}"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| </head> | ||
| <body> | ||
| <h1>${TITLE}</h1> | ||
| <p>${BODY}</p> | ||
| <section> | ||
| <h2>Our Roadside Services</h2> | ||
| <ul> | ||
| ${SERVICE_LINKS} | ||
| </ul> | ||
| </section> | ||
| <section> | ||
| <h2>Need Help Now?</h2> | ||
| <p><strong>24/7 Emergency Roadside Assistance</strong></p> | ||
| <a href="tel:${PHONE}">Call Now</a><br> | ||
| <a href="https://wa.me/${WHATSAPP}">WhatsApp Us</a> | ||
| </section> | ||
| </body> | ||
| </html> | ||
| HTML | ||
| } | ||
| for S in "${SERVICES[@]}"; do | ||
| html_page \ | ||
| "${S//-/ } Services | 24/7 Assistance" \ | ||
| "24/7 ${S//-/ } services across Gauteng." \ | ||
| "Gravity Group RSA provides fast ${S//-/ } services across Gauteng." \ | ||
| > "services/${S}.html" | ||
| done | ||
| for CITY in "${GAUTENG_CITIES[@]}"; do | ||
| SLUG=$(slugify "$CITY") | ||
| html_page \ | ||
| "Roadside Assistance in ${CITY} | 24/7" \ | ||
| "24/7 towing and roadside assistance in ${CITY}, Gauteng." \ | ||
| "Emergency roadside assistance available in ${CITY}, Gauteng." \ | ||
| > "areas/gauteng/${SLUG}.html" | ||
| done | ||
| for SUB in "${JOHANNESBURG_SUBURBS[@]}"; do | ||
| SLUG=$(slugify "$SUB") | ||
| html_page \ | ||
| "Roadside Assistance in ${SUB}, Johannesburg | 24/7" \ | ||
| "24/7 roadside assistance in ${SUB}, Johannesburg." \ | ||
| "Fast roadside assistance available in ${SUB}, Johannesburg." \ | ||
| > "areas/gauteng/johannesburg/${SLUG}.html" | ||
| done | ||
| - name: Generate sitemap.xml | ||
| run: | | ||
| source seo.env | ||
| { | ||
| echo '<?xml version="1.0" encoding="UTF-8"?>' | ||
| echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' | ||
| echo "<url><loc>${DOMAIN}/areas/gauteng/index.html</loc></url>" | ||
| for S in "${SERVICES[@]}"; do | ||
| echo "<url><loc>${DOMAIN}/services/${S}.html</loc></url>" | ||
| done | ||
| for CITY in "${GAUTENG_CITIES[@]}"; do | ||
| SLUG=$(slugify "$CITY") | ||
| echo "<url><loc>${DOMAIN}/areas/gauteng/${SLUG}.html</loc></url>" | ||
| done | ||
| for SUB in "${JOHANNESBURG_SUBURBS[@]}"; do | ||
| SLUG=$(slugify "$SUB") | ||
| echo "<url><loc>${DOMAIN}/areas/gauteng/johannesburg/${SLUG}.html</loc></url>" | ||
| done | ||
| echo '</urlset>' | ||
| } > sitemap.xml | ||
| - name: Commit and push if changed | ||
| run: | | ||
| if [[ -n "$(git status --porcelain)" ]]; then | ||
| git config user.name "ggrsa-seo-bot" | ||
| git config user.email "seo@skunkworks.africa" | ||
| git add services areas sitemap.xml | ||
| git commit -m "SEO: full Gauteng geo expansion [skip seo]" | ||
| git push | ||
| fi | ||