-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
changed page url generation #95
Conversation
Looks good. I’m wondering how should be the |
@valtlai Good question. I have some ideas:
The url:
path: /about-me/
pretty: true thoughts? |
I like this approach. Most of the time, a string will be enough, but an object allows disabling the slugifier when needed. And with an object, we can have the variable I think your example should produce If there wasn’t a trailing slash in your example and |
Fair. |
But a string would still work as you described in the first comment, right? |
Yes. Strings would work like in the first comment. |
Okay, that’s nice. 🙂 |
@valtlai After a second thought, I've changed my mind about the possibility to define an url as an object and your idea of using the trailing slash to detect if the url is a pretty-html or a extension-less filename is better.
One of my goals with lume is building something easy to use and with predictable behavior, and the url variable that accepts so many formats (function, string, object) and different behaviors is far from being that.
With this change, the url can be defined using a function or a string:
/about-me
Generates a/about-me
file (without extension)/about-me/
Generates a/about-me/index.html
file/about-me.html
Generates a/about-me.html
fileprettyUrls
setting is used only if the page has not the url variable.slugifyUrls
is used everywhere.