Add purgecss to css processing workflow
This commit is contained in:
parent
60bed163e3
commit
5da06e3a87
3 changed files with 17 additions and 1 deletions
|
@ -4,6 +4,9 @@ title = "MillironX"
|
|||
paginate = 5
|
||||
theme = "ananke"
|
||||
|
||||
[build]
|
||||
writeStats = true
|
||||
|
||||
[Params]
|
||||
cardImage = "saddles"
|
||||
motto = ""
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{{ $twbscss := resources.Get "node/node_modules/bootstrap/scss/bootstrap.scss" | resources.ToCSS }}
|
||||
{{ $mycss := resources.Get "styles/main.css" }}
|
||||
{{ $allcss := slice $twbscss $mycss | resources.Concat "css/bundle.css" }}
|
||||
{{ $allcsspure := $allcss | resources.PostCSS | minify | fingerprint | resources.PostProcess }}
|
||||
{{ $allcsspure := $allcss | resources.PostCSS (dict "nomap" true) | minify | fingerprint | resources.PostProcess }}
|
||||
<link href="{{ $allcsspure.Permalink }}" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
|
|
13
postcss.config.js
Normal file
13
postcss.config.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
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: [
|
||||
purgecss
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue