Tucker McKnight <tmcknight@instructure.com> | Mon Dec 29 2025
index page typescript template and styling WIP
35 36 37 38 39 40
repoBranchCommitsBase: () => repoBranchCommitsBase,
repoCurrentBranchCommits: () => `${repoBranchCommitsBase}page1`,
repoCurrentBranchBranches: () => `${currentBranchPath}/branches`,
homepageButtons: reposConfig.repos[repoName].defaultTemplateConfiguration?.homepageButtons
}
}
35 36 37 38 39 40
repoBranchCommitsBase: () => repoBranchCommitsBase,
repoCurrentBranchCommits: () => `${repoBranchCommitsBase}page1`,
repoCurrentBranchBranches: () => `${currentBranchPath}/branches`,
homepageButtons: reposConfig.repos[repoName].defaultTemplateConfiguration?.homepageButtons || []
}
}
16 17 18 19 20
import filesJsTemplate from './js_templates/files.ts'
import fileJsTemplate from './js_templates/file.ts'
import commitJsTemplate from './js_templates/commit.ts'
const ajv = new Ajv()
const exec = util.promisify(childProcess.exec)16 17 18 19 20 21
import filesJsTemplate from './js_templates/files.ts'
import fileJsTemplate from './js_templates/file.ts'
import commitJsTemplate from './js_templates/commit.ts'
import indexJsTemplate from './js_templates/index.ts'
const ajv = new Ajv()
const exec = util.promisify(childProcess.exec)250 251 252 253 254 255 256 257 258 259
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,
{
permalink: `${reposPath}/index.html`,
}250 251 252 253 254 255 256 257 258
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.TS
eleventyConfig.addTemplate(
'repos/index.11ty.js',
indexJsTemplate(eleventyConfig),
{
permalink: `${reposPath}/index.html`,
}280 281
[data-bs-theme=dark] [data-type=after] mark, [data-bs-theme=dark] .token.inserted {
background-color: rgba(51, 247, 160, .1); /* different green for dark mode; looks better */
}280 281 282
[data-bs-theme=dark] [data-type=after] mark, [data-bs-theme=dark] .token.inserted {
background-color: rgba(51, 247, 160, .1); /* different green for dark mode; looks better */
}
55 56 57 58 59 60
description: reposConfig.repos[repoName].description,
branches,
cloneUrl: cloneUrl.cloneUrl(reposConfig.baseUrl, repoName),
defaultBranch: "main",
tags: [], // todo
commits,
})55 56 57 58 59 60
description: reposConfig.repos[repoName].description,
branches,
cloneUrl: cloneUrl.cloneUrl(reposConfig.baseUrl, repoName),
defaultBranch: reposConfig.repos[repoName].defaultBranch,
tags: [], // todo
commits,
})