Files snapshot from main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
da80ba Tucker McKnight
88b515 Tucker McKnight
3700da Tucker McKnight
88b515 Tucker McKnight
3700da Tucker McKnight
7f8822 Tucker McKnight
7f8822 Tucker McKnight
7f8822 Tucker McKnight
7f8822 Tucker McKnight
88b515 Tucker McKnight
7f8822 Tucker McKnight
3700da Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
868131 Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
0b4cba Tucker McKnight
b97c1a Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
da80ba Tucker McKnight
651585 Tucker McKnight
3700da Tucker McKnight
3700da Tucker McKnight
7f8822 Tucker McKnight
import m from 'mithril'
import { type SortedFileList, type Repository } from "../src/dataTypes.ts"
import htmlPage from './common/htmlPage.ts'
export default async (reposConfig: any, eleventyConfig: any, data: any) => {
const branch: Repository['branches'][0] = data.currentBranch
const topLevelFilesOnly = eleventyConfig.getFilter("topLevelFilesOnly")
const slugify = eleventyConfig.getFilter("slugify")
const files: SortedFileList = topLevelFilesOnly(branch.fileList, '')
const pageContent = [
m('div', {class: "row mt-3 mb-1"}, [
m('div', {class: "col"},
m('p', [
'Files snapshot from ',
m('span', {class: "font-monospace"}, data.branchInfo.branchName)
])
)
]),
m('div', {class: "row my-2"},
m('div', {class: "col"},
m('h3', './')
)
),
m('ul', {class: "list-group"}, files.map((file) => {
return m('li', {class: 'list-group-item'}, [
file.isDirectory ? m.trust('<span>📁 </span>') : null,
m('a', {
href: `${data.reposPath}/${slugify(data.branchInfo.repoName)}/branches/${slugify(data.branchInfo.branchName)}/files/${
file.fullPath.split('/')
.map((pathPart) => {
return pathPart.split('.').map((subPart) => {
return slugify(subPart)
}).join('.')
}).join('/')}.html`
}, file.name)
])
}))
]
return await htmlPage(reposConfig, eleventyConfig, data, pageContent)
}