-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathjampack.config.mjs
More file actions
80 lines (69 loc) · 2 KB
/
jampack.config.mjs
File metadata and controls
80 lines (69 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// jampack.config.mjs — P-KISS-SBC
//
// Post-processing configuration for the MkDocs static site hosted on Netlify.
// Run after `mkdocs build` via `npm run optimize`.
//
// Netlify handles gzip/brotli compression on the fly — no need for static
// pre-compression. Focus is on image optimization, CSS inlining and prefetch.
export default {
// Disable jampack cache — ensures a clean pass on every CI build
nocache: true,
general: {
// Target modern browsers (aligns with mkdocs-material's own browserslist)
browserslist: "defaults, not IE 11",
},
css: {
// Inline critical CSS in <head> to eliminate render-blocking stylesheets
// and prevent flash of unstyled content on first load
inline_critical_css: true,
},
image: {
// Cap image width at 1200px — sufficient for technical documentation
max_width: 1200,
// srcset range: from HiDPI mobile (780px) to standard desktop (1200px)
srcset_min_width: 780,
srcset_max_width: 1200,
srcset_step: 200,
// JPEG quality (mozjpeg encoder)
jpeg: {
options: {
quality: 82,
mozjpeg: true,
},
},
// PNG compression (max level)
png: {
options: {
compressionLevel: 9,
},
},
// WebP quality for lossy and lossless
webp: {
options_lossless: {
effort: 5,
quality: 80,
mode: "lossless",
},
options_lossly: {
effort: 5,
quality: 80,
mode: "lossly",
},
},
svg: {
// Optimize SVGs via svgo (architecture diagrams, icons)
optimization: true,
// Add width/height attributes to prevent layout shift (CLS)
add_width_and_height: true,
},
// Do not process external images (twemoji CDN, GitHub badges, etc.)
external: {
process: "off",
},
},
misc: {
// Prefetch links that enter the viewport → near-instant navigation
// between doc pages (well suited for Netlify CDN edge caching)
prefetch_links: "in-viewport",
},
};