gitgithubnanoc

use nanoc for github pages


I tried using nanoc for generating a static blog on github pages. I found several tutorial and blogposts about it but they all seem out-dated and not working.

This is what I did:

  1. Install nanoc into diretory /MYNAME.github.io
  2. compile the default static site by executing nanoc
  3. create a Github repository called MYNAME.github.io
  4. in my directory I execute the following commands:

    git init

    git add .

    git commit -m "initial commit"

    git remote add origin https://github.com/MYNAME/MYNAME.github.io.git

    git push -u origin master

then all files in this directory will be uploaded to the repository.

However, I only get a 404 error when I go to http://MYNAME.github.io . But, I see the start page when I got to http://MYNAME.github.io/output/ .

Am I supposed to push only the output directory ?

Also, the start page is really ugly compared to when I run the nanoc server locally.


Solution

  • Am I supposed to push only the output directory ?

    Yes. Or rather only the contents of the output directory, which means running git init from within that folder instead of the top-level folder of your nanoc site.

    Also, the start page is really ugly compared to when I run the nanoc server locally.

    This is most likely because your page refers to a stylesheet at (say) /css/default.css, but because of how you've configured the git repository the stylesheet is actually available only at /output/css/default.css. Fix the first problem and this problem should go away as well.