我正在尝试将我使用jekyll构建的网站部署到gitlab页面。但是,只有索引页才能正确加载。所有其他链接都需要将.html附加到url。所以
username.gitlab.io/project/功能正常,但两者都
username.gitlab.io/project/about
username.gitlab.io/project/blog仅当url更改为时才有效
username.gitlab.io/project/about.html
username.gitlab.io/project/blog.html奇怪的是,当部署在github页面上时,不需要修改urls
username.github.io/project/
username.github.io/project/about
username.github.io/project/blog/所有设备都工作正常。
我感觉这与.gitlab-ci.yml文件有关,但我不确定。这是如果它有任何线索的话
image: ruby:2.5.3
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- bundle install
test:
stage: test
script:
- bundle exec jekyll build -d test
artifacts:
paths:
- test
except:
- master
pages:
stage: deploy
script:
- gem install jekyll
- bundle exec jekyll build -d public
artifacts:
paths:
- public
only:
- master发布于 2018-12-23 11:36:03
你可以为YAML中的页面使用定制的固定链接,例如:permalinks: /project/about
我一直在我的Jekyll博客托管gitlab中使用它,似乎没有问题,尽管在每个页面上重复可能看起来有点乏味。
https://stackoverflow.com/questions/53645319
复制相似问题