title: How to get param from url in getStaticProps without using getStaticPaths?
body: <p>Here is my function below in which I am using the getServerSideProps() method and fetch data dynamically according to the param post_slug from my URL.</p>
  <pre><code>// This gets called on every request
  export async function getServerSideProps({ query }) {
    const { post_slug } = query || {};
  
    let url = API_URLS.POST.GET_POST_BY_SLUG;
  
    url = url.replace(/#POST_SLUG#/g, post_slug);
  
    const res = await fetch(url);
    const { data } = (await res.json()) || {};
  
    // Pass post_data to the page via props
    return { props: { data } };
  }
  </code></pre>
  <p>But this function render a whole page on every request.</p>
  <p>So now I decide to use getStaticProps() but here I could not get param post_slug from URL.</p>
  <p>I read <a href="https://nextjs.org/docs/basic-features/data-fetching" rel="noreferrer">next js</a> documentation where they tell I need to use getStaticPaths() along getStaticProps() method but here the problem is I have to define static params in getStaticPaths() method but I want param from my current URL.</p>
  <p>Is there any solution to get param post_slug from URL in the getStaticProps() method?</p>