How to list the created aliases?

Running Hugo reports thousands of aliases getting created. But I didn’t ask for any, and I have no idea which paths are getting aliases.

Is there a way to list these?

Not from the command line, but you could throw a partial in somewhere…

layouts/partials/list-aliases.html
<table>
  <thead>
    <tr>
      <th>Alias</th>
      <th>URL</th>
      <th>File path</th>
    </tr>
  </thead>
  <tbody>
    {{ range $p := site.AllPages }}
      {{ if .File }}
        {{ range .Aliases }}
          <tr>
            <td>{{ . }}</td>
            <td>{{ $p.RelPermalink }}</td>
            <td>{{ $p.File.Path }}</td>
          </tr>
        {{ end }}
      {{ end }}
    {{ end }}
  </tbody>
</table>

1 Like