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

Nested directories in _posts #191

Open
evert opened this issue Jan 10, 2015 · 5 comments
Open

Nested directories in _posts #191

evert opened this issue Jan 10, 2015 · 5 comments

Comments

@evert
Copy link
Contributor

evert commented Jan 10, 2015

Now the new year came around, I would like reorganize my blogposts in 1 folder per year.

Before, all my posts were clumped together in one _posts directory, so the new layout would iook like:

_posts/2014/2014-01-01-happy-new-year.md

However, moving all these markdown files in their new directory, caused the permalink generation to fail.
Before, these looked like:

http://sabre.io/blog/2014/sabre-dav-2.1.2-released

But now they've become:

http://sabre.io/blog/2014/12-10-sabre-dav-2.1.2-released

Our configuration:

sculpin_content_types:
    clients:
        type: meta
        meta: client
        layout: default
        permalink: pretty
    plugins:
        type: meta
        meta: plugin
        layout: default
        permalink: pretty
    posts:
        layout: post
        path: _posts
        permalink: blog/:year/:filename/

I know this worked fine with Jekkyl. Is there anything I can do to fix this?

@simensen
Copy link
Member

@evert I'll see if I can take a look at this sometime this week. Would you mind looking over what you wrote here to make sure that everything is 100% what you describe? Are the files still named 2014-* or are the new files named w/o the 2014-* prefix?

If they still have the 2014-* prefix, it seems weird that Sculpin is generating those permalinks. If the files no longer have the 2014-* prefix I think that probably makes sense and I think I'd know how to fix that.

Long story short, the work that the permalink factory does to determine the data from the filename is probably only looking at the basename. It probably does not know how to handle MM-DD-* in the basename "as a date." We can probably alter that some such that if a basename starts with [\d]- it will look for dirname for the rest of the dat components.

Get back to me with confirmation on the problem being as you described it, whether the filenames changed, and if it sounds like I'm understanding the problem correctly.

Thanks!

@evert
Copy link
Contributor Author

evert commented Jan 12, 2015

Hi @simensen ,

The 2014- is indeed still part of the original filename. All I did was:

mkdir 2014
mv *.md 2014/

@carbontwelve
Copy link

@simensen did this get fixed in the end?

@simensen
Copy link
Member

@carbontwelve No, I have not had time to look into this yet. :-/ Maybe someone else on the team can take a look if they have a chance?

@ghost
Copy link

ghost commented Apr 23, 2017

Hi,

I've add #347 to try and tackle this.

I'm new to PHP so feedback appreciated.

Thanks.

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

No branches or pull requests

3 participants