Broken Images with GitHub LFS

Open
#407 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

@dkarlovi is already working on this.

Since Oct 17, 2026.

  • #451 by @dkarlovi — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
git, typescript
Domain
frontend

Research direction

Start by finding where the CMS builds image URLs from the repository's raw GitHub address, and reproduce the bug with a Git LFS-tracked image in a test repo to confirm the browser requests raw.githubusercontent.com. The open question is how to detect LFS, so check whether a maintainer has weighed in before choosing an approach. Done when LFS-tracked images render in the UI and non-LFS images still load as before.

Written by the indexing model from the issue text.

Description

I commonly use Git LFS to store images in a repo. Pages doesn't quite handle this setup correctly. Images fail to load in the UI, because the resulting URL for the src points to the LFS file.

It looks like Pages tries to display images use the following URL structure:

https://raw.githubusercontent.com/{ USERNAME }/{ REPO_NAME }/{ BRANCH_NAME }/{ FILE_PATH }?token=

The raw source on an image in my repo uses the following URL structure:

https://media.githubusercontent.com/media/{ USERNAME }/{ REPO_NAME }/{ BRANCH_NAME }/{ FILE_PATH }?token=

Is it possible for Pages to detect when LFS is in use and adjust image sources accordingly?

Dominant language
TypeScript
Stars
4.1k
Forks
564
Avg merge
8m
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hunvreus/pagescms

All issues in hunvreus/pagescms

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.