deduplicate TITLE_SUFFIX from new DOMAIN_NAME
I will need the domain name for feed stuff, and I'm already crudely using the title suffix in the nav as if it was a domain name, so let's just be explicit in the case I ever change my mind on domain-in-title styling Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
parent
680a2bc764
commit
5a9a36f463
|
@ -61,7 +61,8 @@ class Config(object):
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_PAGE_STYLE = 'light'
|
DEFAULT_PAGE_STYLE = 'light'
|
||||||
TITLE_SUFFIX = 'example.com'
|
DOMAIN_NAME = 'example.com'
|
||||||
|
TITLE_SUFFIX = DOMAIN_NAME
|
||||||
CONTACT_EMAIL = 'admin@example.com'
|
CONTACT_EMAIL = 'admin@example.com'
|
||||||
|
|
||||||
# specify FAVICON in your instance config.py to override the provided icon
|
# specify FAVICON in your instance config.py to override the provided icon
|
||||||
|
|
|
@ -168,8 +168,8 @@ def instance_resource_path_to_request_path(path):
|
||||||
def generate_parent_navs(path):
|
def generate_parent_navs(path):
|
||||||
"""Create a series of paths/links to navigate up from the given resource path."""
|
"""Create a series of paths/links to navigate up from the given resource path."""
|
||||||
if path == 'pages/index.md':
|
if path == 'pages/index.md':
|
||||||
# bail and return the title suffix (generally the domain name) as a terminal case
|
# bail and return the domain name as a terminal case
|
||||||
return [(app.config['TITLE_SUFFIX'], '/')]
|
return [(app.config['DOMAIN_NAME'], '/')]
|
||||||
else:
|
else:
|
||||||
if path.endswith('index.md'):
|
if path.endswith('index.md'):
|
||||||
# index case: one dirname for foo/bar/index.md -> foo/bar, one for foo/bar -> foo
|
# index case: one dirname for foo/bar/index.md -> foo/bar, one for foo/bar -> foo
|
||||||
|
|
Loading…
Reference in New Issue