Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrange entry "templates" is invalid #25

Closed
connerxyz opened this issue Sep 11, 2020 · 10 comments
Closed

Arrange entry "templates" is invalid #25

connerxyz opened this issue Sep 11, 2020 · 10 comments

Comments

@connerxyz
Copy link

I have a portion of my site I'd like to use to document templates (things we create as part of our project not anything to do with MkDocs itself).

The site build breaks when I list 'templates' under arrange in the docs/.pages file.

arrange:
    - index.md
    - ...
    - templates
INFO    -  Cleaning site directory
--
243 | INFO    -  Building documentation to directory: /codebuild/...
244 | Traceback (most recent call last):
245 | File "/codebuild/.../mkdocs_awesome_pages_plugin/navigation.py", line 72, in _arrange_items
246 | return arrange(items, meta.arrange, lambda item: basename(self._get_item_path(item)))
247 | File "/codebuild/.../mkdocs_awesome_pages_plugin/arrange.py", line 29, in arrange
248 | raise InvalidArrangeEntry(entry)
249 | mkdocs_awesome_pages_plugin.arrange.InvalidArrangeEntry: Arrange entry "templates" is invalid.

Is this "invalid" because it's conflicting with potential MkDocs templates? Is there a workaround?

@lukasgeiter
Copy link
Owner

The arrange option only works with entries that are known to MkDocs and appear in the navigation. Since templates doesn't have to do anything with MkDocs, maybe you can just omit it from the pages file?

@connerxyz
Copy link
Author

connerxyz commented Sep 14, 2020

The site needs to have a templates section, so I can't just omit it from pages file.

That templates section is listed, just like the other sections, but the site won't build when there's a section called "templates".

I'm trying to figure out how I can have a templates section in the site.

arrange:
    - index.md
    - ...
    - services      # works fine
    - templates   # breaks build

@lukasgeiter
Copy link
Owner

The arrange option does not allow you to add entries to the MkDocs navigation, it can merely change their order.

I'm planning to implement a more powerful version of the feature in the future and I'll take this requirement in consideration.

@lukasgeiter lukasgeiter added the enhancement New feature or request label Sep 14, 2020
@connerxyz
Copy link
Author

But it works if I use "templates+" and not when I use "templates"... I'm not sure we are talking about the same thing. I'm digging through the plugin source right now.

@lukasgeiter
Copy link
Owner

Hmm that's interesting. Could you provide me with a minimal example to reproduce the problem?

@connerxyz
Copy link
Author

@connerxyz
Copy link
Author

And then here's the working version. https://github.com/connerxyz/templates-issue-example/tree/working-version

@connerxyz
Copy link
Author

It's like MkDocs removes docs/templates directory before building.

@connerxyz
Copy link
Author

Possibly related #25

@lukasgeiter lukasgeiter removed the enhancement New feature or request label Sep 14, 2020
@lukasgeiter
Copy link
Owner

Thanks for the example. We were indeed not talking about the same thing. I thought that your templates directory didn't contain any markdown files...

As you have seem to figured out by now as well, MkDocs is not including docs/templates when building. Why that is I don't know. I just know that it is unrelated to this plugin, therefore I'll close the issue. Let's see what comes out of issue mkdocs/mkdocs#2185...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants