chore: drop build steps, deps + fix meta for cms-generated pages
This commit is contained in:
parent
372d80f2fe
commit
bfbd5bf767
7 changed files with 39 additions and 298 deletions
29
.eleventy.js
29
.eleventy.js
|
@ -4,9 +4,8 @@ import lightningCSS from '@11tyrocks/eleventy-plugin-lightningcss'
|
|||
import markdownIt from 'markdown-it'
|
||||
import markdownItAnchor from 'markdown-it-anchor'
|
||||
import markdownItFootnote from 'markdown-it-footnote'
|
||||
import htmlmin from 'html-minifier-terser'
|
||||
import filters from './config/filters/index.js'
|
||||
import { copy404Page, minifyJsComponents } from './config/events/index.js'
|
||||
import { copyErrorPages } from './config/events/index.js'
|
||||
import { popularPosts, processContent } from './config/collections/index.js'
|
||||
import { DateTime } from 'luxon'
|
||||
|
||||
|
@ -91,32 +90,8 @@ export default async function (eleventyConfig) {
|
|||
eleventyConfig.addShortcode('appVersion', () => appVersion)
|
||||
eleventyConfig.addShortcode('currentYear', () => DateTime.now().year)
|
||||
|
||||
// transforms
|
||||
eleventyConfig.addTransform('html-minify', (content, path) => {
|
||||
if (path && path.endsWith('.html')) {
|
||||
return htmlmin.minify(content, {
|
||||
collapseBooleanAttributes: true,
|
||||
collapseWhitespace: true,
|
||||
decodeEntities: true,
|
||||
includeAutoGeneratedTags: false,
|
||||
minifyCSS: true,
|
||||
minifyJS: true,
|
||||
minifyURLs: true,
|
||||
noNewlinesBeforeTagClose: true,
|
||||
quoteCharacter: '"',
|
||||
removeComments: true,
|
||||
sortAttributes: true,
|
||||
sortClassName: true,
|
||||
useShortDoctype: true,
|
||||
processScripts: ['application/ld+json'], // minify JSON-LD scripts
|
||||
})
|
||||
}
|
||||
return content
|
||||
})
|
||||
|
||||
// events
|
||||
eleventyConfig.on('afterBuild', copy404Page)
|
||||
eleventyConfig.on('afterBuild', minifyJsComponents)
|
||||
eleventyConfig.on('afterBuild', copyErrorPages)
|
||||
|
||||
return {
|
||||
passthroughFileCopy: true,
|
||||
|
|
Reference in a new issue