Added: sitemap.xml, robots.txt
Fixed: Removing unwanted pages for each post
This commit is contained in:
parent
6a826b1ec3
commit
f4c7bfd959
@ -23,6 +23,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
zola build
|
zola build
|
||||||
|
|
||||||
|
- name: Remove unwanted pages
|
||||||
|
run: bash ./delete_pages.sh
|
||||||
|
|
||||||
- name: Set Destination Folder if MASTER
|
- name: Set Destination Folder if MASTER
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
run: echo "DEST_FOLDER=/srv/www/cz/pkmples/www" >> $GITHUB_ENV
|
run: echo "DEST_FOLDER=/srv/www/cz/pkmples/www" >> $GITHUB_ENV
|
||||||
|
20
delete_pages.sh
Executable file
20
delete_pages.sh
Executable file
@ -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
|
4
templates/robots.txt
Normal file
4
templates/robots.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
|
Allow: /
|
||||||
|
Sitemap: https://www.pkmples.cz/sitemap.xml
|
8
templates/sitemap.xml
Normal file
8
templates/sitemap.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>https://www.pkmples.cz/</loc>
|
||||||
|
<changefreq>daily</changefreq>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
Loading…
Reference in New Issue
Block a user