run indexnow script automatically
This commit is contained in:
parent
da0717613c
commit
4b599c2421
@ -24,7 +24,7 @@ rsync -rpcv --chmod=D755,F644 --delete --fsync --preallocate static-tmp/ static-
|
|||||||
for f in static-production/**.*(br|gz); do
|
for f in static-production/**.*(br|gz); do
|
||||||
touch -r "${f%.*}" "$f"
|
touch -r "${f%.*}" "$f"
|
||||||
done
|
done
|
||||||
./generate-sitemap
|
changed="$(./generate-sitemap)"
|
||||||
xmllint --noblanks static-tmp/sitemap.xml --output static-tmp/sitemap.xml
|
xmllint --noblanks static-tmp/sitemap.xml --output static-tmp/sitemap.xml
|
||||||
brotli -f static-tmp/sitemap.xml
|
brotli -f static-tmp/sitemap.xml
|
||||||
zopfli static-tmp/sitemap.xml
|
zopfli static-tmp/sitemap.xml
|
||||||
@ -58,3 +58,7 @@ for server in ${servers[@]}; do
|
|||||||
echo active is now $target
|
echo active is now $target
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ -n "$changed" ]]; then
|
||||||
|
./indexnow <<< "$changed"
|
||||||
|
fi
|
||||||
|
@ -35,6 +35,7 @@ pages = [
|
|||||||
["/usage", 1.0]
|
["/usage", 1.0]
|
||||||
]
|
]
|
||||||
|
|
||||||
|
base_mtime = getmtime("static-tmp")
|
||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
for page in pages:
|
for page in pages:
|
||||||
@ -47,6 +48,8 @@ for page in pages:
|
|||||||
filepath += ".html"
|
filepath += ".html"
|
||||||
|
|
||||||
mtime = getmtime(filepath)
|
mtime = getmtime(filepath)
|
||||||
|
if mtime > base_mtime:
|
||||||
|
print(loc)
|
||||||
lastmod = datetime.fromtimestamp(mtime, timezone.utc).strftime("%Y-%m-%dT%H:%M:%S%:z")
|
lastmod = datetime.fromtimestamp(mtime, timezone.utc).strftime("%Y-%m-%dT%H:%M:%S%:z")
|
||||||
priority = page[1]
|
priority = page[1]
|
||||||
entries.append(f"""
|
entries.append(f"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user