getzola / zola

A fast static site generator in a single binary with everything built-in. https://www.getzola.org
https://www.getzola.org
MIT License
13.54k stars 946 forks source link

Remove full RFC3339 datetime file prefix #874

Open Keats opened 4 years ago

Keats commented 4 years ago

It doesn't work on Windows due to : in it and Zola tries to be cross-platform so it should only allows YYYY-MM-DD in the filename. If you want the time, you can set it in the front-matter.

thxo commented 4 years ago

If you don't feel strongly about adhering to the RFC strictly, perhaps another way out is to just allow another character other than : in the regex.

Keats commented 4 years ago

I'm a bit reluctant to change the character since the front-matter would still use the RFC format which would be confusing I think.

thxo commented 4 years ago

It doesn't have to be a breaking change - I suppose just allowing another alternative would help, e.g.: (:|!).

It's not proper RFC3339 but I suppose it prevents breaking the functionality for folks already using it.

kiyanmair commented 3 years ago

I don't think it makes sense to change the character. Not only would it be confusing, but that simply moves the decision to be cross-platform onto the user because users would still be able to use the non-cross-platform RFC 3339 format.

If this change is motivated by the value that Zola should be cross-platform, then I think the only options should be allowing the RFC 3339 format (and breaking this value) or not (and breaking functionality). Windows users who want an alternative to the current functionality can just set the time in the front-matter anyway.

I don't feel strongly about whether the RFC 3339 format should be kept or removed, but I think that if it's removed, there should be good error messages indicating why the build is failing.

Abdillah commented 3 years ago

It doesn't work on Windows due to : in it and Zola tries to be cross-platform so it should only allows YYYY-MM-DD in the filename. If you want the time, you can set it in the front-matter.

Regarding that, is it reasonable to make date front-matter receive time only format as to avoid specifying date twice? Or somehow add time field or maybe datetime field..

Raymi306 commented 1 year ago

Could someone clarify the issue a bit?

Looking through the codebase at the RFC3339 stuff in content/page, it seems like you have to choose to name a file with this scheme. Are we looking to have this fail at the build step if they do name a file this way so if someone git clones on a Window's machine the file names are all allowed..?

Sorry just a bit confused, if I understand better I have some free time and might be able to make a PR

Keats commented 1 year ago

Looking through the codebase at the RFC3339 stuff in content/page, it seems like you have to choose to name a file with this scheme. Are we looking to have this fail at the build step if they do name a file this way so if someone git clones on a Window's machine the file names are all allowed..?

Yes exactly. Although no one really complained about that in 4 years so maybe it's not an issue in practice. Most people don't use time in the filenames I guess?

Raymi306 commented 1 year ago

Perhaps it would be more valuable to have a warning for invalid file names from any file?

Keats commented 1 year ago

I think warnings are not great here, we would need a way to disable those and if no one complained yet maybe it's ok. I think let's leave this issue open, i've switched the tags to better represent the status