diff --git a/.gitea/workflows/build_and_deploy.yaml b/.gitea/workflows/build_and_deploy.yaml index 9479652..b83b301 100644 --- a/.gitea/workflows/build_and_deploy.yaml +++ b/.gitea/workflows/build_and_deploy.yaml @@ -22,6 +22,9 @@ jobs: - name: Build Zola Website run: | zola build + + - name: Remove unwanted pages + run: bash ./delete_pages.sh - name: Set Destination Folder if MASTER if: ${{ github.ref == 'refs/heads/master' }} diff --git a/delete_pages.sh b/delete_pages.sh new file mode 100755 index 0000000..898a444 --- /dev/null +++ b/delete_pages.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +content_dir="./content" +public_dir="./public" + +cp "$sitemap_file" "$temp_sitemap_file" + +for file in "$content_dir"/*; do + file_name=$(basename "$file") + folder_name="${file_name%.*}" + folder_name_dashed=$(echo "$folder_name" | tr '_' '-') + folder_path="$public_dir/$folder_name_dashed" + + if [ -d "$folder_path" ]; then + rm -r "$folder_path" + echo "Removed: $folder_path" + else + echo "Folder not found: $folder_path" + fi +done diff --git a/templates/robots.txt b/templates/robots.txt new file mode 100644 index 0000000..6774d52 --- /dev/null +++ b/templates/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: +Allow: / +Sitemap: https://www.pkmples.cz/sitemap.xml \ No newline at end of file diff --git a/templates/sitemap.xml b/templates/sitemap.xml new file mode 100644 index 0000000..6938ea1 --- /dev/null +++ b/templates/sitemap.xml @@ -0,0 +1,8 @@ + + + + https://www.pkmples.cz/ + daily + 1.0 + + \ No newline at end of file