Hugo’s os.Stat
function is useful for getting info about a file. For example:
{{ $file := "data/links.json" }}
{{ $stat := os.Stat $file }}
File Name: {{ $stat.Name }}
File Size: {{ $stat.Size }} bytes
File Mode: {{ $stat.Mode }}
File ModTime: {{ $stat.ModTime }}
File IsDir: {{ $stat.IsDir }}
File Name: links.json
File Size: 54 bytes
File Mode: -rw-r--r--
File ModTime: 2018-11-27 03:52:29.470998206 +0000 UTC
File IsDir: false