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

support sticky? #10

Open
njzjz opened this issue Apr 10, 2021 · 4 comments
Open

support sticky? #10

njzjz opened this issue Apr 10, 2021 · 4 comments

Comments

@njzjz
Copy link

njzjz commented Apr 10, 2021

See hexojs/hexo-generator-index#51. It's nice if hexo-generator-index2 can also have this feature.

@airinghost
Copy link

index2_include_index: true
index2_generator:
  - layout: 'index'
    path: ''
    index: true
    per_page: 10
    order_by: -sticky

Then set sticky: [numbers] in Front-matter for every post. This works on my devices.

@Jamling
Copy link
Owner

Jamling commented Oct 30, 2021

index2_include_index: true
index2_generator:
  - layout: 'index'
    path: ''
    index: true
    per_page: 10
    order_by: -sticky

Then set sticky: [numbers] in Front-matter for every post. This works on my devices.

what's your hexo version?

@airinghost
Copy link

airinghost commented Oct 30, 2021

what's your hexo version?

I switched to Hugo several weeks ago, so I cannot check its version now. But I have a backup of package.json, and it shows "hexo": "^4.2.1".

@airinghost
Copy link

airinghost commented Oct 30, 2021

In fact, the front-matter I set is top: [numbers], and in the config I set order_by: -top. So I guess that the sticky or any other words would work the same.

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

No branches or pull requests

3 participants