1

目前,我的 octopress 博客已在我的数字海洋水滴上运行,一切正常。但它位于液滴的根文件夹中,我想将它移动到一个blog文件夹中。这只是将所有内容移动到该子文件夹,还是需要做更多工作才能完成这项工作?

4

1 回答 1

1

根据 Octopress 文档,如果您在子目录中部署,则需要更新以下文件:

  • _config.yml
  • 配置文件
  • 耙文件

如果您要部署到站点上的子目录,或者您正在使用 Github 的项目页面,请确保您在配置中正确设置了 url。您几乎可以自动执行此操作:

rake set_root_dir[your/path]

# To go back to publishing to the document root
rake set_root_dir[/] Then update your _config.yml and Rakefile as follows:

# _config.yml
url: http://yoursite.com/your/path

# Rakefile (if deploying with rsync)
document_root = "~/yoursite.com/your/path" 

要手动配置部署到子目录,您将更改 _config.yml、> config.rb 和 Rakefile。这是将站点部署到 /awesome 子目录的示例:

# _config.yml
destination: public/awesome
url: http://example.com/awesome
subscribe_rss: /awesome/atom.xml
root: /awesome

# config.rb - for Compass & Sass
http_path = "/awesome"
http_images_path = "/awesome/images"
http_fonts_path = "/awesome/fonts"
css_dir = "public/awesome/stylesheets"

# Rakefile
public_dir = "public/awesome"
# If deploying with rsync, update your Rakefile path
document_root = "~/yoursite.com/awesome"

来源: http: //octopress.org/docs/deploying/subdir/

于 2014-03-28T12:16:41.340 回答