commit
						a885ceaa78
					
				|  | @ -1,7 +0,0 @@ | |||
| site_name: 'test' | ||||
| site_description: 'This is a subdomain site.' | ||||
| 
 | ||||
| plugins: | ||||
|   - monorepo | ||||
| 
 | ||||
| docs_dir: docs | ||||
|  | @ -0,0 +1,3 @@ | |||
| # Hello world! | ||||
| 
 | ||||
| This contains a sentence which only exists in the ok/project-a fixture. | ||||
|  | @ -0,0 +1,5 @@ | |||
| site_name: "test" | ||||
| site_description: "This is a subdomain site." | ||||
| 
 | ||||
| plugins: | ||||
|   - monorepo | ||||
|  | @ -103,6 +103,13 @@ teardown() { | |||
|   [[ "$output" == *"This contains a sentence which only exists in the ok/project-a fixture."* ]] | ||||
| } | ||||
| 
 | ||||
| @test "builds a mkdocs site with no nav and no docs_dir key" { | ||||
|   cd ${fixturesDir}/ok-no-nav-no-dir | ||||
|   assertSuccessMkdocs build | ||||
|   assertFileExists site/test/index.html | ||||
|   [[ "$output" == *"This contains a sentence which only exists in the ok/project-a fixture."* ]] | ||||
| } | ||||
| 
 | ||||
| @test "builds a mkdocs site with yaml extension" { | ||||
|   cd ${fixturesDir}/ok-yaml-not-yml | ||||
|   assertSuccessMkdocs build | ||||
|  | @ -227,12 +234,6 @@ teardown() { | |||
|   [[ "$output" == *"[mkdocs-monorepo] The /"*"/__tests__/integration/fixtures/error-include-path-no-docs-folder/project-a/docs path is not valid. Please update your 'nav' with a valid path."* ]] | ||||
| } | ||||
| 
 | ||||
| @test "fails if !include path docs_dir does not contain any files" { | ||||
|   cd ${fixturesDir}/error-no-nav-no-docs | ||||
|   assertFailedMkdocs build | ||||
|   [[ "$output" == *"[mkdocs-monorepo] The file path /"*"/__tests__/integration/fixtures/error-no-nav-no-docs/project-a/mkdocs.yml does not contain a valid 'nav' key in the YAML file. Please include it to indicate how your documentation should be presented in the navigation, or include a 'docs_dir' to indicate that automatic nav generation should be used."* ]] | ||||
| } | ||||
| 
 | ||||
| @test "fails if absolute links aren't supported" { | ||||
|   cd ${fixturesDir}/include-path-absolute-url | ||||
|   assertSuccessMkdocs build | ||||
|  |  | |||
|  | @ -185,8 +185,9 @@ class IncludeNavLoader: | |||
| 
 | ||||
|             # This will check if there is a `docs_dir` property on the `mkdocs.yml` file of | ||||
|             # the sub folder and scaffold the `nav` property from it | ||||
|             if self.navYaml and 'nav' not in self.navYaml and "docs_dir" in self.navYaml: | ||||
|                 docsDirPath = os.path.join(os.path.dirname(self.absNavPath), self.navYaml["docs_dir"]) | ||||
|             if self.navYaml and 'nav' not in self.navYaml: | ||||
|                 docsDir = self.navYaml.get("docs_dir", "docs") | ||||
|                 docsDirPath = os.path.join(os.path.dirname(self.absNavPath), docsDir) | ||||
| 
 | ||||
|                 def navFromDir(path): | ||||
|                     directory = {} | ||||
|  | @ -242,8 +243,9 @@ class IncludeNavLoader: | |||
|         if self.navYaml and 'nav' not in self.navYaml: | ||||
|             log.critical( | ||||
|                 "[mkdocs-monorepo] The file path {} ".format(self.absNavPath) + | ||||
|                 "does not contain a valid 'nav' key in the YAML file. " + | ||||
|                 "Please include it to indicate how your documentation should be presented in the navigation, " + | ||||
|                 "does not contain a valid 'nav' key in the YAML file " + | ||||
|                 "and the docs folder is not the default one, i.e. `docs`. " + | ||||
|                 "Please include the `nav` key to indicate how your documentation should be presented in the navigation, " + | ||||
|                 "or include a 'docs_dir' to indicate that automatic nav generation should be used." | ||||
|             ) | ||||
|             raise SystemExit(1) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue