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
Added permalink time variables #3990
Conversation
I'm just gonna say this is one of the most complete pull requests I've seen in a long time. 👍 and |
Thank you @envygeeks |
Nice work, @pheuko! People might want to customize this, though, which I would prefer we avoid. Would it be better to just add the three levels of time and support that? |
This is nice. Thanks for disabling the regex capture of the added valid post name regex. |
Yes, custom time will be better. Hour, minute and second, right? I will change to this. |
Yes! |
5f80fa7
to
260975f
Compare
I just updated my PR with time variables and created an example about the timestamp permalink. Surely is much more customizable, please check if it is ok. |
@@ -4,7 +4,7 @@ class Post | |||
include Convertible | |||
|
|||
# Valid post name regex. | |||
MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/ | |||
MATCHER = /^(.+\/)*(\d+-\d+-\d+(?:.\d+:\d+:\d+)?)-(.*)(\.[^.]+)$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good plan – this should be specified in the date
front matter attribute. Please revert this and use the calculated date from the post's front matter.
Change to the post filename is out of scope but everything else looks good. Please revert the Thanks! |
Ok |
260975f
to
22b59ae
Compare
Reverting the MATCHER this PR becomes really simple. =) |
Added permalink time variables
❤️ |
Was this implemented? Running
|
@Fastidious It's in |
@parkr a |
@Fastidious you can't gem install master, you either need to use our master docker image or you need to use a Gemfile and tell it to pull github source and install it. |
@envygeeks how long it takes for the changes in master to make it to RubyGems? |
I'll ping @parkr and ask him to release. |
@envygeeks was @parkr pinged? |
@parkr, thanks! |
This is the solution that I thought for issue #3978.
You just need to configure your permalink with the new timestamp variable and put the time in the document's filename.
You can also override the date via the document's YAML front matter but don't forget about your environment timezone.
Is this what you were talking about?