Skip to content

Implement person image upload#2

Open
gatochico wants to merge 8 commits into
mainfrom
feat/implement-person-images
Open

Implement person image upload#2
gatochico wants to merge 8 commits into
mainfrom
feat/implement-person-images

Conversation

@gatochico

Copy link
Copy Markdown

Closes #1

This PR includes two things:

Added an option to run a local proxy server for development work + updated the docs to include it. With this, we can run this proxy server and build new features without commiting any intermediate/test content to Github via the admin panel, since all the content is only stored locally and can be ignored before pushing if necessary. If the server proxy is not on, the app automatically stores the changes on Github (the original behavior).

Added an image field for a person, which can later be rendered on astro using Astro's component which include responsive configurations.For this, i had to modify the way each person is stored, so instead of having a name.md file on /people and a src/assets/media/people/ subfolder with the image file inside, it has a person-name subfolder inside /people, that contains a index.md file with the content and the image (like the rune-madsen example, though that one doesn't have an image yet).

You can try it out by making a new Person on the admin panel and including a photo for them. I also added the temporary /people-test route to test the rendering of the images on Astro.

I did this because if we went with the src/assets/media/people/ single folder for all images, we cannot have two different image files with the same name, even if it's for two different people (in the admin panel, it prompted the user to confirm whether they wanted to replace the original image with the new one). Also this way it's easier to know which image is linked to which user. If we still want to go with the other option (single src/assets/media/people/ folder and users have to manually make sure there are not duplicate names in files), we can go with that option instead.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
processing-foundation-website 1234701 Commit Preview URL

Branch Preview URL
Jul 10 2026, 04:26 PM

@gatochico gatochico requested a review from runemadsen July 8, 2026 22:18

@runemadsen runemadsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! I love the folder structure. Makes it a lot easier.

Just one comment and one question:

Comment: I think it would be great to implement an Astro component that renders an image with srcset and sizes as a part of this PR. I just see a standard img tag, so it's hard to check that the image resizing is actually happening.

Question: There is a 'Media' tab in the CMS that says that there is now media. Should the person image show up there, or how does it integrate with that functionality?

@gatochico

Copy link
Copy Markdown
Author

Regarding the comment: Added to the temporal example page the srcset (for Astro's Image component, called widths) and sizes props as an example on image resizing. With that, unless we need something more custom, we should be good using the Image component from Astro. Also, added an example image on a common media directory src/assets/media to have an example of both (inside the media folder for common assets and for the images that are part of a collection).

The question: The media tab will only show up media present on the common media folder (src/media/assets). Now with the added example image, when checking the media tab that image will be shown there. Assets that are stored as a part of a collection (like the person images) won't be shown there, since the media tab only checks the common folder. So we would have to choose between keeping the proposed structure for a person's assets, or move all images to the common folder so they can be picked out on the media tab.

@gatochico gatochico requested a review from runemadsen July 10, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figure out how to add images to people

2 participants