Generate Hugo website as a PDF

It’s a section ("/all-content/") with its own layout. This is a simplified version of the layout:

<!DOCTYPE html>
<html lang="en">

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# product: http://ogp.me/ns/product#">

  <meta charset="utf-8">

  <xbase href="file:///mnt/websites/xxxxxxxx/public">

  <title>All the Posts!</title>

  <style>
    
  </style>

</head>

<body>

  <h1>All the Posts!</h1>

  <p>This is a copy of all posts on the website. To download the latest version, visit...</p>

  <p>TOC:</p>

  <ul>
    {{ range .Site.RegularPages }}
      <li><a href="#{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</a></li>
    {{ end }}
  </ul>

  {{ range .Site.RegularPages }}

    <h2 id="{{ substr .RelPermalink 1 -1 }}">{{ .Title }}</h2>
    <p style=""><a href="{{ .Permalink }}">{{ .Permalink }}</a> - {{ .Params.sdate }}</p>
    {{ .Content }}

  {{ end }}

</body>
</html>

I should warn you, however, that I’m not fully expert in Hugo; others in this forum may be able to give you much better solutions. This is just something I could come up, which works fine for me.