forked from mirrors/thatmattlove-hyperglass
fix SEO keyword handling
This commit is contained in:
parent
cabc6aebb1
commit
744278035d
1 changed files with 14 additions and 0 deletions
|
|
@ -202,15 +202,28 @@ try:
|
|||
params.web.text.subtitle = params.web.text.subtitle.format(
|
||||
**params.dict(exclude={"web", "queries", "messages"})
|
||||
)
|
||||
|
||||
# Automatically derive the cache timeout period term
|
||||
# (minutes, seconds) based on the cache timeout value.
|
||||
if params.cache.timeout >= 60:
|
||||
_cache_timeout = math.ceil(params.cache.timeout / 60)
|
||||
_cache_period = "minutes"
|
||||
elif params.cache.timeout < 60:
|
||||
_cache_timeout = params.cache.timeout
|
||||
_cache_period = "seconds"
|
||||
|
||||
# Format the cache display text to match the real values.
|
||||
params.web.text.cache = params.web.text.cache.format(
|
||||
timeout=_cache_timeout, period=_cache_period
|
||||
)
|
||||
|
||||
# If keywords are unmodified (default), add the org name &
|
||||
# site_title.
|
||||
if _params.Params().site_keywords == params.site_keywords:
|
||||
params.site_keywords = sorted(
|
||||
{*params.site_keywords, params.org_name, params.site_title}
|
||||
)
|
||||
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
|
|
@ -455,6 +468,7 @@ _frontend_fields = {
|
|||
"org_name": ...,
|
||||
"google_analytics": ...,
|
||||
"site_description": ...,
|
||||
"site_keywords": ...,
|
||||
"web": ...,
|
||||
"messages": ...,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue