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

jekyll import: Extract post title from filename #3390

Closed
cboettig opened this issue Apr 25, 2017 · 3 comments
Closed

jekyll import: Extract post title from filename #3390

cboettig opened this issue Apr 25, 2017 · 3 comments

Comments

@cboettig
Copy link

One of the great features of hugo import jekyll is that it extracts the post date from the filename if it is not already given in the post metadata (a convenient & commonly used Jekyll feature, see #285), and adds it in as explicit metadata in the post header so Hugo can see the date. Likewise, Jekyll defaults to use a title for a post also from the filename (e.g. 2017-04-21-this-is-the-title.md becomes title: "This is the title" in a yaml header). It would thus seem that hugo import jekyll should likewise be parsing the title string from the filename if it is not given in the metadata, as it already does for the date. This would streamline importing from Jekyll.

Perhaps it should be a separate issue, but given Hugo's nicely content-driven layout, this behavior of using the post filename to indicate the title would be a nice option to add (configurable in config.toml, analogous to what 902ac96 already adds for dates with the useFilenameDateAsFallback option.

@bep bep changed the title hugo import jekyll does not extract post title from filename jekyll import: Extract post title from filename Apr 26, 2017
@bep bep added the HelpWanted label Apr 26, 2017
@vanadium23
Copy link

I was checking code to implement this feature, but last master already implements it:
https://github.com/spf13/hugo/blob/master/commands/import_jekyll.go#L368
https://github.com/spf13/hugo/blob/master/commands/import_jekyll_test.go#L29

Guess this issue can be closed.

@bep bep closed this as completed May 13, 2017
@cboettig
Copy link
Author

cboettig commented Jul 7, 2017

@vanadium23 hmm, using the v24.1 release to import from jekyll I'm still not getting post titles imported and added to the post yaml headers... importing dates from the file name works fine.

@github-actions
Copy link

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 17, 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

3 participants