title: Is there a bug in the Bookdown TOC when repeating section names
body: <p>I have noticed in my own <code>bookdown</code> documents that when I repeat section names, e.g. I have a &quot;Homework&quot; section in each chapter, all links in the document outline will redirect to the first instance of this section name. I thought I was configuring something incorrectly and was waiting to fix it, but then I noticed that the <a href="https://geocompr.robinlovelace.net/" rel="nofollow noreferrer">Geocomputation with R</a> book exhibits the same behavior.</p>
  <p>To reproduce this error, go to <a href="https://geocompr.robinlovelace.net/" rel="nofollow noreferrer">https://geocompr.robinlovelace.net/</a>, and click the &quot;Exercises&quot; section in any chapter. All links redirect to the Exercises in chapter 1. Have others experienced this?</p>
  <p>I would add that this MWE does <em>not</em> demonstrate the problem, though I believe it should based on what I am seeing:</p>
  <pre><code>---
  title: &quot;A Book&quot;
  author: &quot;Frida Gomam&quot;
  site: bookdown::bookdown_site
  documentclass: book
  output:
    bookdown::gitbook: default
    #bookdown::pdf_book: default
  ---
  
  # First chapter
  
  ## Sustainability
  
  ## Exercises
  
  # Second chapter
  
  ## Infrastructure
  
  ## Exercises
  </code></pre>