GitHub pages serving from docs and jekyll source folder config

无人久伴 提交于 2019-12-25 04:36:01

问题


The documentation for standard F# (following ProjectScaffold) has the following structure

- project
| - docs
| | content
| | files
| | output
| | tools

The generated docs are saved into output, which are then pushed to the gh-pages branch.

Recently, GitHub has changed the way serving pages work and now you can just serve the docs folder directly from the master branch. The problem is that the actual folder I wish to serve is docs/output.

Jekyll has a source configuration that allow me to do this locally. My docs/_config.yml is just:

source: output

Which works fine if I run jekyll serve in the docs folder locally. But after pushing to GitHub, the pages are still served under /output prefix.

So apparently GitHub is overriding the source option. Is there anyway this can be worked out?


回答1:


Is Jekyll's documentation unclear. Yes.

New github pages publication branch/folder :

Available options are (doc) :

  • gh-pages branch
  • master branch
  • master branch /docs folder
  • Disable GitHub Pages.

Three first options defines your root publication folder.

Github pages uses this root folder to generate your site. You cannot override source key in your _config.yml.

Your can store your sources in a _docs folder and output in docs

- project
| - _docs
| | content
| | files
| | tools
|
| - docs << output here


来源:https://stackoverflow.com/questions/41183724/github-pages-serving-from-docs-and-jekyll-source-folder-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!