title: Gatsby JS url path is not updating correctly
body: <p>I'm using Gatsby JS and for some reason, the url for the new page is being added to the end of the current url. I'll try to explain. Here is a live example:</p>
  <p>On this page: <code>https://nyxo.app/week/understanding-your-sleep</code> is a list of lessons for a sleep coaching week. When the user clicks a lesson, the url should become <code>https://nyxo.app/lesson/lesson-name</code>.</p>
  <p>Currently, this is happening instead: <code>https://nyxo.app/week/understanding-your-sleep/lesson/lesson-name.</code> and it's resulting in a 404.</p>
  <p>Here is the <code>gatsby-node.js</code> file, showing how the templates are created.</p>
  <pre><code>// gatsby-node.js
  
    weeks.forEach((week: Week) =&gt; {
      createPage({
        path: `week/${week.node.slug}`,
        component: path.resolve(`./src/templates/week.tsx`),
        context: {
          slug: week.node.slug,
          locale: &quot;en-US&quot;,
        },
      })
    })
  
  lessons.forEach((lesson: Lesson) =&gt; {
      createPage({
        path: `lesson/${lesson.node.slug}`,
        component: path.resolve(`./src/templates/lesson.tsx`),
        context: {
          slug: lesson.node.slug,
        },
      })
    })
  </code></pre>
  <p>Here is the template file for the Weeks page. You can see the path doesn't include the week and the week name, on top of the lesson and lesson name.</p>
  <pre><code>// week.tsx template
  
  {week.lessons.map((lesson: any) =&gt; (
       &lt;LessonCard
        authors={[{ name: &quot;testi&quot;, fixed: null }]}
        key={lesson.slug}
        path={`lesson/${lesson.slug}`} // the path to the lesson file
        excerpt={&quot;&quot;}
        name={lesson.lessonName}
        readingTime={lesson.lessonContent.fields.readingTime.text}
       /&gt;
  ))}
  
  </code></pre>
  <p>This has just started and I don't know why, but I wanted to see if anyone else has experienced this and how they overcame it. This problem seems to be limited to templates. I appreciate any help/advice.
  ✌️</p>