Excluding an experimental file from compile

14 views
Skip to first unread message

Dave Everitt

unread,
Nov 1, 2022, 7:19:28 PM11/1/22
to nanoc
Simple Q: is there a way to exclude a file when running nanoc compile (in this case an experimental .html file placed in "content" so I can preview it with all the site’s styles etc.)?

Denis Defreyne

unread,
Nov 5, 2022, 7:18:31 AM11/5/22
to noreply-spamdigest
Hey there,

The approach I use in this case is to remove the file (from memory) in the preprocessor:

    preprocess do
      @items.delete_if { |i| i[:draft] }
    end

This won’t delete the file from the filesystem, but will make Nanoc forget about it, as if it never existed.

Hope this helps,

Denis Defreyne
[dəˈni] • pronouns: he/him


On Wed, Nov 2, 2022, at 00:19, Dave Everitt wrote:
Simple Q: is there a way to exclude a file when running nanoc compile (in this case an experimental .html file placed in "content" so I can preview it with all the site’s styles etc.)?


--
You received this message because you are subscribed to the Google Groups "nanoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nanoc+un...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages