Skip to content

Instantly share code, notes, and snippets.

@agonzalezro
Created May 3, 2013 12:59
Show Gist options
  • Save agonzalezro/5508975 to your computer and use it in GitHub Desktop.
Save agonzalezro/5508975 to your computer and use it in GitHub Desktop.
A question about how to manage branches for my blog

Hi g(uy|irl)s!

This is my blog source code: https://github.com/agonzalezro/agonzalezro.github.com

I have a Makefile (https://github.com/agonzalezro/agonzalezro.github.com/blob/master/Makefile) that:

  1. delete all the old generated html and folders
  2. it will avoid the deletion of my blog source code: _source, _content, Makefile, etc...
  3. it will generate the blog again
  4. push to master

I was trying to create a gh-pages branches like in other github project to store there the html generated code. But it doesn't seem to work in the same way that other GH projects.

My question is, how can I have a clean source and a clean generated files?

I was thinking on perhaps have a branch source where I have my pelican source code, and then use master only for the HTML generated documentation.

Any idea?

@justinmayer
Copy link

Have you already reviewed the docs on this topic?

@agonzalezro
Copy link
Author

Hey @justinmayer, thanks for your reply.

I was checking it but I didn't try it TBH, why? Because I think that is not exactly what I am looking for, I will explain:

With the solution on the documentation you will have a local gh-pages with the content of the output folder & a local master branch with all your code (with output there too (or not, if you remove it or you gitignore it)).

Something like this:

[master]
  content/
    fantastic_article.rst    
  output/
    fantastic_article.html
    index.html
  themes/
    ...
  pelicanconf.py
  foo
  bar

[gh-pages]
  index.html
  fantastic_article.html

When you push it from local gh-pages to master server side you will have this (in the github repo):

[master]
  content/
    fantastic_article.rst    
  output/
    fantastic_article.html
    index.html
  themes/
    ...
  pelicanconf.py
  foo
  bar
  index.html
  fantastic_article.html

(Check that the .htmls are on the / of master).

Please, fix me if I am wrong. But the next time that you clone your repo you will have the "mess" locally.

In the other hand, what I think that I would do is have 2 branches locally and server. One called pelican where I will have configuration, contents, themes... and I will usually work on it. Then I will try to create a small script to compile the pages to the master branch instead to the pelican branch.

Thanks again for your interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment