ruby 为什么jekyll-archives不能在Travis CI的Github页面上工作?

tf7tbtn2  于 12个月前  发布在  Ruby
关注(0)|答案(1)|浏览(100)

我正在使用Travis在Github页面上部署。我也在我的项目中使用jekyll-archives。我的设置在本地运行得很好,但是在github页面上没有生成存档页面。我还使用了jekyll-paginate-v2,它也没有在github页面上列出白名单,它与Travis部署完美配合。我不明白杰基尔档案馆的问题。
我的Gemfile

source 'https://rubygems.org'
gem 'jekyll', '<4'
gem 'html-proofer', '4.3.1'
gem 'jekyll-archives'
gem 'jekyll-sitemap'
gem 'jekyll-paginate-v2'
gem 'kramdown-parser-gfm'
gem 'webrick'

My _config.yml

plugins:
  - jekyll-archives
  - jekyll-sitemap
  - jekyll-paginate-v2

exclude:
  - "/vendor/"

future: true
timezone: Asia/Kolkata

# Build settings
markdown: kramdown
inter_post_navigation: true
highlightjs_theme: "monokai-sublime"

# Pagination Settings
pagination:
  enabled: true
  per_page: 5
  permalink: "/page/:num/"
  sort_reverse: true

# Archive settings
jekyll-archives:
  enabled:
    - categories
    - tags
  layout: archive
  permalinks:
    category: '/category/:name/'
    tag: '/tag/:name/'

我的特拉维斯

language: ruby
rvm:
  - 2.6.3
cache: bundler
install:
  - gem install bundler
  - gem update --system 3.2.3
  - bundle install
script:
  - bundle exec jekyll build
branches:
  only:
    - master
addons:
  apt:
    packages:
      - libcurl4-openssl-dev
deploy:
  provider: pages
  skip_cleanup: true
  local_dir: _site
  github_token: $TRAVIS_DEPLOY_TOKEN
  keep_history: true
  on:
    branch: master
  repo: <org>/<repo>.github.io
  target_branch: gh-pages
notifications:
  email: false
zvokhttg

zvokhttg1#

事实证明,jekyll-archives工作正常,但根据其默认设置创建了slugified链接。另一方面,我保留了html文件中的锚标记中的类别链接。所以我不得不在锚标签中放置slugify过滤器。
之前

<a href="{{ site.baseurl }}/category/{{ cat }}">{{ cat | capitalize }}</a>

<a href="{{ site.baseurl }}/category/{{ cat | slugify }}">{{ cat | capitalize }}</a>

相关问题