mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
pages -> list, instead of '/' delimited
This commit is contained in:
@@ -4,9 +4,9 @@ site_description: Project documentation with Markdown.
|
||||
|
||||
pages:
|
||||
- ['index.md', 'Introduction']
|
||||
- ['user-guide/writing-your-docs.md', 'User Guide / Writing your docs']
|
||||
- ['user-guide/styling-your-docs.md', 'User Guide / Styling your docs']
|
||||
- ['user-guide/configuration.md', 'User Guide / Configuration']
|
||||
- ['about/license.md', 'About / License']
|
||||
- ['user-guide/writing-your-docs.md', 'User Guide', 'Writing your docs']
|
||||
- ['user-guide/styling-your-docs.md', 'User Guide', 'Styling your docs']
|
||||
- ['user-guide/configuration.md', 'User Guide', 'Configuration']
|
||||
- ['about/license.md', 'About', 'License']
|
||||
|
||||
theme_dir: 'theme'
|
||||
|
||||
@@ -120,11 +120,21 @@ def _generate_site_navigation(pages_config, url_context, use_directory_urls=True
|
||||
pages = []
|
||||
previous = None
|
||||
|
||||
for path, title in pages_config:
|
||||
for config_line in pages_config:
|
||||
if len(config_line) == 2:
|
||||
path, title = config_line
|
||||
child_title = None
|
||||
elif len(config_line) == 3:
|
||||
path, title, child_title = config_line
|
||||
else:
|
||||
msg = (
|
||||
"Line in 'page' config contained %d items. "
|
||||
"Expected 2 or 3." % len(config_line)
|
||||
)
|
||||
assert False, msg
|
||||
|
||||
url = utils.get_url_path(path, use_directory_urls)
|
||||
title, sep, child_title = title.partition('/')
|
||||
title = title.strip()
|
||||
child_title = child_title.strip()
|
||||
|
||||
if not child_title:
|
||||
# New top level page.
|
||||
page = Page(title=title, url=url, path=path, url_context=url_context)
|
||||
|
||||
Reference in New Issue
Block a user