Tucker McKnight <tmcknight@instructure.com> | Wed Jul 22 2026
Use nav for pagination Also, more detailed output on configuration errors.
31 32 33 34 35 36
const validator = ajv.compile(ConfigSchema)
const valid = validator(reposConfiguration)
if (!valid) {
throw new Error(validator.errors.map(error => `config object at ${error.instancePath.replaceAll("/", ".")}: ${error.message}`).join("\n"))
}
return async ({directories}) => {31 32 33 34 35 36 37
const validator = ajv.compile(ConfigSchema)
const valid = validator(reposConfiguration)
if (!valid) {
console.log(validator.errors)
throw new Error(validator.errors.map(error => `config object at ${error.instancePath.replaceAll("/", ".")}, ${error.params.toString()}: ${error.message}`).join("\n"))
}
return async ({directories}) => {650 651 652 653 654 655
commitsInRepos,
permalink: (data) => {
const repoName = data.patchInfo.repoName
return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/commits/${data.patchInfo.commit.hash}/`
},
eleventyComputed: {
nav: {650 651 652 653 654 655 656 657 658 659 660 661 662 663
commitsInRepos,
permalink: (data) => {
const repoName = data.patchInfo.repoName
const nav = NavHelper({
reposConfig: reposConfiguration,
slugify,
currentRepoName: repoName,
currentRefName: data.patchInfo.commit.hash,
currentRefType: 'commit',
})
return nav.commit(data.patchInfo.commit.hash) + '/'
},
eleventyComputed: {
nav: {682 683 684 685 686 687 688 689 690
alias: "flatRef",
},
permalink: (data) => {
const repoName = data.flatRef.repoName
const refName = data.flatRef.refName
const refType = data.flatRef.type
return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/${refType}/${eleventyConfig.getFilter("slugify")(refName)}/commits.xml`
},
eleventyComputed: {
currentRepo: (data) => reposData.find(repo => {682 683 684 685 686 687 688 689 690 691 692 693 694 695
alias: "flatRef",
},
permalink: (data) => {
const nav = NavHelper({
reposConfig: reposConfiguration,
slugify,
currentRepoName: data.flatRef.repoName,
currentRefName: data.flatRef.refName,
currentRefType: data.flatRef.type,
})
return nav.rssFeed()
},
eleventyComputed: {
currentRepo: (data) => reposData.find(repo => {