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
Extracting date and slug from filename #560
Conversation
Thanks @yegle for your work on this. Here are my comments:
and for the slug, I now understand the reason why you introduced the |
The reason of It's fine to add e.g. how should we parse
Neither way is a good solution from my point of view. |
On 27 October 2012 00:01, Yuchen Ying notifications@github.com wrote:
|
Different things:
|
On 28 October 2012 23:59, Alexis Metaireau notifications@github.com wrote:
yes, +1
Do you really want to fallback on different date formats? I thought that
I would say: the metadata wins against the filename. (going this way,
|
I'm thinking about the performance of regexps, and how this addition would make the generation slower |
I don't think parsing filenames (would rarely be more than 50 chars long) with a regexp will introduce a noticeable performance penalty. |
Well, it depends the number of files we proceed, it will slow down things, but I don't know by how much. I'm concerned by this since the performance of pelican when generating dropped a bit with 3.0, so I would like to take care of this, hence my concerns, but that doesn't mean it's a no-go. Let's do this :-) |
I'm interested in this feature too, as I name my post files How about using special values in the file to tell Pelican to use the filename ? Something like:
We could toss in an extra special value to get the date from the file timestamp, e.g.:
|
I think that's better to directly tell pelican where to look for in the settings. having date: sounds weird to me, isn't it? timestamp fro the FS will be removed as it's not a good value to rely on (it's changed if we move the file for instance). |
On 5 November 2012 21:02, Alexis Metaireau notifications@github.com wrote:
If possible, I'd rather not to introduce a new setting for that: I think it
|
Having the slug available from the filename, aside from anything else, would be a great help for those importing their blog to keep the same URLs with ease (eg the importer creates file names based upon their Wordpress post_name). |
@yegle are you still working on this one? |
@bbinet So our conclusion is:
If it's correct, I can update my pull request today. |
On 13 November 2012 22:59, Yuchen Ying notifications@github.com wrote:
@ametaireau do you agree on this before @yegle updates this pr?
|
Yep, that's perfectly fine for me, go ahead! |
This is a quick fix for issue #552
Depending on
DEFAULT_DATE="filename"
andDEFAULT_SLUG="filename"