我正在尝试将我使用 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 页面上时,不需要修改 url
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