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

mar*_*ion 11 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
Run Code Online (Sandbox Code Playgroud)

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

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

      $ cd _site
:_site$ ls -a
.       ..      Gemfile     Gemfile.lock    about       css     feed.xml    index.html  jekyll
Run Code Online (Sandbox Code Playgroud)

这是我的_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
Run Code Online (Sandbox Code Playgroud)

这是我的 _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
Run Code Online (Sandbox Code Playgroud)

注意:从my _config.yml:中 删除以下行后source: '../',我会jekyll build像生成那样生成部署文件夹octopress deploy.

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

小智 1

您没有正确设置根目录。
请按照以下说明操作: http://octopress.org/docs/deploying/subdir/