如何排除文件以通过docpad重新生成? [英] how can i exclude files to being regenerated by docpad?

查看:84
本文介绍了如何排除文件以通过docpad重新生成?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用zurb的基础4在docpad的新框架中工作.

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

您可以在此处查看进度: https://github.com/dospuntocero/zurb -foundation.docpad

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

但是每次我对文件进行小的更改时,它都需要8-12秒才能重新生成文件,并且它可以重新生成47个文件...不知道哪个文件(只是修改一个文件)

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

所以它有点慢,几乎无法使用.我将Foundation 4用作git子模块.

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

推荐答案

如果您修改文件,则DocPad还将重新生成所有引用其他文件的文件,这些文件是诸如@ getCollection,@ include,@ getDatabase,没什么.它还包括样式表,就像我修改样式表一样,我希望导入该样式表的样式表也将重新生成.

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.

通过准确跟踪文档引用的文件,我们可以使其更加智能.这里有一个关于我们如何完成这样的事情的讨论- https://github.com/bevry/docpad/issues/336 -但这是一项艰巨的任务.

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.

同时,您可以在文档的元数据中添加standalone: true-此处的更多信息.这将告诉DocPad仅重新生成一个文件,而不是所有可能引用该文件的文件.我在开发过程中经常使用它,特别是如果我像疯了那样修改特定文件时,一旦开发确定下来,便会删除它们,以确保始终正确生成文件.

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.

这篇关于如何排除文件以通过docpad重新生成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆