Tucker McKnight
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.
45 46 47 48
[test link to files page](files/readme-md)
branch: {{ branch }}
45 46 47 48
87
${await renderContentIfAvailable(await getReadMe(repo.name, branch.name), "md")}
87
${await renderContentIfAvailable(await getReadMe(repo.name, branch.name), branch.name)}
143 144
eleventyConfig.addAsyncFilter("renderContentIfAvailable", async (contentString: string, contentType: string) => {
return await renderer.bind({})(contentString, contentType)
143 144
eleventyConfig.addAsyncFilter("renderContentIfAvailable", async (contentString: string, branchName: string) => {
return await renderer.bind({
data: {
branch: branchName
},
})(contentString, "liquid,md")