---
pagination:
  data: redirects
  size: 1
  alias: redirect
permalink: "{{ redirect.permalink.old }}"
---
{#
  This is the closest we can get to 301 redirects in GitHub Pages.

  This template uses meta refresh to redirect from the old path to the new permalink in 0 seconds
  (change that delay if you wish the page to appear for longer, though if you do, note that the
  template is basic and un-styled). The template also sets the canonical link to the
  new page location and a link in the body, in case the browser doesn't do meta refresh.

  This template uses 11ty Pagination to create pages with data (https://www.11ty.dev/docs/pages-from-data/)
  from `_data/redirects.json`. Note that there is additional old/new file mapping in
  that file that may be removed if it's not needed.

  The obvious downside to this approach is that files are created in the root or posts
  directory for each of the old permalinks. At worst, this may result in namespace collisions
  should a future filename/permalink match one of the redirect permalinks. Otherwise,
  this approach merely clutters up the output directory with "old" files.

  We may want to sunset this approach as traffic to the old pages drops off to a certain level.
#}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="refresh" content="0;url={{ redirect.permalink.new | url }}" />
    <link rel="canonical" href="{{ redirect.permalink.new | url }}" />
  </head>
  <body>
    <h1>Redirecting</h1>
    <p>This page been moved to <a href="{{ redirect.permalink.new | url }}">{{ redirect.permalink.new | url }}</a>.</p>
  </body>
</html>
