Set up of octopress blog on github
-
29-05-2021 - |
Question
Can't setup Octopress blog on Github. I'm following this guide on octopress but after creating a repository on github and preparing everything I can't deploy on github.
I have two branches, master and gh-pages and after trying I have just deleted everything and I want to start from the beginning.
Should I put octopress folder inside my repository folder locally? Or do they have to be in two different folders?
That guide is a bit confusing, and I am very new to git.
Can anyone who have already done it explain how to deploy on github with github-pages?
Solution
I agree with you that the tutorial is a bit complicated, but follow it strictly and you will be able to setup correctly.
So, in order to do that, create like a folder into your computer with the octopress content (don't forget about installing bundler and 'rake install') and create a repo in github with YOU_USERNAME.github.com .
Finally, deploy to github, running 'rake setup_github_pages', do generate and deploy. Your page is ready. Just go to you source folder and run the other 3 git commands, to have it backed up.
If you have doubts, see my repo for reference. I have even set my domain (lucasarruda.com) to it.
Obs.: wait for some minutes when you just created the repository. Then commiting should be almost instant.
OTHER TIPS
I agree it is a bit complicated, but once you have it setup, it is so easy to use. You don't need to clone your github repo, everything should be done in your Octopress folder (but you need to establish an SSH key connection with your repo), Here is how I set it up:
From your github account:
- create a new repo and name it
username.github.io
, in my caseiamaziz.github.io
.
Clone Octopress blog project:
git clone https://github.com/imathis/octopress.git
From Octopress blog root folder:
- run
rake setup_github_pages
, and ansewer with your repo credentials (the one you just created). (Note: make sure you have SSH key setup between your github account and your computer.) - run
rake generate
(This will create your posts and pages) - run
rake deploy
(This will push the contents of_deploy
to yourmaster
branch).
It should ask for your ssh key password (if it is not already saved in the keychain) then you will see something like identity added: ...
and deployment will start.
Note:
if you get a message says
permission denied
when you runrake deploy
, this means SSH key (public key) does not exists or not establish correctly. See: error permission-denied.
If everything is ok, your blog is ready at: http://username.github.io/
One more thing:
However, you also need to push the source of your Octopress project to source
branch of your repo as follows, change directory to source folder and run:
git add .
git commit -m "your msg"
git push origin source
Done!
From now on you should be for blogging, as follow:
- Create and edit posts:
rake new_post["title"]
- Generate them:
rake generate
- deploy them to your github pages:
rake deploy