Age | Commit message (Collapse) | Author |
|
|
|
E.g.
* AlpinesJS' :class="isTrue 'class1' : 'class2'"
* And dynamic classes with colon in them, e.g. `hover:bg-white`
|
|
Fixes #11202
|
|
Mostly to make it easier to toggle on/off this feature from the env.
See #11191
|
|
So you can do
```toml
[build.writeStats]
tags = true
classes = true
ids = false
```
Fixes #11191
|
|
Most notably better handling self-closing elements
Closes #10698
|
|
```
name old time/op new time/op delta
ElementsCollectorWriterPre-10 25.2µs ± 1% 3.4µs ± 0% -86.54% (p=0.029 n=4+4)
name old alloc/op new alloc/op delta
ElementsCollectorWriterPre-10 624B ± 0% 142B ± 0% -77.18% (p=0.029 n=4+4)
name old allocs/op new allocs/op delta
ElementsCollectorWriterPre-10 16.0 ± 0% 6.0 ± 0% -62.50% (p=0.029 n=4+4)
```
Fixes #10698
|
|
Fixes #8530
|
|
This reverts commit ef0f1a726901d6c614040cfc2d7e8f9a2ca97816.
|
|
This reverts commit a9bcd38181ceb79afba82adcd4de1aebf571e74c.
|
|
As in: Do not retain the input slice.
|
|
Fixes #8530
|
|
|
|
|
|
- Reorder code blocks
- Rename cssClassCollectorWriter to htmlElementCollectorWriter, as it just collect html element information
- Expand benchmark to test for minified and unminified content
Fixes #8396
Fixes #8417
|
|
Updates #7567
|
|
Fixes #7958
|
|
|
|
See https://github.com/mvdan/gofumpt
|
|
```
name old time/op new time/op delta
ClassCollectorWriter-16 72.1µs ± 0% 32.3µs ± 0% -55.17% (p=0.029 n=4+4)
name old alloc/op new alloc/op delta
ClassCollectorWriter-16 85.9kB ± 0% 35.1kB ± 0% -59.16% (p=0.029 n=4+4)
name old allocs/op new allocs/op delta
ClassCollectorWriter-16 329 ± 0% 149 ± 0% -54.71% (p=0.029 n=4+4)
```
Fixes #7945
|
|
Fixes #7746
|
|
Fixes #7509
|
|
Fixes #7318
|
|
Fixes #7216
|
|
Also add a related stresstest.
Fixes #7161
|
|
The main use case for this is to use with resources.PostProcess and resources.PostCSS with purgecss.
You would normally set it up to extract keywords from your templates, doing it from the full /public takes forever for bigger sites.
Doing the template thing misses dynamically created class names etc., and it's hard/impossible to set up in when using themes.
You can enable this in your site config:
```toml
[build]
writeStats = true
```
It will then write a `hugo_stats.json` file to the project root as part of the build.
If you're only using this for the production build, you should consider putting it below `config/production`.
You can then set it up with PostCSS like this:
```js
const purgecss = require('@fullhuman/postcss-purgecss')({
content: [ './hugo_stats.json' ],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
}
});
module.exports = {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
]
};
```
Fixes #6999
|