Change raw template to typescript template

ed67904908cf0882d0827497c42cedc73581d9f7

Tucker McKnight <tucker@pangolin.lan> | Fri Jan 02 2026

Change raw template to typescript template
js_templates/raw.ts:0
Before




⁣
⁣
⁣
⁣
⁣
⁣
After
-1
0
1
2
3
4
export default async (eleventyConfig: any) => {
  const getFileContents = eleventyConfig.getFilter("getFileContents")

  return async (data) => {
    return await getFileContents(data.fileInfo.repoName, data.fileInfo.branchName, data.fileInfo.file)
  }
}
main.ts:20
Before
19
20
21
22

23
import commitsJsTemplate from './js_templates/commits.ts'
import indexJsTemplate from './js_templates/index.ts'
import branchesJsTemplate from './js_templates/branches.ts'

⁣
const ajv = new Ajv()
const exec = util.promisify(childProcess.exec)
After
19
20
21
22
23
24
import commitsJsTemplate from './js_templates/commits.ts'
import indexJsTemplate from './js_templates/index.ts'
import branchesJsTemplate from './js_templates/branches.ts'
import rawJsTemplate from './js_templates/raw.ts'

const ajv = new Ajv()
const exec = util.promisify(childProcess.exec)
main.ts:337
Before
336
337
338
339
340
341
342
343
344
345
    }
  )

  // RAW.NJK
  const rawTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/raw.njk`).toString()
  eleventyConfig.addTemplate(
    'repos/raw.njk',
    rawTemplate,
    {
      pagination: {
        data: "flatFiles",
After
336
337
338
339
340
341
342
343
344
345
    }
  )

  // RAW.TS
  const rawTemplate = fsImport.readFileSync(`${import.meta.dirname}/templates/raw.njk`).toString()
  eleventyConfig.addTemplate(
    'repos/raw.11ty.js',
    rawJsTemplate(eleventyConfig),
    {
      pagination: {
        data: "flatFiles",
templates/raw.njk:1
Before
0
{% set fileContents = fileInfo.repoName | getFileContents(fileInfo.branchName, fileInfo.file) %}
{{- fileContents | safe -}}
After