skip to Main Content

Javascript – Custom Routes in NextJS to support countries and languages

My site paths are like - https://www.example.com/us/en/products https://www.example.com/us/es/products https://www.example.com/us/en/categories https://www.example.com/us/es/categories or - https://www.example.com/[countryCode]/[languageCode]/products Though libraries like - next-intl provides a way to deal with languages only but not if it has some previous country code attached to it. Let me…

VIEW QUESTION

Javascript – How to use relative path in Next Image?

I want to fetch corresponding product image on each dynamic route in my NextJS project, like this: export default function singleProductPage({ params }) { const { product_code } = params; const imagePath = `../../../../assets/products/Hammer/${product_code}.jpg`; return ( <div> <Image src={imagePath} width={300}…

VIEW QUESTION
Back To Top
Search