1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 20:55:47 -04:00

less resource-intensive methods of parsing URLs

This commit is contained in:
2022-06-01 18:40:57 -04:00
parent d1ee8b2632
commit 33c210aacf
16 changed files with 195 additions and 188 deletions

View File

@@ -2,7 +2,6 @@ import { useEffect } from "react";
import { useRouter } from "next/router";
import { DefaultSeo, SocialProfileJsonLd } from "next-seo";
import * as Fathom from "fathom-client";
import urlJoin from "url-join";
import { ThemeProvider } from "../contexts/ThemeContext";
import Layout from "../components/Layout";
import * as config from "../lib/config";
@@ -25,7 +24,7 @@ const App = ({ Component, pageProps }: AppProps) => {
// get this page's URL with full domain, and hack around query parameters and anchors
// NOTE: this assumes trailing slashes are enabled in next.config.js
const canonical = urlJoin(config.baseUrl, router.pathname === "/" ? "" : router.pathname, "/");
const canonical = `${config.baseUrl}${router.pathname === "/" ? "" : router.pathname}/`;
useEffect(() => {
// don't track pageviews on branch/deploy previews and localhost