Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. collection:
  2. - title: "FOO"
  3. collection:
  4. - title: "Zoo"
  5. link: "zoo/"
  6. - title: "ZAM"
  7. link: "zam/"
  8. - title: "BAR"
  9. collection:
  10. - title: "Rad"
  11. link: "rad/"
  12. - title: "Goat"
  13. link: "goat/"
  14.  
  15.  
  16. I'm looping over the above data-structure recursively each loop deals with a 'doc'
  17. The first doc would be 'FOO'
  18. It would see that it has a 'collection' so call the function again etc.
  19. currentPage = File.join("/", File.dirname(current_page.path), File.basename(current_page.path, ".*"))
  20.  
  21. How can I tell if the current doc child contains the currentPage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement