Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

What's the best way to handle publishing Nikola to GitHub pages?

632 views
Skip to first unread message

Brian Dant

unread,
Apr 20, 2013, 7:36:34 PM4/20/13
to nikola-...@googlegroups.com
As I understand it, GitHub pages requires an index.html in the root directory.  Nikola uses the output/ directory.  What is the best way to handle this?  With a git submodule?  Does anybody have experience publishing Nikola to GitHub pages?

Eduardo Schettino

unread,
Apr 20, 2013, 9:32:36 PM4/20/13
to nikola-...@googlegroups.com


On Sun, Apr 21, 2013 at 11:36 AM, Brian Dant <briand...@gmail.com> wrote:
As I understand it, GitHub pages requires an index.html in the root directory.  Nikola uses the output/ directory.  What is the best way to handle this?  With a git submodule?  Does anybody have experience publishing Nikola to GitHub pages?


I just publish only the "output" folder from nikola. And keep the source to generate my nikola blog in a separate repository.

Chris “Kwpolska” Warrick

unread,
Apr 21, 2013, 5:44:43 AM4/21/13
to Nikola—Discuss
> --
> You received this message because you are subscribed to the Google Groups
> "nikola-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nikola-discus...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

I, for one, have a `src` branch storing my virtualenv with Nikola. I
have two directories, ~/git/kwpolska.github.com-master and
~/kwpolska.github.com-src. I run `nikola build` followed by `nikola
deploy`:

DEPLOY_COMMANDS = ["rm -rf ~/git/kwpolska.gihub.com-master/*",
"rsync -rav output/* ~/git/kwpolska.github.com-master/",
"~/git/kwpolska.github.com-master/nikola-deploy"]

and, the last command is a script due to CWD-related bullshit — all
commands in DEPLOY_COMMANDS are run in the directory with conf.py and
`cd` doesn’t work. Here is the script:

#!/bin/zsh
cd ~/git/kwpolska.github.com-master/
git add *
git commit -as
git push origin master

--
Kwpolska <http://kwpolska.tk> | GPG KEY: 5EAAEA16
stop html mail | always bottom-post
http://asciiribbon.org | http://caliburn.nl/topposting.html

Roberto Alsina

unread,
Apr 21, 2013, 8:31:41 AM4/21/13
to nikola-...@googlegroups.com
I never thought about that. One solution of course is to just use a deploy script like you did, another is to use a
subshell, something like

DEPLOY_COMMANDS = ["foo in the folder with conf.py", "(cd output ; git foo bar baz)"]

I can't check the code right now, but if that doesn't work, it's just a matter of adding shell=True in the check_call usage.

Brian Dant

unread,
Apr 21, 2013, 10:55:51 AM4/21/13
to nikola-...@googlegroups.com
Oh, cool.  Is there a setting to de-couple the source from the output directory?

Roberto Alsina

unread,
Apr 21, 2013, 11:12:56 AM4/21/13
to nikola-...@googlegroups.com
You can put the output anywhere, just use the OUTPUT_FOLDER option


--

Brian Dant

unread,
Apr 21, 2013, 11:49:41 AM4/21/13
to nikola-...@googlegroups.com
On Sun, Apr 21, 2013 at 11:12 AM, Roberto Alsina <ral...@kde.org> wrote:
You can put the output anywhere, just use the OUTPUT_FOLDER option


Excellent!  This is perfect.  Thanks for your help.  I clearly overlooked this in the docs.  Great work with Nikola, Roberto!  I'm excited to get going with it :D

 

--
You received this message because you are subscribed to a topic in the Google Groups "nikola-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nikola-discuss/aDbsPtu4pNc/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to nikola-discus...@googlegroups.com.

Roberto Alsina

unread,
Apr 21, 2013, 6:13:25 PM4/21/13
to nikola-...@googlegroups.com
On 21/04/13 12:49, Brian Dant wrote:
On Sun, Apr 21, 2013 at 11:12 AM, Roberto Alsina <ral...@kde.org> wrote:
You can put the output anywhere, just use the OUTPUT_FOLDER option


Excellent!  This is perfect.  Thanks for your help.  I clearly overlooked this in the docs.  Great work with Nikola, Roberto!  I'm excited to get going with it :D

That's easy to do, Nikola has (ahem) perhaps a few options too many ;-)

Have fun, ping us for anything you run into.

Chris “Kwpolska” Warrick

unread,
Apr 22, 2013, 11:08:53 AM4/22/13
to Nikola—Discuss
On Mon, Apr 22, 2013 at 12:13 AM, Roberto Alsina
<ral...@netmanagers.com.ar> wrote:
> That's easy to do, Nikola has (ahem) perhaps a few options too many ;-)

Nikola is FOSS, and every piece of FOSS software must have a billion
options, just because they can’t afford a BDFL to make a choice good
for him and his cat only, like it is done in closed-source projects.

Roberto Alsina

unread,
Apr 22, 2013, 11:28:50 AM4/22/13
to nikola-...@googlegroups.com
On 22/04/13 12:08, Chris �Kwpolska� Warrick wrote:
> On Mon, Apr 22, 2013 at 12:13 AM, Roberto Alsina
> <ral...@netmanagers.com.ar> wrote:
>> That's easy to do, Nikola has (ahem) perhaps a few options too many ;-)
> Nikola is FOSS, and every piece of FOSS software must have a billion
> options, just because they can�t afford a BDFL to make a choice good
> for him and his cat only, like it is done in closed-source projects.

I am more of the "whatever dude" school of dictatorships.

Flavio Coelho

unread,
Jul 4, 2013, 7:48:41 AM7/4/13
to nikola-...@googlegroups.com
What I did was:

  • Assuming your Nikola site's folder is already a git repository,
  • on the root of the nikola project, create a src folder
  • move everything into it.
  • to set OUTPUT_FOLDER to ".."
  • do the necessary git add, git commit, etc
  • run nikola build and watch the build be deployed to the root of your git repo.
Hope it helps!

Flávio
Reply all
Reply to author
Forward
0 new messages