Skip to content

Comments

Test moving images into folders with post content#173

Closed
frankieroberto wants to merge 2 commits intomainfrom
test-moving-images-into-folder-with-post
Closed

Test moving images into folders with post content#173
frankieroberto wants to merge 2 commits intomainfrom
test-moving-images-into-folder-with-post

Conversation

@frankieroberto
Copy link
Collaborator

@frankieroberto frankieroberto commented Jul 14, 2025

This is a test to explore whether it would be easier to move from having separate image and post folders like this:

/app/images/service-name/YYYY/MM/post-name/image-name.png
/app/posts/service-name/YYYY/MM/post-name.md

to having combined images-and-posts folders like this:

/app/service-name/YYYY/MM/post-name/index.md
/app/service-name/YYYY/MM/post-name/image-name.png

The main advantages would be:

  • no need to make sure that the folder name in app/images exactly matches the post name, which is a common source of mistakes
  • easier to create posts using the GitHub web interface, as currently there’s no way to create folders in which to upload images using the web interface without resorting to workarounds
  • the Markdown previews in the GitHub web interface should show the embedded images

The disadvantages are:

  • might be slightly slower, as the 'glob' file references mean that Eleventy has to scan all the folders for matching filenames

Fixes #153

@frankieroberto frankieroberto temporarily deployed to screening-de-test-movin-dizv3x July 14, 2025 13:12 Inactive
@frankieroberto
Copy link
Collaborator Author

Here’s an example showing the images working within the GitHub Markdown preview: https://github.com/NHSDigital/prevention-services-design-history/blob/test-moving-images-into-folder-with-post/app/record-a-vaccination/2025/03/asking-fewer-better-questions/index.md

This clinches it for me, as the previews are really helpful for reviewing!

@frankieroberto
Copy link
Collaborator Author

Closing this test as I’ve re-done it in #235

@frankieroberto frankieroberto deleted the test-moving-images-into-folder-with-post branch October 2, 2025 13:06
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.

Consider alternative ways to organise image files

1 participant