如何将octopress 3部署到现有gh-pages网站的子目录中?

时间:2016-08-29 07:16:44

标签: ruby jekyll octopress

我正在使用Octopress 3,当我运行jekyll build时,它会生成正确的文件集(包括我的静态文件,请参阅下面的文件列表):

      $ cd _site
:_site$ ls -a
.               CNAME               assets              google2d8.html  index-alternative.html
..              about               blog                increase-revenue.html       index.html

请注意,我的整个jekyll生成的blog现已安全地存储在\blog\中,这就是我想要的。

但是一旦我octopress deploy,它就会覆盖整个文件夹(也会覆盖我现有的静态文件),请参阅下面的列表:

      $ cd _site
:_site$ ls -a
.       ..      Gemfile     Gemfile.lock    about       css     feed.xml    index.html  jekyll

这是我的_config.yml

title: My Title
email: some@email.com
description: > # this means to ignore newlines until "baseurl:"
     some description
baseurl: "/blog" # the subpath of your site, e.g. /blog
url: "http://example.com" # the base hostname & protocol for your site
twitter_username: myusername

source: '../'

# Build settings
markdown: kramdown
theme: minima

这是我的_deploy.yml

method: git                 # How do you want to deploy? git, rsync or s3.
site_dir: _site             # Location of your static site files.
git_url: my_git_url

git_branch: gh-pages-2       # Git branch where static site files are commited

注意:从我的_config.yml source: '../'删除以下行后,我的jekyll build会生成octopress deploy之类的部署文件夹。

鉴于我的gh-pages分支上托管了新的Octopress 3和现有静态网站,如何将我的博客部署到现有gh-pages网站的子目录中?

1 个答案:

答案 0 :(得分:1)

您没有正确设置根目录 请遵循以下指示: http://octopress.org/docs/deploying/subdir/

相关问题