Sat Oct 11 2025
Tucker McKnight <tucker@pangolin.lan>
Add a link to said raw file when viewing the file in the Files tab. Also remove an unnecessary "async" from a filter that was not async. Also .gitignore the docs directory, which gets generated when `npm run build` is run.
8559a132c4d0d70fe0d5ad2ae5d19749f0e8f3e2
2
2
docs
201
eleventyConfig.addAsyncFilter("isDirectory", async(filename, repoName, branchName) => {
201
eleventyConfig.addFilter("isDirectory", (filename, repoName, branchName) => {
322
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
// RAW.NJK
const rawTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/raw.njk`).toString()
eleventyConfig.addTemplate(
'repos/raw.njk',
rawTemplate,
{
pagination: {
data: "flatFiles",
size: 1,
alias: "fileInfo",
},
eleventyAllowMissingExtension: true,
flatFiles: flatFilesData,
permalink: (data) => {
const repoName = data.fileInfo.repoName
const branchName = data.fileInfo.branchName
return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/raw/${eleventyConfig.getFilter("slugify")(data.fileInfo.file)}`
},
}
)
15
<div class="col">
15
16
17
18
<div class="col-auto">
<div class="col">
<a href="{{reposPath}}/{{fileInfo.repoName | slugify}}/branches/{{fileInfo.branchName | slugify}}/raw/{{fileInfo.file | slugify}}">View raw file</a>
</div>