Created
October 10, 2013 11:48
-
-
Save echaozh/6917128 to your computer and use it in GitHub Desktop.
js code to find page data for template in harp
This file contains hidden or 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
| var page = (function (cur) { | |
| var data = public; | |
| for (var i = 0; i < cur.path.length - 1; ++i) { | |
| data = data[cur.path[i]]; | |
| } | |
| data = data.data[cur.path[cur.path.length - 1]]; | |
| return data; | |
| }) (current); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment