Jekyll 站点需要 12-40 分钟才能在本地构建 - 帖子和相关帖子文件有问题吗?

Jekyll site takes 12-40 minutes to build locally - problem with posts and related posts files?

我有一个使用 Jekyll 和 GitHub 页面构建的小型个人博客。最近 building/serving 本地站点有时需要 12-40 分钟才能构建。以前在这台 PC 上需要一两分钟,尽管从那时起我可能添加了 10 posts。花费时间最长的两个文件很长时间没有更改,但我知道它们是构建的主要模板。

我多次使用 运行 --profile 标签,问题出在我的 _layouts/post.html_includes/post/related_posts.html 上,这是我的最新版本:

>jekyll build --profile
Configuration file: C:/Users/twulz/Documents/GitHub/Twulz.github.io/_config.yml
            Source: C:/Users/twulz/Documents/GitHub/Twulz.github.io
       Destination: C:/Users/twulz/Documents/GitHub/Twulz.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
  Populating LSI...
Rebuilding index...


| Filename                                                   | Count |    Bytes |     Time |
+------------------------------------------------------------+-------+----------+----------+
| _layouts/post.html                                         |    44 |  559.39K |  769.523 |
| _includes/post/related_posts.html                          |    47 |   49.21K |  769.309 |
| _layouts/default.html                                      |    70 | 2448.54K |    1.615 |
| _includes/asides.html                                      |    70 | 1218.71K |    1.115 |
| _includes/asides/archive_tabs.html                         |    70 |  926.82K |    0.556 |
| _includes/asides/recent_posts.html                         |    70 |  223.95K |    0.383 |
| _includes/libs/list_tags                                   |   115 |  626.27K |    0.325 |
| _includes/libs/list_categories                             |   115 |  319.43K |    0.219 |
| index.html                                                 |     1 |    9.07K |    0.185 |
| _includes/libs/list_pages                                  |    96 |   63.14K |    0.164 |
| page3/index.html                                           |     1 |    9.35K |    0.153 |
| page4/index.html                                           |     1 |    8.19K |    0.146 |
| blog/tags.html                                             |     1 |   53.22K |    0.137 |
| atom.xml                                                   |     1 |  505.68K |    0.127 |
| page2/index.html                                           |     1 |    8.91K |    0.115 |
| _includes/navbar.html                                      |    72 |  207.96K |    0.108 |
| _includes/post/post_meta.html                              |    47 |   62.26K |    0.085 |
| blog/categories.html                                       |     1 |   26.61K |    0.073 |
| _layouts/single-with-sidebar.html                          |     3 |    9.25K |    0.067 |
| page5/index.html                                           |     1 |    3.56K |    0.062 |
| assets/bootstrap-2.3.2/js/bootstrap.custom.js              |     1 |   27.96K |    0.058 |
| assets/bootstrap-2.1.1/js/bootstrap.custom.js              |     1 |   18.45K |    0.057 |
| _includes/libs/truncate_exec                               |     5 |    1.49K |    0.049 |
| _includes/bottom.html                                      |    72 |   95.14K |    0.043 |
| _includes/head.html                                        |    72 |  132.24K |    0.042 |
| blog/archives.html                                         |     1 |   11.13K |    0.034 |
| _includes/post/post_pagenation.html                        |    47 |   22.74K |    0.029 |
| sitemap.xml                                                |     1 |   10.63K |    0.026 |
| assets/js/script.js                                        |     1 |    4.50K |    0.022 |
| _includes/footer.html                                      |    72 |   13.08K |    0.018 |
| assets/bootstrap-2.3.2/css/bootstrap.custom.css            |     1 |  103.51K |    0.017 |
| assets/css/style.css                                       |     1 |    9.11K |    0.016 |
| _includes/asides/tweets.html                               |    70 |   38.62K |    0.016 |
| _layouts/single-no-sidebar.html                            |     2 |   20.16K |    0.013 |
| assets/bootstrap-2.3.2/css/bootstrap-responsive.custom.css |     1 |   16.57K |    0.013 |
| _includes/script.html                                      |    72 |   23.91K |    0.010 |
| _includes/header.html                                      |    72 |   12.16K |    0.009 |
| rss.xml                                                    |     1 |    7.57K |    0.006 |
| home.html                                                  |     1 |    2.01K |    0.006 |
| _includes/asides/about.html                                |    70 |   13.95K |    0.004 |
| _includes/libs/thumbnail                                   |    44 |    0.00K |    0.003 |
| _posts/2016-08-17-prusa3dPrinter-electronics.md            |     1 |    4.21K |    0.003 |
| engprojects/other/index.html                               |     1 |    1.58K |    0.003 |
| engprojects/printer/index.html                             |     1 |    1.51K |    0.002 |
| _posts/2016-02-18-rediscovering-the-blog.md                |     1 |   18.79K |    0.002 |
| engprojects/cube4x4x4/index.html                           |     1 |    1.39K |    0.002 |
| _posts/2018-10-10-Building-a-smart-parking-demo.md         |     1 |    5.36K |    0.002 |
| _includes/libs/truncate_start                              |     5 |    0.00K |    0.002 |
| _includes/post/socials_large.html                          |     3 |    3.71K |    0.002 |
| _includes/bootstrap-2.3.2/css/bootstrap.min.css            |     1 |  103.51K |    0.002 |
+------------------------------------------------------------+-------+----------+----------+
| TOTAL (for 50 files)                                       |  1450 | 8064.52K | 1544.978 |

                    done in 794.05 seconds.
 Auto-regeneration: disabled. Use --watch to enable.

这里是 _layouts/post.html - 我已经删除了社交网络标签(如果你比较 my Github Repo

---
layout: default
group: Blog
---
            <article class="single post">
                <header>
                    <h1>
                        <a href="{{ site.baseurl }}{{ page.url }}" rel="bookmark" title="Permanent link">{{ page.title }}</a>
                    </h1>
                    <p class="meta">
                        <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: site.date_format }}</time>
                    </p>
                </header>
                <div class="content">
{{ content }}
<br>
                </div>
                <footer>
{% include post/post_pagenation.html %}
{% include post/post_meta.html %}
{% include post/related_posts.html %}
                </footer>
            </article>

_includes/post/related_posts.html,我尝试使相关的 posts 循环仅输出 1 post - 其他 posts 表明循环增加了构建时间从 1 秒到 60 秒的领域,但它并没有彻底改变我的构建时间。

                    <nav id="related-posts" class="well">
                        <h3>You might also like</h3>
                        <ul>
{% for post in site.related_posts limit:5 %}
                            <li class="related-post">
                                <span>{{ post.date | date: site.date_format }}</span> - 
                                <a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>
                            </li>
{% endfor %}
                        </ul>
                    </nav>

我已经卸载并重新安装了 Jekyll,但没有任何变化。我在这里做错了什么 - 我还能看看什么来尝试缩短本地构建时间?

作为 GitHub Pages doesn't support lsi anyway,在我的 _config.yml 文件中设置 lsi:false 足以让我的本地构建时间缩短到 15 秒。

如上面的用户 ashmaroli 所示,这不是 真实 为什么我的构建时间突然增加的答案,但由于我的问题是 "What else can I look at to try to bring down this local built time?" 此修复足以满足我的需求,让我在更合理的时间范围内在本地进行编辑和服务(现在与生产站点相匹配),所以我将其标记为已解决。