diff --git a/Makefile b/Makefile index 4251cdc..aa1009d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: help bump publish -VERSION = 1.9.12 +VERSION = 1.9.15 help: @perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/base/wagtail_hooks.py b/base/wagtail_hooks.py index 135e5e2..84e328b 100644 --- a/base/wagtail_hooks.py +++ b/base/wagtail_hooks.py @@ -5,6 +5,8 @@ from urllib.parse import urlparse from base.indexnow import get_key import requests +from blog.models import BlogPage + @hooks.register('after_publish_page') def after_publish_page(request, page): @@ -14,6 +16,9 @@ def after_publish_page(request, page): if urlparse(page_url).hostname == "localhost": print("not notifying indexnow for localhost" + get_key() + ", page url: " + page_url) return + if urlparse(page_url).path.endswith("--priv") or urlparse(page_url).path.endswith("--priv/"): + print("not notifying indexnow for blog page --priv") + return session = requests.Session() session.post( "https://api.indexnow.org/indexnow",