ZAAI Product Engineering Lab logo ZAAI Lab
Jekyll logo RubyGem

Stop hardcoding image paths,
one Liquid tag is enough.

Stop hardcoding image paths in every markdown file. One Liquid tag for predictable asset URLs.

If you maintain a Jekyll site with images alongside content, you have written the same path prefix dozens of times. Jekyll FilePath replaces that repetition with a single Liquid tag that builds a predictable asset URL based on the current page or post.

How It Works

The plugin exposes a tag with this shape:

{`{` filepath filename.png `}`}

When rendered, it resolves the current page or post path and returns a /files/... URL that matches that document’s location.

Why It Exists

For content-heavy Jekyll sites, small quality-of-life improvements matter. This plugin keeps markdown cleaner, makes asset moves more systematic, and reduces broken links caused by hand-written paths.

Highlights

  • One Liquid tag to resolve any asset path relative to the current page.

  • Stop hardcoding repeated `/images/subfolder/file.png` paths in markdown.

  • Works with pages, posts, and collection documents.

Tech Stack

  • Ruby
  • Jekyll
  • Liquid