Tucker McKnight
Change raw template to typescript template
0
0
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)
}
}
20
20
import rawJsTemplate from './js_templates/raw.ts'
337 338 339
// RAW.NJK
'repos/raw.njk',
rawTemplate,
337 338 339
// RAW.TS
'repos/raw.11ty.js',
rawJsTemplate(eleventyConfig),
1 2
{% set fileContents = fileInfo.repoName | getFileContents(fileInfo.branchName, fileInfo.file) %}
{{- fileContents | safe -}}
1 2