Octopress is great until it breaks
Since using Octopress I've found it mostly to be awesome, but sometimes I encounter issues and now having used it a while and had a look around the file / folder structure I'm not entirely convinced I've got it setup correct.
I've documented my current process, in the hopes that someone who knows what they're doing can point me in the right direction and help others who might be having the same issues.
To start off I do a:
1 | rake preview |
Then open up my browser and go to:
1 | localhost:4000 |
Sweet. I can now view the site locally, edit a page in Sublime Text 2 and view the changes in the browser.
Question 1
I then have to hit refresh a bunch of times, before I see the changes, I love LiveReload an app that pushes changes to the browser so you don't have to hit refresh. I'm guessing that when I edit and then save a document Octopress is rebuilding the whole site? If that's the case, is it possible when editing a post to just rebuild that page and have it automatically pushed to the browser?
Now I'm happy with the post and want to push the changes live.
So I go back to Terminal and open a new tab as the current tab is now running the preview site and throwing out:
1 | [2013-06-12 18:51:36] regeneration: 1 files changed |
Question 2
Is it ok to keep the preview going whilst generating, deploying, pushing? I'd like to as there's instances where I want to write multiple posts. Also are the WARN errors something to be concerned about?
Next I do:
1 | git status |
Now I see a list of all the public files that have changed, most of these are just minor changes to the navigation on each page.
Question 3
Is it possible to just check over the source files and auto-update the minor changes?
Next as per https://octopress.org/docs/deploying/github/ I Run:
1 | rake generate |
Or I found out you can run these in one go using rake gen_deploy
.
Question 4
I take it rake gen_deploy
does exactly the same thing as running them separately?
After running that, I get:
1 | $ rake gen_deploy |
All looks ok, so I go to:
/github.com/simonowendesign/simonowendesign.github.io (no longer online)
Again, all looks ok. Then check:
Everything ok, cool.
Now again as per:
https://octopress.org/docs/deploying/github/
Commit the source:
1 | git add . |
But now I'm getting a source.old
folder with a whole bunch of stuff in.
At this point I should mention last night I ran into an issue that caused my site to go down and hence the reason for this post and further investigation. At this point I was also trying out published: false
. Each post, at the top of the page has some 'yaml front matter':
1 |
|
Adding published: false
to this allows you to preview the post locally, but it won't be deployed to live. At first I thought my site breaking might have been something to do with that so I removed the markdown file, the site worked fine locally, but not when pushed live. So then I ran the install commands again in case anything needed updating.
1 | $ gem install bundler |
Question 5
What's the best practice for keeping on top of gems? e.g. should I be aware of new gems being updated and update as required, or perhaps have this automated, so if something is updated it happens on a daily basis?
After updating, I ran:
1 | rake deploy |
This seemed to fix the issue, but I have no idea if it was this that kicked it back into action. Whilst running those commands from https://octopress.org/docs/deploying/github/ I noticed:
1 | echo 'your-domain.com' >> source/CNAME |
And also noticed that my CNAME
file just had:
1 | simonowendesign.co.uk |
So also at this point I did a commit that changed this, but then researching online found it was in fact correct to just have the domain name, so reverted and wonder also if maybe that fixed it. I also then noticed that I had more than one CNAME
file and began to investigate all the files and folder structure again as I hadn't done so for a while since setting it up and everything was working.
Here's my folder structure:
Source:
Blog:
Deploy:
To add further confusion, as I knew I didn't require the source.old
I moved the source.old
folder to another folder outside of the repo for safe keeping and did git status
again. Then git add .
, then git status
, everything looked ok, so did git commit -m 'Add video to post'
. Then git push origin source
, this again makes me wonder if I have this setup correct as I got:
1 | $ git push origin source |
Question 6
As I understand it git push origin source
would push to a branch called source
? Is this something I'm doing wrong, as I only have a master
branch?
Then I opted to do just git push
which gave me:
1 | To [email protected]:simonowendesign/simonowendesign.github.com.git |
Next, I did a git pull
, but I now get CONFLICT / auto-merging warnings on a load of files.
Next, git add .
again, then git commit -m 'merge'
, now try git push
again, now it's pushing all the files:
1 | $ git push |
So head back over to Github:
/github.com/simonowendesign/simonowendesign.github.io (no longer online)
Now I see all the folders and files and commit messages.
Where as sometimes I only see:
Question 7
After reading over this post and looking over my setup I'm thinking most of these issues are related and that it has something to do with me pushing / deploying my master
branch instead of a source
branch perhaps?
Finally just to top things off, when I ever successfully (in my mind) update my site I get an email saying:
Would greatly appreciate any help with this and hopefully it will help anyone else out who is having issues with Octopress.
So far I love Octopress and have a feeling that it's even more awesome but my noobness is getting in the way.
Browse by category:
- apple1
- bash1
- browser1
- case study4
- chrome2
- chrome dev tools4
- clojure overtone2
- conference2
- css2
- dev tips1
- digihike1
- dotfiles2
- event4
- ffconf1
- freelance6
- gaming2
- health3
- hexo1
- https1
- jank1
- javascript1
- jobs1
- lego1
- mcrfred107
- nux1
- octopress4
- photography2
- raspberry pi1
- responsive web design1
- sass1
- screencast1
- speaking2
- svg4
- unplugged6
- upfrontconf1
- web development2
- webgl1
- wordpress17
- work51
- workflow16