Tucker McKnight <tucker.mcknight@gmail.com> | Sun Sep 14 2025
Fix some node module nonsense idk Also use import.meta.dirname instead of __dirname because that's what's available when using es modules.
30 31 32 33 34 35 36
return pathParts[pathParts.length - 1]
})
const vendor = `${__dirname}/vendor`
const frontend = `${__dirname}/frontend`
eleventyConfig.addPassthroughCopy({
[vendor]: `${reposPath}/vendor`,30 31 32 33 34 35 36
return pathParts[pathParts.length - 1]
})
const vendor = `${import.meta.dirname}/vendor`
const frontend = `${import.meta.dirname}/frontend`
eleventyConfig.addPassthroughCopy({
[vendor]: `${reposPath}/vendor`,209 210 211 212 213 214 215 216 217 218
eleventyConfig.addFilter("jsonStringify", data => JSON.stringify(data))
const topLayoutPartial = fsImport.readFileSync(`${__dirname}/partial_templates/main_top.njk`).toString()
const bottomLayoutPartial = fsImport.readFileSync(`${__dirname}/partial_templates/main_bottom.njk`).toString()
// INDEX.NJK
const indexTemplate = fsImport.readFileSync(`${__dirname}/templates/index.njk`).toString()
eleventyConfig.addTemplate(
'repos/index.njk',
topLayoutPartial + indexTemplate + bottomLayoutPartial,209 210 211 212 213 214 215 216 217 218
eleventyConfig.addFilter("jsonStringify", data => JSON.stringify(data))
const topLayoutPartial = fsImport.readFileSync(`${import.meta.dirname}/partial_templates/main_top.njk`).toString()
const bottomLayoutPartial = fsImport.readFileSync(`${import.meta.dirname}/partial_templates/main_bottom.njk`).toString()
// INDEX.NJK
const indexTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/index.njk`).toString()
eleventyConfig.addTemplate(
'repos/index.njk',
topLayoutPartial + indexTemplate + bottomLayoutPartial,223 224 225 226 227 228
)
// BRANCHES.NJK
const branchesTemplate = fsImport.readFileSync(`${__dirname}/templates/branches.njk`).toString()
eleventyConfig.addTemplate(
'repos/branches.njk',
topLayoutPartial + branchesTemplate + bottomLayoutPartial,223 224 225 226 227 228
)
// BRANCHES.NJK
const branchesTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/branches.njk`).toString()
eleventyConfig.addTemplate(
'repos/branches.njk',
topLayoutPartial + branchesTemplate + bottomLayoutPartial,249 250 251 252 253 254
)
// FILE.NJK
const fileTemplate = fsImport.readFileSync(`${__dirname}/templates/file.njk`).toString()
const flatFilesData = flatFiles(reposData)
eleventyConfig.addTemplate(
'repos/file.njk',249 250 251 252 253 254
)
// FILE.NJK
const fileTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/file.njk`).toString()
const flatFilesData = flatFiles(reposData)
eleventyConfig.addTemplate(
'repos/file.njk',277 278 279 280 281 282
)
// FILES.NJK
const filesTemplate = fsImport.readFileSync(`${__dirname}/templates/files.njk`).toString()
eleventyConfig.addTemplate(
'repos/files.njk',
topLayoutPartial + filesTemplate + bottomLayoutPartial,277 278 279 280 281 282
)
// FILES.NJK
const filesTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/files.njk`).toString()
eleventyConfig.addTemplate(
'repos/files.njk',
topLayoutPartial + filesTemplate + bottomLayoutPartial,303 304 305 306 307 308
)
// REPO.NJK
const repoTemplate = fsImport.readFileSync(`${__dirname}/templates/repo.njk`).toString()
eleventyConfig.addTemplate(
'repos/repo.njk',
topLayoutPartial + repoTemplate + bottomLayoutPartial,303 304 305 306 307 308
)
// REPO.NJK
const repoTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/repo.njk`).toString()
eleventyConfig.addTemplate(
'repos/repo.njk',
topLayoutPartial + repoTemplate + bottomLayoutPartial,329 330 331 332 333 334
)
// PATCHES.NJK
const patchesTemplate = fsImport.readFileSync(`${__dirname}/templates/patches.njk`).toString()
const paginatedPatchesData = await paginatedPatches(reposData)
eleventyConfig.addTemplate(
`repos/patches.njk`,329 330 331 332 333 334
)
// PATCHES.NJK
const patchesTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/patches.njk`).toString()
const paginatedPatchesData = await paginatedPatches(reposData)
eleventyConfig.addTemplate(
`repos/patches.njk`,357 358 359 360 361 362
)
// PATCH.NJK
const patchTemplate = fsImport.readFileSync(`${__dirname}/templates/patch.njk`).toString()
const flatPatchesData = await flatPatches(reposConfiguration)
eleventyConfig.addTemplate(
`repos/patch.njk`,357 358 359 360 361 362
)
// PATCH.NJK
const patchTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/patch.njk`).toString()
const flatPatchesData = await flatPatches(reposConfiguration)
eleventyConfig.addTemplate(
`repos/patch.njk`,386 387 388 389 390 391
)
// FEED.NJK
const feedTemplate = fsImport.readFileSync(`${__dirname}/templates/feed.njk`).toString()
eleventyConfig.addTemplate(
`repos/feed.njk`,
feedTemplate,386 387 388 389 390 391
)
// FEED.NJK
const feedTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/feed.njk`).toString()
eleventyConfig.addTemplate(
`repos/feed.njk`,
feedTemplate,0 1 2 3
{
"name": "eleventy-plugin",
"version": "1.0.0",
"main": "dist/main.js",
"scripts": {0 1 2 3 4
{
"name": "eleventy-plugin",
"type": "module",
"version": "1.0.0",
"main": "dist/main.js",
"scripts": {2 3 4 5 6 7 8
"allowSyntheticDefaultImports": true,
"rewriteRelativeImportExtensions": true,
"noImplicitAny": false,
"module": "nodenext",
"target": "es2017",
"lib": ["es2023", "dom"],
"allowJs": true,
"outDir": "dist"2 3 4 5 6 7 8
"allowSyntheticDefaultImports": true,
"rewriteRelativeImportExtensions": true,
"noImplicitAny": false,
"module": "node18",
"target": "es6",
"lib": ["es2023", "dom"],
"allowJs": true,
"outDir": "dist"