how can i exclude files to being regenerated by docpad?

懵懂的女人 提交于 2019-12-10 11:36:13

问题


I'm working in a new skeleton for docpad using zurb's foundation 4.

you can check it out the progress here: https://github.com/dospuntocero/zurb-foundation.docpad

but every time i do a small change on the files it takes 8-12 seconds to regenerate files and it regenerate 47 files... no idea which ones (im just modifying one)

info: Generating...
info: Generated 47 files in 11.013 seconds
info: Regenerated at 22:15:08
info: Regenerating at 22:16:59
info: Generating...
info: Generated 47 files in 9.551 seconds
info: Regenerated at 22:17:09
info: Regenerating at 22:22:48

so it's kind of super slow, almost unusable. i'm using foundation 4 as a git submodule.


回答1:


If you modify a file, DocPad will also regenerate all files that reference other files, that being documents that do something like @getCollection, @include, @getDatabase, whatnot. It also includes stylsheets, as if I modify a stylesheet, I would expect that the stylesheets that import that stylesheet are also regenerated.

We can make this more intelligent, by keeping track of exactly which files documents reference. There is a discussion here about how we could accomplish such a thing - https://github.com/bevry/docpad/issues/336 - but it is a difficult task.

For the meantime, you can add standalone: true to your document's meta data - more info here. That will tell DocPad to only regenerate that one file, rather than all files that could possibly reference it. I use that a lot during development especially if I am modifying a particular file like crazy, then I remove them once development has settled down to ensure that file is always generated properly.



来源:https://stackoverflow.com/questions/16827193/how-can-i-exclude-files-to-being-regenerated-by-docpad

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!