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

Why does Post title (file) should have the date ? #2282

Closed
Delaunay opened this Issue May 1, 2014 · 12 comments

Comments

Projects
None yet
7 participants
@Delaunay
Copy link

Delaunay commented May 1, 2014

Why does Post title (file) should start with a date ? 2014-04-27-mypost.md

The date is already defined in the header :
from 2014-04-27-mypost.md


---
layout: page
title:  "MyPost"
date:   2014-04-27 12:54:47
categories: apost

---

I feel like I put twice the information and the date in the filename is not even used (from what I saw). Moreover, a file that start with a date create super long filename and it is not really pretty.

@troyswanson

This comment has been minimized.

Copy link
Member

troyswanson commented May 1, 2014

You don't have to put date in the front-matter. The page.date value will come from the filename automatically.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented May 1, 2014

The idea for putting it in the title is to enforce the idea that posts are date-centric. It's part of jekyll's "blog-aware" features.

@parkr parkr closed this May 1, 2014

@agarrharr

This comment has been minimized.

Copy link

agarrharr commented Feb 22, 2015

I think it would be great if the date came from the front-matter instead, but could also come from the filename if you choose to name your file that way. The problem I run into, is that, when I save a draft, I don't know what date I will end up publishing it, so I end up having to rename the file right before I publish.

@kleinfreund

This comment has been minimized.

Copy link
Contributor

kleinfreund commented Feb 22, 2015

@aharris88 That said, one has to always name the file with a kinda made up time. When I write a post which I will publish right away, I need to do that as well. Plus, the time I put into the file name can’t be that actual publishing date, because I am pushing a bit later.

@agarrharr

This comment has been minimized.

Copy link

agarrharr commented Feb 22, 2015

I guess that's true, but I'm not talking about making up the time, I'm just
saying that it would be easier to change the date in the front-matter, than
by renaming the file.

@kleinfreund

This comment has been minimized.

Copy link
Contributor

kleinfreund commented Feb 22, 2015

So with this we can choose between having optional dates in the file name and optional dates in the front matter.

Optional dates in the file name:

  • Moving from drafts to published posts would be easier (good)
  • Files are not sorted in your project (bad)
  • Ultimately requires front matter in all posts (bad)

Optional dates in the front matter: (vice versa from the above)

@agarrharr

This comment has been minimized.

Copy link

agarrharr commented Feb 22, 2015

I think that's a good summary. It definitely would be completely optional if you want to keep using filenames. Although I disagree that having front-matter in all posts is bad. I already have front-matter in all my posts, so that's not a big deal to me.

@joelmccracken

This comment has been minimized.

Copy link

joelmccracken commented Mar 16, 2015

This one fact is the single most irritating thing about Jekyll for
me. I really hope this changes, someday.

I would def start investigating changing this, if others were into it.

@agarrharr

This comment has been minimized.

Copy link

agarrharr commented Mar 16, 2015

I agree. But issue #3578 would also fix my problem in some cases. In some cases, the only reason I don't want the date in the filename is because I'm using posts instead of pages so that they'll all be in one directory.

In other cases I don't want the date in the filename just because it's a hassle to name your files that way, and it's complicated to teach people to name their files that way.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Mar 16, 2015

Posts are just date-centric collection documents. What you're looking for is a collection.

@joelmccracken

This comment has been minimized.

Copy link

joelmccracken commented Mar 16, 2015

I never paid collections much attention, but this actually looks like
exactly what I wanted. Thanks!

On Mon, Mar 16, 2015 at 1:02 PM, Parker Moore notifications@github.com
wrote:

Posts are just date-centric collection documents. What you're looking for
is a collection.


Reply to this email directly or view it on GitHub
#2282 (comment).

@agarrharr

This comment has been minimized.

Copy link

agarrharr commented Mar 16, 2015

@parkr I agree with that. Posts are date-centric. Pages have to go in the correct location. And if you want to do it differently, use custom collections.

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