Transformers
removeLastPathSection
Strip the trailing path segment from a URL.
The removeLastPathSection transformer strips the last directory or slug segment from a URL path while preserving query parameters and hashes.
Basic Usage
{ selector: a, items: { transform: [attr(href), removeLastPathSection] } }Preserving Search Query Parameters
selector: a
transform: [attr(href), removeLastPathSection]