mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Improved resilience of search plugin
This commit is contained in:
parent
57cf39149b
commit
15f15068d9
@ -164,7 +164,7 @@ class SearchIndex:
|
||||
|
||||
# Add page to search index
|
||||
def add_entry_from_context(self, page):
|
||||
search = page.meta.get("search", {})
|
||||
search = page.meta.get("search") or {}
|
||||
if search.get("exclude"):
|
||||
return
|
||||
|
||||
@ -218,7 +218,7 @@ class SearchIndex:
|
||||
entry["tags"].append(name)
|
||||
|
||||
# Set document boost
|
||||
search = page.meta.get("search", {})
|
||||
search = page.meta.get("search") or {}
|
||||
if "boost" in search:
|
||||
entry["boost"] = search["boost"]
|
||||
|
||||
|
@ -164,7 +164,7 @@ class SearchIndex:
|
||||
|
||||
# Add page to search index
|
||||
def add_entry_from_context(self, page):
|
||||
search = page.meta.get("search", {})
|
||||
search = page.meta.get("search") or {}
|
||||
if search.get("exclude"):
|
||||
return
|
||||
|
||||
@ -218,7 +218,7 @@ class SearchIndex:
|
||||
entry["tags"].append(name)
|
||||
|
||||
# Set document boost
|
||||
search = page.meta.get("search", {})
|
||||
search = page.meta.get("search") or {}
|
||||
if "boost" in search:
|
||||
entry["boost"] = search["boost"]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user