Skip to content

Commit f98be70

Browse files
committed
Update blog post
1 parent 052da93 commit f98be70

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

hydejack/_posts/2019-02-18-improving-site-build-speed.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For more, see the [Jekyll docs](https://jekyllrb.com/docs/configuration/#build-c
1616
With that out of the way, here are three ways to improve Hydejack's production build speed:
1717

1818

19-
## 1. Disable Inline CSS
19+
## Disable Inline CSS
2020
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.
2121

2222
To disable this optimization, set `no_inline_css` to `true` in the config file.
@@ -26,7 +26,7 @@ hydejack:
2626
no_inline_css: true
2727
```
2828
29-
## 2. Disable Per-Page Styles
29+
## Disable Per-Page Styles
3030
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).
3131

3232
To disable this feature, set `no_page_style` to `true` in the config file.
@@ -36,7 +36,18 @@ hydejack:
3636
no_page_style: true
3737
```
3838

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
4051
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.
4152
Staring with version 8.3.0, you can define sidebar entries in the config file under the `menu` key like so:
4253

@@ -56,3 +67,23 @@ Note that the old way of doing things still works if you upgrade to 8.3.0. Only
5667
{:.message}
5768

5869

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.
72+
73+
```yml
74+
# file: _config.yml
75+
hydejack:
76+
no_inline_css: true
77+
no_page_style: true
78+
use_lsi: true
79+
80+
menu:
81+
- title: Blog
82+
url: /blog/
83+
- title: Projects
84+
url: /projects/
85+
- title: Resume
86+
url: /resume/
87+
- title: About
88+
url: /about/
89+
```

0 commit comments

Comments
 (0)