#!/bin/bash
# Fix date variable in MkDocs footer

cd /var/www/mkdocs/site/docs
sed -i "s/\$(date)/$(date)/" index.md

# Rebuild site
cd /var/www/mkdocs/site
source /var/www/mkdocs/venv/bin/activate
mkdocs build

# Commit fix to Git
git add docs/index.md
git commit -m "Fix footer date variable"
git push origin main

echo "Footer date fixed and pushed to Git"
