acm-ucr / h4b-website

Building a community to combat food insecurity in Inland Empire
https://h4b.ucrhighlanders.org
3 stars 0 forks source link

Setup Dynamic Routing Gallery #62

Closed seanquiambao closed 1 month ago

seanquiambao commented 1 month ago

Highly recommend checking out this doc

https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes

you will do a simple dynamic route where it will show the name of the URL for the following pages:

Grab the params (url) of the page and map it to an object (this object can be created in the page.js itself, no need to create a data file).

If it maps correctly to a valid page, return the URL name. (i.e. /gallery/fall will show "Fall") You can use the title component

Otherwise return 404 using next/notfound library. Example from Demo: https://github.com/acm-ucr/h4b-website/pull/17/files

ALE00111 commented 1 month ago

I don't know if I'm understanding this issue right, but is this exactly like the example? Like we type in the url gallery/fall it will just return Fall with no special changes to it.

seanquiambao commented 1 month ago

I don't know if I'm understanding this issue right, but is this exactly like the example? Like we type in the url gallery/fall it will just return Fall with no special changes to it.

yeah it's basically like the example from the demo. the only change is adding the title component to the pages instead of just displaying the text