Upgrade to v1.2

This guide will help you migrate from Doks v1.1 to Doks v1.2.

Upgrade Doks

You can upgrade to Doks 1.2 by running the folowing command:

Update PostCSS settings

Add the highlighted lines to config/postcss.config.js:

PostCSS
postcss.config.js
 1const autoprefixer = require('autoprefixer');
 2const purgecss = require('@fullhuman/postcss-purgecss');
 3const whitelister = require('purgecss-whitelister');
 4
 5module.exports = {
 6  plugins: [
 7    autoprefixer(),
 8    purgecss({
 9      content: [ './hugo_stats.json' ],
10      extractors: [
11        {
12          extractor: (content) => {
13            const els = JSON.parse(content).htmlElements;
14            return els.tags.concat(els.classes, els.ids);
15          },
16          extensions: ['json'],
17        },
18      ],
19      dynamicAttributes: [
20        'aria-expanded',
21        'data-bs-popper',
22        'data-bs-target',
23        'data-bs-theme',
24        'data-dark-mode',
25        'data-global-alert',
26        'data-pane',             // tabs.js
27        'data-popper-placement',
28        'data-sizes',
29        'data-toggle-tab',       // tabs.js
30        'id',
31        'size',
32        'type',
33      ],
34      safelist: [
35        'active',
36        'btn-clipboard',         // clipboards.js
37        'clipboard',             // clipboards.js
38        'disabled',
39        'hidden',
40        'modal-backdrop',        // search-modal.js
41        'selected',              // search-modal.js
42        'show',
43        'img-fluid',
44        'blur-up',
45        'lazyloaded',
46        'container-fw ',
47        ...whitelister([
48          './assets/scss/**/*.css',
49          './assets/scss/**/*.scss',
50          // './node_modules/katex/dist/katex.css',
51          './node_modules/@hyas/doks-core/assets/scss/components/_code.scss',
52          './node_modules/@hyas/doks-core/assets/scss/components/_expressive-code.scss',
53          './node_modules/@hyas/doks-core/assets/scss/common/_syntax.scss',
54        ]),
55      ],
56    }),
57  ],
58}