Performance

Get 100 scores on Google Lighthouse by default. Hyas removes unused css, prefetches links, and lazy loads images.

On this page

Google Lighthouse Scan Results Doks

See also Google Lighthouse: Scan Results for doks.netlify.app

Unused CSS removal

./config/postcss.config.js:

  1. const autoprefixer = require('autoprefixer');
  2. const purgecss = require('@fullhuman/postcss-purgecss');
  3. const whitelister = require('purgecss-whitelister');
  4. module.exports = {
  5. plugins: [
  6. autoprefixer(),
  7. purgecss({
  8. content: [
  9. './layouts/**/*.html',
  10. './content/**/*.md',
  11. ],
  12. safelist: [
  13. 'lazyloaded',
  14. 'table',
  15. 'thead',
  16. 'tbody',
  17. 'tr',
  18. 'th',
  19. 'td',
  20. ...whitelister([
  21. './assets/scss/components/_doks.scss',
  22. './assets/scss/components/_code.scss',
  23. './assets/scss/components/_search.scss',
  24. './assets/scss/common/_dark.scss',
  25. './node_modules/katex/dist/katex.css',
  26. ]),
  27. ],
  28. }),
  29. ],
  30. }

See also the PurgeCSS docs: Configuration, and the Purgecss Whitelister Readme.

Asset minification

Hyas uses Hugo to minify CSS, JS and HTML.

Hyas uses instant.page with default settings for link prefetching. By default, instant.page preloads 65 ms after hovering a link and when a mobile user starts touching their display.

See also the instant.page website: Intensity.

Lazy loading images

Hyas uses lazysizes with a Low Quality Image Placeholder (LQIP) to lazyload images added with the image shortcode. The LQIP is blurred with a CSS filter.

See also the lazysizes Readme