如何配置GitHub以使用不受支持的Jekyll站点插件? [英] How do I configure GitHub to use non-supported Jekyll site plugins?

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

问题描述

我刚刚为我的Jekyll博客创建了一个很棒的画廊,它完美地构建在我的localhost:4000上。但是,GitHub页面不支持我正在使用的Jekyll Gallery Generator插件: https:// github.com/ggreer/jekyll-gallery-generator



我读到了使用FTP在传统主机上托管Jekyll的替代方法(上传_site目录) http://jekyllrb.com/docs/deployment-methods/ 然而,而不是重新配置我的整个网站和托管,如果GitHub页面可以以某种方式使用,即使我使用的是不受支持的插件,那也是非常棒的。



什么是解决方法?

解决方案

根据您处理用户/组织( UO )网站或项目网站( P ),请从工作文件夹 git init 中执行:


  1. c $ c>

  2. git remote add origin git@github.com:use rName / userName.github.io.git UO )或 git remote add origin git@github.com:userName / repositoryName.git P

  3. jekyll new。创建您的代码库
  4. _config.yml 中添加
  5. ,将 baseurl 参数设置为 baseurl:'' strong> UO )或 baseurl:'/ repositoryName' P
  6. 中的
  7. .gitignore 添加 _site ,它将在另一个分支中进行版本控制
  8. $ c>将创建目标文件夹和构建站点。
  9. git checkout -b来源 UO )或 git checkout master P

  10. git add -A

  11. git commit -mjekyll基础来源提交您的源代码
  12. git push origin source UO )或 git push origin master P )将资源推送到适当的分支中

  13. cd _site

  14. touch .nojekyll ,这个文件告诉gh页面不需要编译

  15. git init init存储库

  16. git remote add origin git@github.com:userName / userName.github.io.git UO )或 git remote add origin git@github.com:userName / repositoryName.git P li>
  17. git checkout master UO )或 git checkout -b gh-pages P )将此存储库放在适当的分支上

  18. git add -A

  19. git commit -mjekyll first build提交您的站点代码 code> git push origin master UO )或 git push origin gh-pages P

您现在有类似 Octopress 确实。看看他们的rake文件,里面有一些很好的评论。

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

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.

What is a workaround for this?

解决方案

Depending if you deal with a User/Organization (UO) site or a Project site (P), do :

  1. from your working folder git init
  2. git remote add origin git@github.com:userName/userName.github.io.git (UO) or git remote add origin git@github.com: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 git@github.com:userName/userName.github.io.git (UO) or git remote add origin git@github.com: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)

You now have something like Octopress does. Look at their rake file, there are some nice comments inside.

这篇关于如何配置GitHub以使用不受支持的Jekyll站点插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆