问题描述
我刚刚为我的 Jekyll 博客创建了一个很棒的画廊,它完美地构建在我的 localhost:4000 上.但是,GitHub 页面不支持我使用的 Jekyll Gallery Generator 插件:https://github.com/ggreer/jekyll-gallery-generator
I just created a great gallery for my Jekyll blog which builds perfectly on my localhost:4000. However, GitHub pages doesn't support the Jekyll Gallery Generator plug-in I am using: https://github.com/ggreer/jekyll-gallery-generator
我阅读了使用 FTP 在传统主机上托管 Jekyll 的替代方法(上传 _site 目录)http://jekyllrb.com/docs/deployment-methods/ 但是,与其重新配置我的整个站点和托管,不如以某种方式使用 GitHub Pages,即使我使用的是不受支持的插件.
I read about the alternative method of hosting Jekyll on a traditional host using FTP (uploading the _site directory) http://jekyllrb.com/docs/deployment-methods/ However, rather than reconfigure my entire site and hosting, It would be great if GitHub Pages could be used somehow even though I'm using a non-supported plugin.
对此有什么解决方法?
推荐答案
取决于您是处理用户/组织 (UO) 站点还是项目站点 (P),做:
Depending if you deal with a User/Organization (UO) site or a Project site (P), do :
- 从你的工作文件夹
git init
git remote add origin [email protected]:userName/userName.github.io.git
(UO) 或git remote add origin [email protected]:userName/repositoryName.git
(P)jekyll new .
创建你的代码库- 在 _config.yml 中,将 baseurl 参数设置为
baseurl: ''
(UO) 或baseurl: '/repositoryName'
(P) - 在.gitignore中添加_site,它将在另一个分支中进行版本控制
jekyll build
将创建目标文件夹和构建站点.git checkout -b sources
(UO) 或git checkout master
(P)git add -A
git commit -m "jekyll base sources"
提交你的源代码git push origin source
(UO) 或git push origin master
(P) 将你的源推送进来适当的分支cd _site
touch .nojekyll
,这个文件告诉gh-pages不需要构建git init
初始化仓库git remote add origin [email protected]:userName/userName.github.io.git
(UO) 或git remote add origin [email protected]:userName/repositoryName.git
(P)git checkout master
(UO) 或git checkout -b gh-pages
(P) 把这个相应分支上的存储库git add -A
git commit -m "jekyll first build"
提交你的站点代码git push origin master
(UO) 或git push origin gh-pages
(P)莉>
- from your working folder
git init
git remote add origin [email protected]:userName/userName.github.io.git
(UO) orgit remote add origin [email protected]:userName/repositoryName.git
(P)jekyll new .
creates your code base- in _config.yml, set the baseurl parameter to
baseurl: ''
(UO) orbaseurl: '/repositoryName'
(P) - in .gitignore add _site, it will be versioned in the other branch
jekyll build
will create the destination folder and build site.git checkout -b sources
(UO) orgit checkout master
(P)git add -A
git commit -m "jekyll base sources"
commit your source codegit push origin sources
(UO) orgit push origin master
(P) push your sources in the appropriate branchcd _site
touch .nojekyll
, this file tells gh-pages that there is no need to buildgit init
init the repositorygit remote add origin [email protected]:userName/userName.github.io.git
(UO) orgit remote add origin [email protected]:userName/repositoryName.git
(P)git checkout master
(UO) orgit checkout -b gh-pages
(P) put this repository on the appropriate branchgit add -A
git commit -m "jekyll first build"
commit your site codegit push origin master
(UO) orgit push origin gh-pages
(P)
您现在拥有类似于 Octopress 的功能.看看他们的 rake 文件,里面有一些不错的评论.
You now have something like Octopress does. Look at their rake file, there are some nice comments inside.
这篇关于如何配置 GitHub 以使用不受支持的 Jekyll 站点插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!