Tucker McKnight
Move branches page to new template Change styling so that it uses bezel boxes instead of an unordered list. Has a placeholder for now where other info about each branch should go.
0
0
import {NavHelper} from './helpers/nav.ts'
export default async (
eleventyConfig: any,
data: any,
nav: ReturnType<typeof NavHelper>
) => {
const slugify = eleventyConfig.getFilter("slugify")
return `
<div class="d-flex flex-wrap">
${data.branches.map((branch) => {
return `
${branch.repoName === data.branchInfo.repoName
? `
<div class="card bezel-gray m-2 flex-grow-1">
<div class="card-header">
<a class="card-title" href="${data.reposPath}/${slugify(branch.repoName)}/branches/${slugify(branch.branchName)}">${branch.branchName}</a>
${branch.branchName === data.branchInfo.branchName ? '<div class="badge rounded-pill bg-secondary mx-1">current</div>' : ''}
${branch.branchName === data.reposConfig.repos[branch.repoName].defaultBranch ? '<div class="badge rounded-pill bg-info text-dark mx-1">default</div>' : ''}
</div>
<div class="card-body">Data about branch goes here</div>
</div>
`
: ''
}
`
}).join('')}
</div>
`
}
121
<a class="nav-link" href="${nav.repoCurrentBranchBranches()}">Branches</a>
121
<a class="nav-link ${data.navTab === 'branches' ? 'active' : ''}" href="${nav.repoCurrentBranchBranches()}">Branches</a>
19
19
import branchesJsTemplate from './js_templates/branches.ts'
266 267 268 269
// BRANCHES.NJK
const branchesTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/branches.njk`).toString()
'repos/branches.njk',
topLayoutPartial + branchesTemplate + bottomLayoutPartial,
266 267 268 269
// BRANCHES.TS
'repos/branches.11ty.js',
htmlPage(reposConfiguration, eleventyConfig, branchesJsTemplate),
286
path: "list"
286
path: "branches"