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

Liquid date filter #115

Merged
merged 1 commit into from
Jun 13, 2016
Merged

Liquid date filter #115

merged 1 commit into from
Jun 13, 2016

Conversation

kstep
Copy link
Contributor

@kstep kstep commented Jun 12, 2016

The PR contains one feature and one fix. I can split it up into two PRs if you like, but I feel like the fix is too small for a separate PR.

The feature is a new date filter so that one can do post.date | date:"%d/%m/%y" in liquid templates (example usage: https://github.com/kstep/kstep.github.com/blob/master/src/index.liquid#L17). Although it seems like liquid parser contains another bug: it doesn't parse filter arguments correctly, so I can't use spaces in the date filter arguments (I worked it around by using   entity instead).

The fix is the incorrect YAML header splitting from markdown files. It splits files by all instances of --- separator, while it should use the first one only. The fix is pretty obvious and self-explanatory.


This change is Reviewable

@johannhof
Copy link
Contributor

Hi there! Thank you for helping out! The date filter is actually part of the default set of filters in Liquid, we're just missing it in liquid-rust right now. It would be great if you could open another PR against https://github.com/cobalt-org/liquid-rust/, see also cobalt-org/liquid-rust#11

Please remove the date filter from this PR as well, so that we can merge the small fix.

As for the filter parsing issue, can you please open an issue in liquid-rust with a really small example of what does not work?

Thanks 👍

@kstep
Copy link
Contributor Author

kstep commented Jun 13, 2016

Ok, I removed the commit with the date filter. I will prepare an example for the bug and post a bug report later today. As for the date filter, I need it now, so I will keep on using my branch of cobalt for my blog. I will repeat the filter implementation for liquid repo later this week.

@kstep
Copy link
Contributor Author

kstep commented Jun 13, 2016

See cobalt-org/liquid-rust#41 for the bug report.

@kstep
Copy link
Contributor Author

kstep commented Jun 13, 2016

See cobalt-org/liquid-rust#42 for date filter implementation in liquid source tree.

@johannhof
Copy link
Contributor

👍

@johannhof johannhof merged commit d716eda into cobalt-org:master Jun 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants