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

Add an option to nikola new_post to create yyyy/mm/dd directory structures #2513

Closed
Kwpolska opened this issue Sep 26, 2016 · 4 comments
Closed

Comments

@Kwpolska
Copy link
Member

A lot of people want to have a yyyy/mm/dd/slug directory structure. So, let’s make it an option somewhere in nikola new_post (that can be also set as enabled by default in conf.py) to automatically create that directory tree for them.

Then there’s Jekyll-esque “replace dashes with slashes”, but that’s a story for another time.

@dubwhale
Copy link

If it could also allow custom URL structures that would be great. Currently have had to hack the post.py file in order to set the:

self.folder = <my custom folder structure>

I guess a conf format token string would work "Y/M/D" for your case, but relying purely on pre-defined tokens means if someone wants something that is possibel with tokens they cannot.

There any reason why a signal task couldn't be added 'folder_structure'?

@Kwpolska
Copy link
Member Author

Uh, what do you mean? Do you know you can do something like posts/something/or/other.rst and end up with output/posts/something/or/other/? If that’s not it, please clarify.

@adarshdec23
Copy link
Contributor

When you say yyyy/mm/dd/slug, does this mean output/yyyy/mm/dd/slug or output/posts/yyyy/mm/dd/slug?

@Kwpolska
Copy link
Member Author

Depends on your POSTS config…

@Kwpolska Kwpolska self-assigned this Jan 7, 2017
Kwpolska added a commit that referenced this issue Jan 7, 2017
adarshdec23 pushed a commit to adarshdec23/nikola that referenced this issue Jan 7, 2017
Available as:

nikola new_post -d
nikola new_post --date-path
NEW_POST_DATE_PATH in conf.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants