Only show the filename as the h3 on the file page

Sun Mar 02 2025

tucker.mcknight@gmail.com


    

6411a48a446b5465407c617e492e3239f4c5d461

darcs pull https://repos.tuckerm.us/repos/eleventy-darcs/branches/main -h 6411a48a446b5465407c617e492e3239f4c5d461
eleventy.config.js:86
Before
After

  eleventyConfig.addFilter("getFileName", (filePath) => {
    const pathParts = filePath.split("/")
    return pathParts[pathParts.length - 1]
  })
file.njk:10
Before
<h3>{{fileInfo.file }}</h3>
After
<h3>{{fileInfo.file | getFileName}}</h3>