-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a workaround until we understand how to fix this. AFAIK, the purgecss component excludes tags from the generated css so the resulting website was missing some tags. It is not clear why this happens only when executed on GH actions and not locally. Signed-off-by: Anastassios Nanos <[email protected]>
- Loading branch information
Showing
1 changed file
with
5 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,5 @@ | ||
const autoprefixer = require('autoprefixer'); | ||
const purgecss = require('@fullhuman/postcss-purgecss'); | ||
const whitelister = require('purgecss-whitelister'); | ||
|
||
module.exports = { | ||
plugins: [ | ||
autoprefixer(), | ||
purgecss({ | ||
content: [ './hugo_stats.json' ], | ||
extractors: [ | ||
{ | ||
extractor: (content) => { | ||
const els = JSON.parse(content).htmlElements; | ||
return els.tags.concat(els.classes, els.ids); | ||
}, | ||
extensions: ['json'], | ||
}, | ||
], | ||
dynamicAttributes: [ | ||
'aria-expanded', | ||
'data-bs-popper', | ||
'data-bs-target', | ||
'data-bs-theme', | ||
'data-dark-mode', | ||
'data-global-alert', | ||
'data-pane', // tabs.js | ||
'data-popper-placement', | ||
'data-sizes', | ||
'data-toggle-tab', // tabs.js | ||
'id', | ||
'size', | ||
'type', | ||
], | ||
safelist: [ | ||
'active', | ||
'btn-clipboard', // clipboards.js | ||
'clipboard', // clipboards.js | ||
'disabled', | ||
'hidden', | ||
'modal-backdrop', // search-modal.js | ||
'selected', // search-modal.js | ||
'show', | ||
'img-fluid', | ||
'blur-up', | ||
'lazyloaded', | ||
...whitelister([ | ||
'./assets/scss/**/*.css', | ||
'./assets/scss/**/*.scss', | ||
'./node_modules/katex/dist/katex.css', | ||
]), | ||
], | ||
}), | ||
], | ||
} | ||
const autoprefixer = require('autoprefixer') | ||
|
||
module.exports = { | ||
plugins: [autoprefixer()] | ||
} |