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

Added permalink time variables #3990

Merged
merged 1 commit into from Sep 24, 2015
Merged

Conversation

pheuko
Copy link
Contributor

@pheuko pheuko commented Sep 23, 2015

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?

@envygeeks
Copy link
Contributor

I'm just gonna say this is one of the most complete pull requests I've seen in a long time. 👍 and :shipit:

@pheuko
Copy link
Contributor Author

pheuko commented Sep 23, 2015

Thank you @envygeeks

@parkr
Copy link
Member

parkr commented Sep 23, 2015

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?

@jaybe-jekyll
Copy link
Member

This is nice. Thanks for disabling the regex capture of the added valid post name regex. ?: :)

@pheuko
Copy link
Contributor Author

pheuko commented Sep 23, 2015

Yes, custom time will be better. Hour, minute and second, right? I will change to this.

@pheuko
Copy link
Contributor Author

pheuko commented Sep 23, 2015

@jaybe-jekyll 👍

@parkr
Copy link
Member

parkr commented Sep 23, 2015

Yes, custom time will be better. Hour, minute and second, right? I will change to this.

Yes! :hour, :minute, :seconds and the corresponding tests & docs. You da 💣, thanks!

@parkr parkr added the pending-feedback We are waiting for more info. label Sep 23, 2015
@pheuko pheuko force-pushed the permalink-timestamp branch 2 times, most recently from 5f80fa7 to 260975f Compare September 23, 2015 21:54
@pheuko pheuko changed the title Added permalink timestamp variable Added permalink time variables Sep 23, 2015
@pheuko
Copy link
Contributor Author

pheuko commented Sep 23, 2015

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+)?)-(.*)(\.[^.]+)$/
Copy link
Member

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.

@parkr
Copy link
Member

parkr commented Sep 23, 2015

Change to the post filename is out of scope but everything else looks good. Please revert the MATCHER change and related docs/tests.

Thanks!

@pheuko
Copy link
Contributor Author

pheuko commented Sep 23, 2015

Ok

@pheuko
Copy link
Contributor Author

pheuko commented Sep 24, 2015

Reverting the MATCHER this PR becomes really simple. =)

@parkr
Copy link
Member

parkr commented Sep 24, 2015

:shipit:

envygeeks added a commit that referenced this pull request Sep 24, 2015
@envygeeks envygeeks merged commit e01c40f into jekyll:master Sep 24, 2015
@envygeeks
Copy link
Contributor

❤️

@envygeeks envygeeks removed the pending-feedback We are waiting for more info. label Sep 24, 2015
@Fastidious
Copy link

Was this implemented? Running jekyll 3.0.0.pre.beta9 and I am getting literal :hour:minute on the permalink, when using:

permalink: /:year:month:day:hour:minute

@parkr
Copy link
Member

parkr commented Sep 30, 2015

@Fastidious It's in master – i don't believe it made it to beta9.

@Fastidious
Copy link

@parkr a gem install jekyll Is giving me 2.5.3, how do I go about getting master with gem?

@envygeeks
Copy link
Contributor

@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.

@Fastidious
Copy link

@envygeeks how long it takes for the changes in master to make it to RubyGems?

@envygeeks
Copy link
Contributor

I'll ping @parkr and ask him to release.

@Fastidious
Copy link

@envygeeks was @parkr pinged?

@parkr
Copy link
Member

parkr commented Oct 23, 2015

@Fastidious
Copy link

@parkr, thanks!

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants