In Jekyll - get the parent url path of a collection with concatenation
First, you need to access the collection's path using the collection.docs
method. Then, you can extract the path of the first document within the collection using the first.url
method. After that, you can use the split
method to separate the URL into an array of its parts based on the "/" delimiter. Finally, you can use the join
method to concatenate the parts of the URL array, excluding the last element, to obtain the parent URL path of the collection.