new_site/assets
George 64cf57fab3
Added support to PurgeCSS (#1562)
Tackled #1329 with [PurgeCSS](https://purgecss.com/).

Being talking with @varuniyer about using
[jekyll-uncss](https://github.com/episource/jekyll-uncss) to reduce css
file sizes by ditching unused classes. This approach have 3 main
problems:

1 - have some limitations as pointed
[here](https://github.com/alshedivat/al-folio/issues/1329#issuecomment-1546517327)
2 - last update to
[jekyll-uncss](https://github.com/episource/jekyll-uncss) was about 3
years ago, so it might have a few issues
3 - [uncss](https://github.com/uncss/uncss) haven't seem a new release
in a while, currently [lacking
maintenance](https://github.com/uncss/uncss/issues/459), and using some
deprecated libraries as seem here:

```
npm install -g uncss
npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
```

I thought about giving PurgeCSS a go, since it has been more [actively
maintaned](https://github.com/FullHuman/purgecss), but
[jekyll-purgecss](https://github.com/mhanberg/jekyll-purgecss) haven't.

For this, I needed to change to use some local libraries instead of
getting them via CDN. The good news is that it is quite effective in
reducing css file sizes. Comparing dir sizes with `du -hs
_site/assets/css/`:

| current | minify | PurgeCSS | PurgeCSS + minify |
| ------- | ------ | -------- | ----------------- |
| 1,1M    | 988K   | 456K     | 420K              |

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
2023-09-28 14:22:42 -03:00
..
audio Audio and Video support (#1367) 2023-05-15 12:31:27 -03:00
bibliography Issue 183 (#192) 2021-03-29 11:49:42 -04:00
css Added support to PurgeCSS (#1562) 2023-09-28 14:22:42 -03:00
fonts Added support to PurgeCSS (#1562) 2023-09-28 14:22:42 -03:00
img Optimize image qualities and a fix (#762) 2022-07-12 11:43:58 +05:30
js Added support to PurgeCSS (#1562) 2023-09-28 14:22:42 -03:00
json Add jsonresume support (#1547) 2023-07-11 23:26:25 -03:00
jupyter Added support for jupyter notebooks #417 (#1511) 2023-07-05 12:43:59 -03:00
pdf Include link and pdf in bib 2019-08-06 14:02:16 -04:00
plotly Add interactive plotly example to distill post (#1027) 2022-12-20 18:09:32 -05:00
video Audio and Video support (#1367) 2023-05-15 12:31:27 -03:00
webfonts Added support to PurgeCSS (#1562) 2023-09-28 14:22:42 -03:00