Skip to content
FLAVIO COPES
flaviocopes.com
2026

How to get current file name in Hugo without .md

By Flavio Copes

Learn how to get the current file name in Hugo without the .md extension using a short template snippet that trims it from .File.LogicalName.

~~~

This is the template snippet that does the job:

{{ trim .File.LogicalName ".md" }}
Tagged: Hugo ยท All topics
~~~

Related posts about hugo: