Skip to content

Instantly share code, notes, and snippets.

@tillmanj
tillmanj / jekyllPageDir.md
Created February 13, 2025 19:59
Strip the current page from a file in Jekyll and return the path. A collection-agnostic page.dir filter

{% assign url = {{page.url}} | split: "/" | reverse | join: "/" | replace_first: "/", "|" | split: "|" | last | split: "/" | reverse | join: "/" | prepend: "/" | append: "/" %}

{{url}}