1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-04 14:10:10 -05:00

some very minor refactoring/fixing

This commit is contained in:
2021-12-31 08:48:56 -05:00
parent 831f8ffe4c
commit 11d245ad66
19 changed files with 32 additions and 49 deletions

View File

@@ -1,13 +1,10 @@
// @ts-nocheck
// ^ type checking causes a bunch of issues in DefaultSeo, BE CAREFUL
import { useEffect } from "react";
import { useRouter } from "next/router";
import Script from "next/script";
import type { AppProps } from "next/app";
import { DefaultSeo, SocialProfileJsonLd } from "next-seo";
import * as Fathom from "fathom-client";
import * as config from "../lib/config";
import type { AppProps } from "next/app";
import meJpg from "../public/static/images/me.jpg";
import faviconIco from "../public/static/images/favicon.ico";
@@ -41,6 +38,7 @@ export default function App({ Component, pageProps }: AppProps) {
return (
<>
{/* @ts-ignore */}
<DefaultSeo
defaultTitle={`${config.siteName} ${config.shortDescription}`}
titleTemplate={`%s ${config.siteName}`}

View File

@@ -1,15 +0,0 @@
import Document, { Html, Head, Main, NextScript } from "next/document";
export default class MyDocument extends Document {
render() {
return (
<Html lang="en-us">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}

View File

@@ -1,5 +1,5 @@
import { getAllNotes } from "../lib/parseNotes";
import { buildFeed } from "../lib/buildFeed";
import { getAllNotes } from "../lib/parse-notes";
import { buildFeed } from "../lib/build-feed";
import type { GetServerSideProps } from "next";
export const getServerSideProps: GetServerSideProps = async (context) => {

View File

@@ -1,5 +1,5 @@
import { getAllNotes } from "../lib/parseNotes";
import { buildFeed } from "../lib/buildFeed";
import { getAllNotes } from "../lib/parse-notes";
import { buildFeed } from "../lib/build-feed";
import type { GetServerSideProps } from "next";
export const getServerSideProps: GetServerSideProps = async (context) => {

View File

@@ -8,7 +8,7 @@ import Layout from "../../components/Layout";
import Container from "../../components/Container";
import Content from "../../components/Content";
import Meta from "../../components/notes/Meta";
import { notePaths, NOTES_PATH } from "../../lib/parseNotes";
import { notePaths, NOTES_PATH } from "../../lib/parse-notes";
import mdxComponents from "../../components/mdxComponents";
import * as config from "../../lib/config";
import type { GetStaticProps, GetStaticPaths } from "next";
@@ -102,7 +102,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
export const getStaticPaths: GetStaticPaths = async () => {
const paths = notePaths
// Remove file extensions for page paths
.map((path) => path.replace(/\.mdx?$/, ""))
.map((notePath) => notePath.replace(/\.mdx?$/, ""))
// Map the path into the static paths object required by Next.js
.map((slug) => ({ params: { slug } }));

View File

@@ -3,7 +3,7 @@ import groupBy from "lodash.groupby";
import Layout from "../../components/Layout";
import Container from "../../components/Container";
import List from "../../components/notes/List";
import { getAllNotes } from "../../lib/parseNotes";
import { getAllNotes } from "../../lib/parse-notes";
import type { GetStaticProps } from "next";
export default function Notes({ allNotes }) {