Tucker McKnight <tucker@pangolin.lan> | Sun Feb 01 2026
Changes file.ts to mithril template Also fix a small problem with files.ts where it was showing the "view raw file" link on a directory's page.
0 1
export default async (eleventyConfig: any, data: any) => {
const isDirectory = eleventyConfig.getFilter("isDirectory")
const topLevelFilesOnly = eleventyConfig.getFilter("topLevelFilesOnly")0 1 2 3 4
import m from 'mithril'
import render from 'mithril-node-render'
export default async (eleventyConfig: any, data: any) => {
const isDirectory = eleventyConfig.getFilter("isDirectory")
const topLevelFilesOnly = eleventyConfig.getFilter("topLevelFilesOnly")120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
data.fileInfo.file,
data.fileInfo.repoName
)
)
}
</code>
</div>
</div>
</div>
</div>
`}
<script type="text/javascript">
const toggleLastTouch = (event) => {
const isOn = event.target.checked
const annotations = document.getElementById("annotations")
if (isOn) {
annotations.classList.remove("d-none")
} else {
annotations.classList.add("d-none")
}
}
document.getElementById("showLastTouch")?.addEventListener('click', toggleLastTouch)
</script>
`
}120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
data.fileInfo.file,
data.fileInfo.repoName
)
)))
)
])
])
),
m('script', {type: "text/javascript"},
`
const toggleLastTouch = (event) => {
const isOn = event.target.checked
const annotations = document.getElementById("annotations")
if (isOn) {
annotations.classList.remove("d-none")
} else {
annotations.classList.add("d-none")
}
}
document.getElementById("showLastTouch")?.addEventListener('click', toggleLastTouch)
`
)
]
)
])
}23 24 25 26 27 28 29
)
),
m('ul', {class: "list-group"}, files.map((file) => {
return m('li', [
file.isDirectory ? '<span>📁</span>' : null,
m('a', {
href: `${data.reposPath}/${slugify(data.branchInfo.repoName)}/branches/${slugify(data.branchInfo.branchName)}/files/${
file.fullPath.split('/')23 24 25 26 27 28 29
)
),
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('/')