[SOLVED] How to use "where" syntax about two keywords

Hi all,

I can do that:

{{ range (where .Data.Pages "Section" "Tokyo" ).ByDate.Reverse }}

And I need to select two keywords (Senction): “Tokyo” and "Kyoto."
Please let me know how to write that.

Thanks.
Akiko

Maybe you gan get some help here:

1 Like

Wow :slightly_smiling:

I did it!

{{ range (where .Data.Pages "Section" "in" (slice "Tokyo" "Kyoto" )).ByDate.Reverse }}

Thanks for the information.
Cheers!

3 Likes

@bep while looping through the pages, can you do an IF condition? Ex, to check if the page titles are the same.

{{ range (where .Data.Pages "Section" "in" (slice "Tokyo" "Kyoto" )) }}
  if page title from Tokyo equals page title from Kyoto
{{ end }}

I’m asking because I’m trying to do something similar here 5274/4