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

Show all images in folder 'sjs' on page /steun-je-school #71

Open
tomsiebring opened this issue Feb 21, 2023 · 1 comment
Open

Show all images in folder 'sjs' on page /steun-je-school #71

tomsiebring opened this issue Feb 21, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@tomsiebring
Copy link
Collaborator

tomsiebring commented Feb 21, 2023

At the moment each image is hardcoded in the code of page /steun-je-school, such as sjs1.jpg, sjs2.jpg, etc.

Desired behaviour is that all images in folder 'public/sjs' are shown on alphabetical order (excluding folder 'old' within 'sjs')

NOTE: be aware of image extensions such as .jpg .jpeg .JPG .png .PNG ...

@dastrong
Copy link
Collaborator

@tomsiebring

I'm not 100% sure, but try reading the public/sjs directory in getStaticProps to get the list of files within it.

Now pass the names of the files down as a prop to the page component where you can render an image with the file name.

@margaretmwaura margaretmwaura self-assigned this Apr 2, 2023
@CollActionOfficial CollActionOfficial added the enhancement New feature or request label Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants