相关疑难解决方法(0)

jekyll插件在github上不起作用

我想通过改变在导航中栏的页面顺序jekyll-plugins / weighted_pages.rb从这里。

这个插件在我的本地主机上很好,但是在github上也很好。
我发现github主机上的导航栏为空,看来此插件不起作用。
我怎么解决这个问题?

我weighted_pages.rb在下面复制代码:

# Generates a copy of site.pages as site.weighted_pages
# with pages sorted by weight attribute. Pages with no
# weight specified are placed after the pages with specified weight.

module Jekyll

  class WeightedPagesGenerator < Generator
    safe true

    def generate(site)
      site.config['weighted_pages'] = site.pages.sort_by { |a| 
        a.data['weight'] ? a.data['weight'] : site.pages.length }
    end

  end

end
Run Code Online (Sandbox Code Playgroud)

将weight属性添加到您的首要问题,pages (like weight: 1)并在循环中使用site.weighted_pages而不是site.pages。

ruby github jekyll

5
推荐指数
1
解决办法
877
查看次数

标签 统计

github ×1

jekyll ×1

ruby ×1