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

hugo import jekyll fails for jekyll projects with nested _posts directories #1890

Closed
davepeck opened this issue Feb 24, 2016 · 10 comments
Closed

Comments

@davepeck
Copy link

With modern Jekyll, it's possible to nest _posts directories deeper in the hierarchy:

.
├── _config.yml
├── blog
|   ├── index.html
|   ├── _posts
|       └─── 2016-02-23-a-post-to-my-blog.md    
├── photoblog
|   ├── _index.html
|   ├── _posts
|       └─── 2016-02-23-a-photo-post.md
└── index.html

Hugo's import jekyll doesn't appear to know about this, and fails to import these posts correctly.

@davepeck
Copy link
Author

Just to add a few notes:

Jekyll appears to look for _posts and _drafts in all directories it walks, so they can be nested arbitrarily deep. The superdirectory names above _posts appear to become part of of the post's categories. Other than that, a post's final resting location in the generated _site seems to depend only on the permalink setting, not its location in the source directory structure.

(There's also a curious comment in jekyll's categories_from_path implementation that seems to suggest there is some other meaning to subdirectories of a _posts directory. I've no idea what this is; might be of interest.)

Hugo's importer only looks for top-level _posts and _drafts directories. There's a split between that code (which imports posts) and the code that blindly copies what it believes to be static content; it seems like this needs to be restructured. Finally, I'm not sure I understand what the importer is doing with permalink but it might also need to be revisited.

@davepeck
Copy link
Author

I took a quick stab at this, here: https://github.com/davepeck/hugo/commit/d6e225af7f0143fc3e5a5778886a8c84eb3ab764

Not suitable for a pull request; just a quick hack that might help someone.

@bep
Copy link
Member

bep commented Feb 29, 2016

@coderzh there are couple of open issues/feature requests about the Jekyll importer now... Would this be something that you could have a look at?

@coderzh
Copy link
Contributor

coderzh commented Feb 29, 2016

@bep I'd be glad to do something about these issues.

@bep
Copy link
Member

bep commented Mar 3, 2016

@davepeck do you know any in-the-open (on GitHub) Jekyll sites with the "symptoms" of this and maybe the other issue(s) you have posted, that we could use to test this?

@davepeck
Copy link
Author

davepeck commented Mar 3, 2016

I humbly offer my own personal blog as an example: https://github.com/davepeck/davepeck.org; it has both nested _posts and arbitrary files sitting around the hierarchy with YAML frontmatter.

I wonder if a cleverly crafted github search could get us some further examples?

Sorry I haven't had time to contribute code myself on this but hope at least the issues/comments were helpful.

@bep
Copy link
Member

bep commented Mar 10, 2016

I humbly offer my own personal blog as an example

@davepeck And it is > 1 GB ... Could you take the PR referenced here for a spin and tell us if that works for you?

@bep bep added the Stale label Feb 28, 2017
@bep
Copy link
Member

bep commented Feb 28, 2017

This issue has been automatically marked as stale because it has not been commented on for at least four months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still valuable, please open a proposal at https://discuss.gohugo.io/.

This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions.

@bep
Copy link
Member

bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@bep bep closed this as completed Mar 27, 2017
bep pushed a commit that referenced this issue Jul 1, 2017
@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 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants