Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images in "remote" repos with relative URLs aren't rendered correctly #222

Closed
40thieves opened this issue Aug 3, 2023 · 2 comments
Closed
Assignees

Comments

@40thieves
Copy link
Contributor

Describe the bug

If an image is included in a "remote" repo (e.g. in the workshop repo) that has a relative path (i.e. is not an absolute path) then the image is correctly rendered in the output and 404s.

From what I understand from @SallyMcGrath, this is because we are replacing absolute Github URLs with JSDelivr CDN URLs (as Github don't allow hotlinking). However this does not work if a relative path is used instead.

Unfortunately I now can't link to an example of this happening as @Dedekind561 fixed it 😆

How could this be fixed?

It sounds like there are two options:

  1. Look for relative links in the render hook, and rewrite them to the appropriate CDN URL
  2. Add a build step that pulls the images directly into build, and then wires them through Hugo Pipes

Who else might need to know about this?

@CodeYourFuture/global-syllabus

@40thieves
Copy link
Contributor Author

I was initially thinking that option 2 would potentially blow up this repo with images, but on reflection I think this would only affect the build cache?

@SallyMcGrath
Copy link
Member

@FridIsar

In your testing, add this block:

[[blocks]]
name="test image"
src="https://github.com/CodeYourFuture/Module-Template/readme/"

to any prep or day plan view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants