Pass the branchname in to the renderContent function

bd55d123ec91c7b0d51af40f181f6bba4e05c755

Tucker McKnight | Wed Dec 31 2025

Pass the branchname in to the renderContent function

This will allow you to do something like {{ branch }} inside of
the readme, and it will print out the name of the current branch.

This should be useful for hyperlinks, too.
README.md:45
Before
45
46
47
48

[test link to files page](files/readme-md)

branch: {{ branch }}
After
45
46
47
48
js_templates/repo.ts:87
Before
87
        ${await renderContentIfAvailable(await getReadMe(repo.name, branch.name), "md")}
After
87
        ${await renderContentIfAvailable(await getReadMe(repo.name, branch.name), branch.name)}
main.ts:143
Before
143
144
  eleventyConfig.addAsyncFilter("renderContentIfAvailable", async (contentString: string, contentType: string) => {
      return await renderer.bind({})(contentString, contentType)
After
143
144
  eleventyConfig.addAsyncFilter("renderContentIfAvailable", async (contentString: string, branchName: string) => {
      return await renderer.bind({
        data: {
          branch: branchName
        },
      })(contentString, "liquid,md")