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 · 9 comments

Comments

Projects
None yet
3 participants
@davepeck

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.

@bep bep added the Enhancement label Feb 24, 2016

@davepeck

This comment has been minimized.

Show comment
Hide comment
@davepeck

davepeck Feb 24, 2016

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.

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

This comment has been minimized.

Show comment
Hide comment
@davepeck

davepeck Feb 24, 2016

I took a quick stab at this, here: davepeck@d6e225a

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

I took a quick stab at this, here: davepeck@d6e225a

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

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 29, 2016

Member

@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?

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

This comment has been minimized.

Show comment
Hide comment
@coderzh

coderzh Feb 29, 2016

Contributor

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

Contributor

coderzh commented Feb 29, 2016

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

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 3, 2016

Member

@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?

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

This comment has been minimized.

Show comment
Hide comment
@davepeck

davepeck 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.

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 10, 2016

Member

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?

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 28, 2017

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 1, 2017

Member

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.

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 Mar 27, 2017

bep added a commit that referenced this issue Jul 1, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment