You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hydejack/_posts/2019-02-18-improving-site-build-speed.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ For more, see the [Jekyll docs](https://jekyllrb.com/docs/configuration/#build-c
16
16
With that out of the way, here are three ways to improve Hydejack's production build speed:
17
17
18
18
19
-
## 1. Disable Inline CSS
19
+
## Disable Inline CSS
20
20
Inlining critial CSS into each page increases page load speed in the browser, but it also introduces a *significant* build time increase. This is due to `scssify` being called for every single page with a large chunk of Hydejack's SCSS as input.
21
21
22
22
To disable this optimization, set `no_inline_css` to `true` in the config file.
@@ -26,7 +26,7 @@ hydejack:
26
26
no_inline_css: true
27
27
```
28
28
29
-
## 2. Disable Per-Page Styles
29
+
## Disable Per-Page Styles
30
30
Hydejack allows you to change the accent color on a per-page basis. While this is a neat feature, it's certainly not necessary and many sites don't use it. Similar to inline CSS, it involves a call to `scssify` per page, which increases build time (though to a lesser extent).
31
31
32
32
To disable this feature, set `no_page_style` to `true` in the config file.
@@ -36,7 +36,18 @@ hydejack:
36
36
no_page_style: true
37
37
```
38
38
39
-
## 3. Define Sidebar Entries in the Config File
39
+
## Use Simpler Related Posts
40
+
41
+
Hydejack does some clever things to show more related "Related Posts" on the bottom of blog posts. However, clever things (implemented within the liquid templating engine) take time, and this becomes apparent when trying to build a site with 10,000 posts.
42
+
43
+
To speed up buidling further, set the (admittedly poorly named) `use_lsi` option to `true`:
44
+
45
+
```yml
46
+
hydejack:
47
+
use_lsi: true
48
+
```
49
+
50
+
## Define Sidebar Entries in the Config File
40
51
In previous versions of Hydejack adding entries to the sidebar was done by setting `menu` to `true` in the front matter of a page. This meant that finding the sidebar entries required checking every page for the `menu` flag, once per page. This was slow and the time increased quadratically with the number of pages.
41
52
Staring with version 8.3.0, you can define sidebar entries in the config file under the `menu` key like so:
42
53
@@ -56,3 +67,23 @@ Note that the old way of doing things still works if you upgrade to 8.3.0. Only
56
67
{:.message}
57
68
58
69
70
+
## Conclusion
71
+
Hydejack's default settings are fine for small personal blogs of around 100 pages. However, when building large sites with 1,000 pages or more, build time becomes an issue. The following settings will help, but can't overcome the inherent limitations of Jekyll.
0 commit comments