I run renderSegments for one section and Hugo edits the hugo_stats.json file stripping all other classes out (and this appearing as a change to commit in VS Code/Codium). Is this by design? (This breaks design of several areas of my blog like the homepage. Should rendersegment be used with hugo server btw?)
That is a good question. The renderSegments filter currently only limits what gets rendered, everything else behaves the same. And the hugo_stats.json gets built based on what gets rendered.
I have created renderSegments vs hugo_stats.json · Issue #14939 · gohugoio/hugo · GitHub to track this.