Home / Alt manpages / hugo-list-all(1)

  • hugo-list-all(1)
  • User command
  • linux

Audit Every Hugo Post with hugo list all

Your Hugo build only shows what is live, so hugo list all is how you catch the draft nobody published. It prints every post in the content directory, drafts, future-dated pages and expired pages included. This guide uses the locally installed Hugo 0.123.7+extended. Allow about ten minutes if you already know your site and source path.

You need a shell, a Hugo project, and read access to its source directory. The command only inspects: it does not publish a page, change front matter or remove content. It does read the project's configuration and related theme or module paths, so run it against a directory you trust.

1. Confirm the Hugo version and command

Check the binary before trusting any example below. Hugo's flags shift between releases, so version-specific detail matters:

$ hugo version
$ hugo list all --help

On this machine, the first command reports hugo v0.123.7+extended. The second describes hugo list all [flags] [args] and shows this subcommand has no content-selection flag of its own; the whole point is baked into all, which pulls in draft, future and expired pages alongside ordinary posts.

Checkpoint

If hugo is not found, stop here and install it through your normal system process. Do not substitute a similarly named wrapper without checking its documentation.

2. List every post from an explicit project path

Pass the Hugo project directory with --source. Replace the placeholder with the directory holding the site's configuration and content:

$ hugo list all --source /path/to/example-site

Hugo reads the content directory relative to that source path and prints its inventory to the terminal. The exact rows depend on your project's content and front matter, but a successful run hands you a list of everything a normal build would hide: an unfinished draft, a page dated next month, one that quietly expired last week.

Do not confuse this with hugo list or a normal site build. This subcommand exists for the complete content audit. A page appearing here is not automatically ready to publish; the list deliberately includes pages that are not currently live.

3. Save an audit without losing the terminal result

Redirect standard output to a file when you need to compare the inventory later or attach it to a review. Use a clearly named path outside the site unless you actually want the report tracked with the project:

$ hugo list all --source /path/to/example-site > /tmp/example-site-content-list.txt
$ sed -n '1,20p' /tmp/example-site-content-list.txt

The first command overwrites that temporary report if one already exists. This is not a Hugo content change, but it is still an irreversible shell redirection for that file: pick a new filename if the old audit still matters. To watch progress while saving, use tee instead:

$ hugo list all --source /path/to/example-site | tee /tmp/example-site-content-list.txt

Checkpoint

Inspect the saved file before treating it as evidence. An empty or unexpectedly short result usually means the wrong source directory, not an empty site.

4. Make the source and environment explicit when it matters

Hugo uses its project configuration by default. If the project has several configuration files or environments, name the inputs you actually want instead of trusting whichever directory happens to be current:

$ hugo list all \
    --source /path/to/example-site \
    --config /path/to/example-site/hugo.yaml \
    --environment staging

The installed command also accepts --configDir for a configuration directory, --themesDir for themes, and --clock for a supplied time such as 2021-11-06T22:30:00.00+09:00. These can all affect date-sensitive content, so record them alongside an audit if reproducibility matters. Use --quiet for less diagnostic noise, or --verbose and --debug while chasing a failure. --logLevel accepts debug, info, warn or error.

Do not add flags merely because they exist. --destination is an inherited filesystem path option, but listing content never needs a destination. A small command makes it obvious which source and date assumptions produced the report.

5. Diagnose the common wrong-result cases

If the command misbehaves, rerun it with --verbose and check the source path first. A path that contains a site but not its intended configuration can produce an inventory that does not match what you expected. Then confirm the configuration filename and environment before you touch any content.

If a draft, future page or expired page is missing from the list, check you actually used hugo list all rather than a narrower listing command. Also check that page's front matter date against the clock used for the audit: a future page stays future relative to that clock, and changing the clock changes the classification, not the page itself.

If you need to publish or suppress a page after the audit, stop and use the project's normal release workflow. This command has no enable, delete or edit operation. Make any front matter change separately, review the resulting diff, and keep the original value so you can undo it if the decision turns out wrong.

Done means

  • Confirmed the binary. hugo version identified exactly which build you used.
  • Ran the full audit. hugo list all --source /path/to/example-site completed against the intended project.
  • Covered the hidden pages. Your review included drafts, future pages and expired pages, not only what is currently published.
  • Recorded the assumptions. Any saved report notes its source path and relevant configuration or clock settings.