Configure Related Content

I believe the following isn’t support yet, but I’d like to confirm just in case I’m doing something silly.

In my front matter, I have:

  [[location]]
    city = "Brooklyn"
    state = "NY"
    country = "USA"
  [[location]]
    city = "Las Vegas"
    state = "NV"
    country = "USA"

I want to configure related content. In config.toml, I’ve done:

[related]
  threshold = 80
  includeNewer = true
  toLower = false

  [[related.indices]]
    name = "location.city"
    weight = 100
  [[related.indices]]
    name = "location.state"
    weight = 100
  [[related.indices]]
    name = "location.country"
    weight = 100

There is no error message, but this doesn’t work as no related content is shown. Is my syntax correct in config? Many thanks.

EDIT

I’ve tried a few things, but still can’t get the above to work. If I change my front matter to the following it works:

[location]
  city = "Boston" <-- string

[related]
  threshold = 80
  includeNewer = true
  toLower = false
  [[related.indices]]
    name = "location.city"
    weight = 100

This also works:

city = ["Boston"] <-- array

[related]
  threshold = 80
  includeNewer = true
  toLower = false
  [[related.indices]]
    name = "city"
    weight = 100

But this doesn’t:

[location]
  city = ["Boston"] <-- array

[related]
  threshold = 80
  includeNewer = true
  toLower = false
  [[related.indices]]
    name = "location.city"
    weight = 100

Any one have any thoughts on this they’d like to please share?

I always have to think hard when I read TOML (and YAML…), but the above is an array of tables. The name attribute is a key in a map (a table), so that doesn’t work (at least not currently).

1 Like

bep, thanks for the reply.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.