Revert to manually defining the Pages so we can order them

This commit is contained in:
Dougal Matthews
2015-06-11 10:01:32 +01:00
parent 3f89332156
commit 77216f4c7e
3 changed files with 20 additions and 5 deletions

View File

@@ -4,10 +4,22 @@ site_description: Project documentation with Markdown.
repo_url: https://github.com/mkdocs/mkdocs/
pages:
- Home: index.md
- User Guide:
- Writing Your Docs: user-guide/writing-your-docs.md
- Styling Your Docs: user-guide/styling-your-docs.md
- Configuration: user-guide/configuration.md
- Deploying your docs: user-guide/deploying-your-docs.md
- About:
- Release Notes: about/release-notes.md
- Contributing: about/contributing.md
- License: about/license.md
markdown_extensions:
- toc:
permalink: ""
permalink:
- admonition:
copyright: Copyright &copy; 2014, <a href="https://twitter.com/_tomchristie">Tom Christie</a>. Maintenance and development by <a href="http://www.dougalmatthews.com/">Dougal Matthews</a>
copyright: Copyright &copy; 2014 <a href="https://twitter.com/_tomchristie">Tom Christie</a>, <a href="http://www.dougalmatthews.com/">Dougal Matthews</a>.
google_analytics: ['UA-27795084-5', 'mkdocs.org']

View File

@@ -35,8 +35,11 @@ tutorial/install.md | tutorial/install/ | ../img/initial-layout.png |
tutorial/intro.md | tutorial/intro/ | ../../img/initial-layout.png |
"""
from __future__ import unicode_literals
import logging
import os
from markdown.extensions import Extension
from markdown.treeprocessors import Treeprocessor
@@ -69,7 +72,7 @@ def path_to_url(url, nav, strict):
# the internal hyperlink, making sure the target actually exists.
target_file = nav.file_context.make_absolute(path)
if target_file.startswith('/'):
if target_file.startswith(os.path.sep):
target_file = target_file[1:]
if target_file not in nav.source_files:

View File

@@ -345,12 +345,12 @@ class BuildTests(unittest.TestCase):
def test_absolute_link(self):
pages = [
'index.md',
'sub/index.md',
]
site_nav = nav.SiteNavigation(pages)
markdown = "[test](/index.md)"
markdown = "[test 1](/index.md) [test 2](/sub/index.md)"
cfg = load_config({'strict': True})
build.convert_markdown(markdown, cfg, site_nav)
def test_extension_config(self):