11

I am using Octopress 3, and when I run jekyll build, it generates the correct set of files (which includes my static files, see list of files below):

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

Note that my entire jekyll-generated blog is now safely stored within \blog\, which is how I want it.

But once I do octopress deploy, it overwrites this entire folder (which also overwrites my existing static files), see listing below:

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

Here is my _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

This is my _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

Note: Once I remove the following line from my _config.yml: source: '../', my jekyll build generates that deploy folder like octopress deploy does.

Given the new Octopress 3 and an existing static site hosted on my gh-pages branch, how do I deploy my blog to a subdirectory of that existing gh-pages site?

max pleaner
  • 23,403
  • 8
  • 50
  • 99
marcamillion
  • 29,563
  • 49
  • 161
  • 337
  • what exactly do you want to fix? You can run a shell script at any point to rearrange your file directory. – max pleaner Aug 29 '16 at 08:23
  • Whenever I run `octopress deploy`, it keeps overwriting the files that `jekyll build` creates. It's not about any random shell scripts. It's about the workflow of Octopress and Jekyll. – marcamillion Aug 29 '16 at 08:31
  • @maxpleaner Basically what I am trying to do is, I have an existing static site hosted on GH-pages and I would like to add a blog to a subdirectory `/blog` on that site. I can't figure out how to prevent `octopress deploy` from overwriting the entire repo, as opposed to just the subdirectory `/blog`. Is that more clear? – marcamillion Aug 30 '16 at 04:57
  • Sorry, but I didn't get that from the post - what do you want to achieve? You want `octopress deploy` to generate all files into `_site/blog` directory? – smefju Sep 26 '16 at 18:08
  • @marcamillion, i see this has ended but you may consider reading this. http://albertlatham.com/archive/Octopress_3_git_workflow/ – norcal johnny Sep 30 '16 at 22:17

1 Answers1

1

You're not setting the root dir correctly.
Follow this instruction: http://octopress.org/docs/deploying/subdir/

Adrian
  • 425
  • 4
  • 13