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

multiple categories exported as nested categories #36

Closed
jashsayani opened this issue Nov 22, 2018 · 11 comments · Fixed by #89
Closed

multiple categories exported as nested categories #36

jashsayani opened this issue Nov 22, 2018 · 11 comments · Fixed by #89

Comments

@jashsayani
Copy link
Contributor

I sometimes use multiple categories for a post. The hexo migrator has made them nested.

Exported with migrate:

categories:
  - Featured
  - Tutorial

Expected:

categories:
  - [Featured]
  - [Tutorial]
@curbengh
Copy link
Contributor

#54

@curbengh
Copy link
Contributor

Defaults to tags (not nested) since v2 #57

tags:
  - foo
  - bar

@curbengh
Copy link
Contributor

#81

@curbengh curbengh reopened this Jul 25, 2020
@curbengh
Copy link
Contributor

curbengh commented Jul 25, 2020

From the sample you gave, do you have any nested category?

@jashsayani
Copy link
Contributor Author

many posts have 2 categories. they are migrated as nested instead of being 2 categories.

@curbengh
Copy link
Contributor

I mean your original WP, I can't find any indication of nested category from the sample. I wonder what it looks like. @jehy @adnan360

@adnan360
Copy link

adnan360 commented Jul 26, 2020

Here is an export with categories, sub categories and tags added to "Post with Image". Here's how it looks like on editor for reference:

wp-multi-category-01

EDIT:

many posts have 2 categories. they are migrated as nested instead of being 2 categories.

@jashsayani I tried your code, but it didn't work. I guess Hexo doesn't have non-hierarchical / non-nesting categories as discussed here. I posted my experience here.

@curbengh
Copy link
Contributor


I guess Hexo doesn't have non-hierarchical / non-nesting categories as discussed

categories:
  - [Featured]
  - [Tutorial]

works for me. a theme might displays it as Featured/Tutorial, but when I check the link, it's not nested.

@adnan360
Copy link

adnan360 commented Jul 27, 2020

...but when I check the link, it's not nested.

Oh, that's true! It works! The arrow in the default theme is confusing (at least for WP users like me). I guess I can just modify the theme to show it differently.

@curbengh
Copy link
Contributor

I guess I can just modify the theme to show it differently.

I haven't quite figure it out, feel free to upstream the fix to hexo-theme-landscape.

categories:
  - [Lorem, Ipsum, Dolor]
  - [Foo, Bar]
  - [Baz]

Perhaps display them as Categories: Lorem => Ipsum => Dolor | Foo => Bar | Baz.

@adnan360
Copy link

Well, I am used to WP side of things, not so much for Hexo, so not sure how to make edits for it (didn't have time to look into it yet). Created an issue for this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants