gpt4 book ai didi

ruby - Jekyll 中的缓慢再生

转载 作者:数据小太阳 更新时间:2023-10-29 08:36:45 25 4
gpt4 key购买 nike

我正在使用 jekyll 开发一个博客,到目前为止我对它非常满意。但是随着我发布更多帖子,再生时间变得荒谬(3-4 分钟)。每次进行更改时都等待那么长时间是不可行的。

规范:

  • ruby 2.2.1
  • 杰基尔 2.5.3
  • Markdown :kramdown
  • 荧光笔:pygments
  • 固定链接:漂亮
  • 使用 2 GB RAM 使用云服务 (Cloud9)
  • 帖子不多(约 10 篇),但我确实使用了很多数据(“_data”文件夹中有 10 MB 的 json 文件,“img”文件夹中有 14 MB 的图像)
  • “_site”文件夹的总大小为 40 MB

这些规范是否正常?

我已经更新到 Jekyll 3.0 以尝试增量再生,但它对我的情况没有帮助。

有什么想法吗?

谢谢!

威廉

最佳答案

在您的网站上运行 jekyll serve --profile 并检查哪些内容需要更多时间来呈现。它应该输出一个看起来像这样的表格。

Filename                                                              | Count |    Bytes |  Time
----------------------------------------------------------------------+-------+----------+------
_layouts/compress.html | 73 | 1649.86K | 1.526
_layouts/default.html | 72 | 1874.79K | 0.445
_layouts/post.html | 58 | 980.02K | 0.307
_posts/2015-12-10-how-to-create-and-host-a-website-on-github-pages.md | 1 | 9.36K | 0.294
feed.xml | 1 | 34.74K | 0.105
_includes/prev-next.html | 58 | 39.17K | 0.053
sitemap.xml | 1 | 19.90K | 0.035
_pages/archive.md | 1 | 28.98K | 0.035
_posts/2017-02-15-jekyll-sort-filters.md | 1 | 16.09K | 0.019
_includes/ga_data_fetch.html | 58 | 41.77K | 0.018
_includes/disqus-script.html | 58 | 30.89K | 0.018
_pages/tags.html | 1 | 14.97K | 0.015

这应该能让您清楚地知道问题出在哪里。

现在,在对站点进行更改时,如果您只想呈现更改的文件,请使用 jekyll serve --incrementaljekyll serve -I

增量构建仍然存在 Jekyll 团队正在处理的一些问题。

仅呈现您正在撰写的最新帖子的便捷选项是 jekyll serve --watch --limit_posts 1。这在撰写新帖子时为我节省了大量时间。

关于ruby - Jekyll 中的缓慢再生,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33524335/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com