Jamling / hexo-generator-index2

Filtered index generator for Hexo
MIT License
46 stars 8 forks source link

any other configuration of layout #3

Closed Yalhu closed 6 years ago

Yalhu commented 6 years ago

Is index the only configuration of layout ? When I set layout: 'categories', it was not category page,but archive page. When I change code on generator2.js ,it didn't work.

ret = ret.concat(pagination(path, posts, {
            perPage: generator.per_page,
-            layout: [generator.layout, 'archive'],
+            layout: [generator.layout, 'categories'],
            format: paginationDir + '/%d/',
            data: opts
        }));

Should I make my own category page with feature of filter? Or it is a bug. Hexo-theme-next I use.

Jamling commented 6 years ago

see https://github.com/Jamling/hexo-generator-index2#usage

categories is not layout page it belongs to archive page.

Jamling commented 6 years ago

The layout please see https://hexo.io/docs/templates.html#Layouts

You can set layout in _config.yml sample

index2_generator:
  - layout: 'index' # use index or archive or other layout you defined
    path: 'web' # output to web folder: http://127.0.0.1:4000/web/
    per_page: 10
    order_by: -date
    include:
      - category Web # include article which category is Web