Search code examples
octopressdigital-ocean

Move octopress blog to subfolder


I have currently my octopress blog up and running on my digital ocean droplet and everything works fine. But it is in the root folder of the droplet and I want to move it to a blog folder. Is that just moving all content to that subfolder, or is there more work to do to get this done to be aware of?


Solution

  • According to the Octopress documentation, if you are deploying in a subdirectory you'll need to update the following files:

    • _config.yml
    • config.rb
    • Rakefile

    If you're deploying to a subdirectory on your site, or if you're using Github's project pages, make sure you set up your urls correctly in your configs. You can do this almost automatically:

    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" 
    

    To manually configure deployment to a subdirectory, you'll change _config.yml, > config.rb and Rakefile. Here's an example for deploying a site to the /awesome subdirectory:

    # _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"
    

    source: http://octopress.org/docs/deploying/subdir/