Created
October 10, 2025 22:06
-
-
Save james2doyle/62da26fdb006fde0faf08b31d02926b1 to your computer and use it in GitHub Desktop.
Revisions
-
james2doyle created this gist
Oct 10, 2025 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // since the argument variable can only be referenced once, we need this function repeated fn ex::p($p) = $p->{"c":url.current}; fn ex::pp($p) = $p->{"c": ex::p(parentPage).c}; fn ex::ppp($p) = $p->{"c": ex::pp(parentPage).c}; // will output `level-4/level-3/level-2/level-1` // usage: { "href": ex::slug(@) } fn ex::slug($d) = $d{"slug":array::join( array::compact([ ex::ppp(parentPage).c, ex::pp(parentPage).c, ex::p(parentPage).c, url.current ]), '/' )};