@inject IWebHostEnvironment WebHostEnvironment

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

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <base href="/" />
  <link rel="stylesheet" href="app.css" />
  <link rel="stylesheet" href="Blog.styles.css" />
  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  <HeadOutlet />
</head>

<body>
  <Routes />
  <script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.11/dist/clipboard.min.js"></script>
  <script src="prism.js"></script>
  @if (WebHostEnvironment.IsProduction())
  {
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag() { dataLayer.push(arguments); }
      gtag('js', new Date());
      gtag('config', 'G-5JM0TZTRHF');
    </script>
    <script async defer src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
    <noscript><img src="https://queue.simpleanalyticscdn.com/noscript.gif" alt=""
        referrerpolicy="no-referrer-when-downgrade" /></noscript>
  }
  <script src="_framework/blazor.web.js"></script>
  <script>
    // NOTE: This is a workaround for the issue with FocusOnNavigate in Blazor
    // not playing nicely with static site generation.
    // read more here: https://github.com/dotnet/aspnetcore/issues/52412
    window.Blazor.addEventListener("enhancedload", () => {
      if (window.location.pathname === "/") {
        return;
      }

      window.scroll({ top: 0, left: 0, behavior: 'instant' });
    });
  </script>
</body>

</html>
