-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
How to keep pages with .html suffix in eleventy output? #913
Comments
You can set the permalink: somepage.html Or, depending on your config, you might be able to use |
@pdehaan Thanks! I'd rather not add a front matter to each page. Is there such a setting for config? |
@ursbraem It's tricky to say without seeing your code. I have a few examples of dynamic permalinks in my GitHub repos, but probably nothing minimal. I can try putting something together, but it can sometimes be very specific to your folder structure. For example, I'll often use some src/pages/pages.11tydata.json file in my src/pages/ folder to set dynamic permalinks for all files in a folder instead of setting it on each template individually. https://www.11ty.dev/docs/data-template-dir/ |
Basic proof of concept at https://github.com/pdehaan/11ty-dynamic-permalink-test which shows using a "src/pages/pages.11tydata.json" file to set permalink structure for an entire directory of templates instead of needing to set it individually in each file's front matter. |
This works flawlessly, thanks! |
Interesting too |
ps @pdehaan I've added the solution to my stackoverflow question. If you want to add it from your side, please do so, I'll accept it then |
I am unable to get the vanilla permalink to work, even with the YAML method. I'm using the latest 0.10 version of 11ty. |
@Rangoli-Software can you post your template’s front matter of the permalink that isn’t working and I can take a look. |
I went back to what I was using before with EJS (which is a hack, but it works). permalink: "<%- page.inputPath.substring(1) %>" so I'm not actively looking to get this to work any more. |
If anyone reading this needs to keep the |
Hi!
I have an existing oldschool, pure html static site I want to retrofit with an SSG, and I chose eleventy and had a cool experience until now. But here's my first doubt:
The site's structure is as such:
As described on https://www.11ty.dev/docs/permalinks/#cool-uris-dont-change, eleventy will create:
But I don't want to change the (un)cool URIs I already have :-)
I understand I can add a .htaccess rewrite on the server to rewrite the URLs.
But isn't it possible to configure eleventy so it keeps the exact structure of the old site? I'd think so, but didn't find it in the docs yet.
PS: I posted the same question on SO https://stackoverflow.com/q/60119279/160968 but then I noticed that the github issues here might be the better place to ask.
The text was updated successfully, but these errors were encountered: