-
-
Save supsup/beb350b9d3becd2b721edea11cb34f4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
collection: | |
- title: "FOO" | |
collection: | |
- title: "Zoo" | |
link: "zoo/" | |
- title: "ZAM" | |
link: "zam/" | |
- title: "BAR" | |
collection: | |
- title: "Rad" | |
link: "rad/" | |
- title: "Goat" | |
link: "goat/" | |
I'm looping over the above data-structure recursively each loop deals with a 'doc' | |
The first doc would be 'FOO' | |
It would see that it has a 'collection' so call the function again etc. | |
currentPage = File.join("/", File.dirname(current_page.path), File.basename(current_page.path, ".*")) | |
How can I tell if the current doc child contains the currentPage (compared against the doc['link']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment