Import existing blog posts
This commit is contained in:
@@ -7,7 +7,13 @@ import * as opml from 'opml';
|
||||
export default function (eleventyConfig) {
|
||||
eleventyConfig.setInputDirectory("src")
|
||||
eleventyConfig.addPlugin(pugPlugin);
|
||||
eleventyConfig.addPlugin(eleventyImageTransformPlugin);
|
||||
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
|
||||
htmlOptions: {
|
||||
imgAttributes: {
|
||||
alt: '',
|
||||
},
|
||||
},
|
||||
});
|
||||
eleventyConfig.addPlugin(EleventyRenderPlugin);
|
||||
eleventyConfig.addPassthroughCopy("src/assets/**")
|
||||
|
||||
@@ -18,7 +24,7 @@ export default function (eleventyConfig) {
|
||||
for ( const post of posts ) {
|
||||
const year = post.date.getFullYear()
|
||||
if ( !postsByYear[year] ) postsByYear[year] = []
|
||||
postsByYear[year].push(post)
|
||||
postsByYear[year] = [post, ...postsByYear[year]]
|
||||
if ( !years.includes(year) ) years.push(year)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user