Jekyll编译似乎太慢了 [英] Jekyll compiling seems WAY too slow

查看:354
本文介绍了Jekyll编译似乎太慢了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是第一次与Jekyll建立网站.到目前为止,我一直很喜欢.我唯一的问题是构建时间非常长.现在,当我运行jekyll build时,大约需要30秒钟来生成站点.

I'm building a site with Jekyll for the first time. I'm loving it so far; my only problem is the exceedingly long build times. Right now, when I run jekyll build, it takes about 30 seconds to generate the site.

30秒可能看起来并不多,但是目前,整个网站只有一个帖子,其中包括8个帖子,8个布局和2个小插件.据我所知,我并没有滥用液体标签,而且如果我删除了这些插件,它仍然需要花费同样长的时间.

30 seconds might not seem like a lot, but at the moment, the entire site only has ONE post, 8 includes, 8 layouts, and 2 small plugins. I haven't abused liquid tags to my knowledge, and if I remove the plugins, it still takes just as long.

在寻找答案时,我所能找到的人都是那些拥有数百篇文章的大型博客的人.由于我只有一个帖子,所以这显然不是问题-这里还有其他事情要花这么长时间.

When searching for an answer, all I can find are people who have huge blogs with hundreds of posts. Since I only have one post, that's obviously not the issue - there's something else going on here to make it take so long.

这是我网站的github存储库: https://github.com/keithpickering/kpd/

Here is my site's github repository: https://github.com/keithpickering/kpd/

我的问题如下:

  1. Jekyll没有太多建物的时候,建树这么慢的一些可能原因是什么?

  1. What are some possible reasons for Jekyll building so slowly when it doesn't have all that much to build?

如果Jekyll本质上很慢,是否有一种简单的方法可以分别编译CSS和JS,让Jekyll只处理标记?现在,我让Jekyll忽略了我的"css"和"js"文件夹,而是让Grunt缩小,前缀并自动编译这些文件.我也从未使用过Grunt,所以我不知道这是否是我正在使用的某种荒谬的解决方案.

If Jekyll is just inherently slow, is there a simple way to compile my CSS and JS separately, leaving Jekyll to deal with just the markup? Right now I have Jekyll ignore my "css" and "js" folders, instead having Grunt minify, prefix, and compile those files automatically. I've also never used Grunt before so I have no idea if this is some sort of absurdly hacky solution that I'm using.

感谢您的帮助!

应该早点提到这一点,但是我在Windows 8.1 x64上.我开始认为Jekyll只是对Windows的支持不佳.

Should've mentioned this sooner, but I'm on Windows 8.1 x64. I'm beginning to think Jekyll just has shaky support for Windows.

推荐答案

我遇到了类似的问题,但幸运的是找到了原因和解决方法:

I ran into a similar problem, but luckily found the reason and a solution:

我的jekyll设置没有使用任何插件,没有复杂的液体标签,仅包含3个示例帖子,没有其他内容.但是建设该网站平均仍需6秒钟.

My jekyll setup wasn't using any plugins, no complicated liquid tags, only contained 3 sample posts and nothing else. But building the site still took 6 seconds on average.

仅当我逐步删除目录中的所有内容时,我才发现造成长时间构建的原因:node_modules文件夹.

Only when I removed everthing in the directory step by step I found out what was causing the long build times: the node_modules folder.

通过将以下内容放在_config.yml中,可以从jekyll转换中排除node_modules目录:

You can exclude the node_modules directory from the jekyll conversion by putting the following in _config.yml:

exclude: [node_modules]

或者:

exclude:
    - node_modules

有关exclude的更多信息可以在jekyll 文档中找到.

More information about exclude can be found in the jekyll documentation.

这篇关于Jekyll编译似乎太慢了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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