First post! I am attempting to move my blog to GitHub Pages.
After seeing the results of others, I figure I will start with Octopress and see how that goes.
Just so I can remind myself of the Octopress basics in the immediate future:
Much of the page generation is controlled by configuration file
_config.yml
The content is all stored in
source/_posts/
This particular entry corresponds to the file
2012-12-31-hello-world.markdown
The first 7 lines of that file were originally generated via the
rake
command invocation:% rake new_post["Hello World"]
The command
rake generate
will convert the source into static html pages.After generating the file (and during subsequent editting), one can preview the state locally in a local Ruby webserver via:
% rake preview
and then browsing localhost port 4000. The
rake preview
invocation will continuously monitor your post source files so that you can keep working on your post and then reload in your web browser without rerunningrake
itself.The command
rake deploy
is supposed to deploy the content into its intended live location. I have been having difficulty using this command, in part because I think it is written assuming you have your ssh-key already set up and integrated with github (or something similar) so that there would be no password prompts.But of course I have not done this yet.
One important detail about
rake deploy
with github pages is that the_deploy/
subdirectory is itself a clone of the targetted github repository, with thegh-pages
branch checked out. This can be confusing if your main source tree (the parent directory of_deploy/
) is itself the same repository as the targetted github repository.
Update:
rake deploy
just worked fine for me, password prompts and all. I think my earlier difficulty was an artifact of some previous bad state, one of either:I had put in a malformatted url for the target repository
My target repository already had a
gh-pages
branch (from earlier testing) that needed to be pulled-and-merged (or discarded in some fashion, which was what my merge amounted to).
Update (26 march 2012): there are still some hiccups with
rake deploy
; you need to be careful about what you store in thesource/
directory. In particular, I was working on a draft post and threw various source files that I was hacking on in the same directory, along with some.gitignore
files so thatgit
would ignore build products generated when I compiled the source (to binaries or jars or fasls…).The headache came when I did
rake deploy
, and hit this error:% rake deploy cp -r source/_posts/.gitignore public/_posts/.gitignore rake aborted! No such file or directory - public/_posts/.gitignore /Users/pnkfelix/Dev/Sites/pnkfx-blog/Rakefile:230:in `block (2 levels) in <top (required)>' /Users/pnkfelix/Dev/Sites/pnkfx-blog/Rakefile:229:in `block in <top (required)>' /Users/pnkfelix/Dev/Sites/pnkfx-blog/Rakefile:219:in `block in <top (required)>' Tasks: TOP => copydot (See full trace by running task with --trace) %
The problem here, as far as I can tell, is that octopress is aggressively trying to copy over all dotfiles it can find (Octopress Issue 104) and that code was not written to create any subdirectories as necessary.
My Ruby development knowledge is sufficiently under-developed that I am not going to try to fix this myself. Instead I have simply moved all of the source code I was hacking out of the
source/
directory and into a separatehacks/
directory. This seems to have addressed the problem; I have also filed an issue for this with Octopress.