How to fetch data and display it in nextjs using getStaticPaths() and getStaticProps() for blog website index page and its dynamic url for each post

How to fetch blog data and display it in nextjs using getStaticPaths() and getStaticProps() for blog website index page and its dynamic url for each post. Blog data is stored in json format in collection ‘blogs’.