zachaysan
zachaysan

Reputation: 1826

How to stop nanoc from skipping content pages

So I've set up a nanoc site and everything is going well, the only problem is that there is some data in a lib that changes on nearly every compile. When I type

nanoc compile

Nanoc skips recompiling the site because it thinks that the view has not changed, but it has because the variable in the lib has taken on a new value since the last compiling!

I've tried going through config.yaml, but it doesn't look like there are any settings there. I can think of some ways to hack this, for example:

rm output/* && nanoc compile

But that seems hackish and will keep the site down while it is recompiling each page. Or I could do something along the lines of this:

echo "\n" >> content/index.html && nanoc compile

But that hurts me inside. What I would really like is a --force-compile flag or something.

Upvotes: 2

Views: 218

Answers (1)

Phrozen
Phrozen

Reputation: 559

As of nanoc 3.2, it is possible to write custom commands. Create a commands/ directory in your site directory and drop your commands there. A command is defined using a DSL and looks something like this:

http://nanoc.stoneship.org/docs/5-advanced-concepts/#writing-commands

Then you can create a force recompile custom command that just erases the lib or files you know are going to change.

Upvotes: 1

Related Questions