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

Improve title logic for new post/my-post/index.md etc. #4348

Closed
regisphilibert opened this issue Jan 28, 2018 · 5 comments
Closed

Improve title logic for new post/my-post/index.md etc. #4348

regisphilibert opened this issue Jan 28, 2018 · 5 comments

Comments

@regisphilibert
Copy link
Member

regisphilibert commented Jan 28, 2018

Page Resources may prompt user to systematically create Page Bundles for all of their pages, or not.

For now, you have to hit
$ new post/my-post/index.md which will create a mardown with the following Front Matter

title: "Index"
date: 2018-01-28T13:00:17-05:00
draft: true

Not only user has to include index.md himself in the path, but will have to rename the default titlewrongly assumed as "Index"

A simple flag called --bundle or other could save many seconds to content creation and result in a simpler:
$ new post/my-post --bundle

@regisphilibert regisphilibert changed the title Add --bundle flag to Hugo cli new command Add --bundle flag to Hugo cli *new* command Jan 28, 2018
@regisphilibert regisphilibert changed the title Add --bundle flag to Hugo cli *new* command Add --bundle flag to Hugo cli "new" command Jan 28, 2018
@bep
Copy link
Member

bep commented Jan 28, 2018

I would instead suggest just adding some title logic: "if index then use folder name".

@bep bep changed the title Add --bundle flag to Hugo cli "new" command Improve title logic for new post/my-post/index.md etc. Jan 28, 2018
@bep bep closed this as completed in 863a812 Jan 28, 2018
@regisphilibert
Copy link
Member Author

It can work but I still don’t like the logic here: User systematically having to add /index.md after its page path/name

Hugo new’s point is to create proper Hugo content files without the user having to bother too much.

@bep
Copy link
Member

bep commented Jan 28, 2018

Your solution does not really work when you add languages and markdown types to the mix. Adding CLI flags for everything already encoded into the filename is not something I want to maintain.

@regisphilibert
Copy link
Member Author

Yes I didn’t take enough parameters into account. Of course it makes sense.

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants