本文介绍了如何配置 GitHub 以使用不受支持的 Jekyll 站点插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚为我的 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 :

  1. 从你的工作文件夹 git init
  2. git remote add origin [email protected]:userName/userName.github.io.git (UO) 或 git remote add origin [email protected]:userName/repositoryName.git (P)
  3. jekyll new . 创建你的代码库
  4. _config.yml 中,将 baseurl 参数设置为 baseurl: '' (UO) 或 baseurl: '/repositoryName' (P)
  5. .gitignore中添加_site,它将在另一个分支中进行版本控制
  6. jekyll build 将创建目标文件夹和构建站点.
  7. git checkout -b sources (UO) 或 git checkout master (P)
  8. git add -A
  9. git commit -m "jekyll base sources" 提交你的源代码
  10. git push origin source (UO) 或 git push origin master (P) 将你的源推送进来适当的分支
  11. cd _site
  12. touch .nojekyll,这个文件告诉gh-pages不需要构建
  13. git init 初始化仓库
  14. git remote add origin [email protected]:userName/userName.github.io.git (UO) 或 git remote add origin [email protected]:userName/repositoryName.git (P)
  15. git checkout master (UO) 或 git checkout -b gh-pages (P) 把这个相应分支上的存储库
  16. git add -A
  17. git commit -m "jekyll first build" 提交你的站点代码
  18. git push origin master (UO) 或 git push origin gh-pages (P)
  1. from your working folder git init
  2. git remote add origin [email protected]:userName/userName.github.io.git (UO) or git remote add origin [email protected]:userName/repositoryName.git (P)
  3. jekyll new . creates your code base
  4. in _config.yml, set the baseurl parameter to baseurl: '' (UO) or baseurl: '/repositoryName' (P)
  5. in .gitignore add _site, it will be versioned in the other branch
  6. jekyll build will create the destination folder and build site.
  7. git checkout -b sources (UO) or git checkout master (P)
  8. git add -A
  9. git commit -m "jekyll base sources" commit your source code
  10. git push origin sources (UO) or git push origin master (P) push your sources in the appropriate branch
  11. cd _site
  12. touch .nojekyll, this file tells gh-pages that there is no need to build
  13. git init init the repository
  14. git remote add origin [email protected]:userName/userName.github.io.git (UO) or git remote add origin [email protected]:userName/repositoryName.git (P)
  15. git checkout master (UO) or git checkout -b gh-pages (P) put this repository on the appropriate branch
  16. git add -A
  17. git commit -m "jekyll first build" commit your site code
  18. git push origin master (UO) or git 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 站点插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 09:18