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

Fix: reroute images #27

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Fix: reroute images #27

merged 1 commit into from
Sep 14, 2023

Conversation

SallyMcGrath
Copy link
Member

@SallyMcGrath SallyMcGrath commented Sep 12, 2023

The way this site is set up is confusing Hugo and it's not looking in its
bundle folder for its assets.
I think it's because it's not recognising these folders as leaf bundles because they do not contain index.md

For now, we probably want it to be readme, because we are taking advantage of the github base64 readme api to pull this content into the curriculum. Longer term, we might change this from readme.md to index.md and this code can be removed.

But for now, we will just reroute images saved into the CMS with ../

fixes #23

@netlify
Copy link

netlify bot commented Sep 12, 2023

Deploy Preview for cyf-pd ready!

Name Link
🔨 Latest commit 9e7cefb
🔍 Latest deploy log https://app.netlify.com/sites/cyf-pd/deploys/650019605ea6240008909597
😎 Deploy Preview https://deploy-preview-27--cyf-pd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kfklein15
Copy link
Contributor

The 1 image I remember, which is on JS3 Prep S1, isn't showing on your preview at all. Do we have a test environment where I can update this to see if it works? Otherwise not sure how to test it.

@SallyMcGrath SallyMcGrath merged commit 27b8c9e into main Sep 14, 2023
5 checks passed
@SallyMcGrath SallyMcGrath deleted the feature/images branch September 14, 2023 07:03
@SallyMcGrath
Copy link
Member Author

Hm, there's something I don't understand here.

I rerouted on local no problem. I wondered if there was something going on with caching because the netlify build choked when I tried deploying it with a cache clear. I checked the staging

https://deploy-preview-27--cyf-pd.netlify.app/blocks/prep-teamwork-project/readme/

And the path is not ../ as the render image hook directs and as it is on local.
Screenshot 2023-09-14 at 08 04 02

Poking through the deploys, I merged this to see what happens on production. It's not the staging view because it's the same on production. Deployed a couple of times with a cache clear and it doesn't seem to be caching. Hmmmm, that's really interesting and I don't know the answer yet!

@SallyMcGrath
Copy link
Member Author

Screenshot 2023-09-14 at 08 02 50

@SallyMcGrath
Copy link
Member Author

I played spot the difference until I found it. Fix: update the Hugo version on Netlify. Should be working now https://cyf-pd.netlify.app/blocks/prep-teamwork-project/readme/

@kfklein15
Copy link
Contributor

You are amazing. Thank you!

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

Successfully merging this pull request may close these issues.

Image not rendering on CMS PD/PD website
2 participants