Find pages that are MISSING taxonomy term

This comes from my list.html template file:

  <h1>List: {{ .Title -}}</h1>
  <p>This is the list of {{ .Title | lower }} that accounts have been tagged with.</p>
  <ul class="columns">
  {{ range .Pages }}
    {{- $term := (index .Data (.Section | singularize)) -}}
    <li><a href="{{- .RelPermalink -}}">{{- .Title -}}</a>{{- if ne .Kind "home" }} ({{- $term.Count -}}){{- end -}}</li>
  {{ end }}
  </ul>

Nothing fancy. For pages where I have added values to the taxonomy terms in the front-matter, everything is peachy.

My question is about the inverse of this. Is there a way to discover pages where the taxonomy term is empty/blank? My goal is to find everything that is missing a value so that I can fill it in and ensure I have well-organized data in my site.

1 Like

Ah, I call these “audit” pages.

I didn’t do it with a taxonomy, but I have with arbitrary front matter. After trial and error, I believe I used complement. “Complement” your total collection with your range and you ought to get what you want.