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

Allow directory names with dot and file names without extension #344

Open
uranusjr opened this issue Jan 9, 2017 · 2 comments · May be fixed by #811
Open

Allow directory names with dot and file names without extension #344

uranusjr opened this issue Jan 9, 2017 · 2 comments · May be fixed by #811

Comments

@uranusjr
Copy link
Contributor

uranusjr commented Jan 9, 2017

While migrating an existing site to Lektor I find myself looking for this. My use case is building a release note page, and using the build numbers as slug. So I would have paths like this

  • /release/521/
  • /release/532/
  • /release/535.1 (!)

Although everything “works”, this is really inconsistent.

Proposal: Add a new system boolean field _leaf that forces the page to be built into a file (yes) or directory (no). The current heuristic is used if the field is not present in contents.lr.

I’m not sure whether this is the best solution toward the problem; if this sounds like a good solution I can create a PR for this.

@krzysztof-sikorski
Copy link

IMHO if such field is added, it would be better to define it as an enum field - yes or no forces the build format, while default value of auto uses heuristics to guess.

@xlotlu
Copy link
Contributor

xlotlu commented Aug 23, 2020

I propose that besides this flag, the "auto"-case heuristic should only consider a limited list of extensions to actually be files (e.g. text/* stuff and maybe some application/* mime-types known to be plain-text).

betaveros added a commit to betaveros/lektor that referenced this issue Sep 5, 2020
Slug styles specify how slugs are turned into file and directory names
in the URL path. This is roughly based off the design in
lektor#809 (comment).

As is, this PR fixes lektor#344 and deals with the tricky "global" part of
doing lektor#809 properly. It also enables pages with dots in their slugs to
be paginated and fixes some issues with the dev server resolving
descendants of such pages incorrectly. It is still a prototype, though
(I have only done some casual manual testing and yet to write any
tests).

In addition to a sitewide default setting and per-page setting, we would
likely also want datamodels to be able to specify the slug style of
their pages and/or their child pages. To stay similar to the current way
`slug_format` can be configured, it seems we should also allow
datamodels to specify the slug styles of their children, but as
mentioend in lektor#806 that behavior is a little strange and worth
reconsidering, so this PR doesn't try to implement any such behavior.
@betaveros betaveros linked a pull request Sep 5, 2020 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants