1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-11-20 19:40:52 -05:00

just some refactoring

This commit is contained in:
2022-03-09 14:07:06 -05:00
parent f5c8a7a21a
commit 87848cc697
26 changed files with 533 additions and 558 deletions

View File

@@ -1,5 +1,5 @@
import { Html, Head, Main, NextScript } from "next/document";
import { getCssText, preloadUrls } from "../lib/styles/stitches.config";
import { getCssText, fonts } from "../lib/styles/stitches.config";
import * as config from "../lib/config";
// https://nextjs.org/docs/advanced-features/custom-document
@@ -7,15 +7,17 @@ const Document = () => {
return (
<Html lang={config.siteLocale?.replace("_", "-")}>
<Head>
{/* static asset preloads */}
<link rel="preload" as="font" type="font/woff2" href={preloadUrls.fonts.InterVar} crossOrigin="anonymous" />
<link
rel="preload"
as="font"
type="font/woff2"
href={preloadUrls.fonts.RobotoMonoVar}
crossOrigin="anonymous"
/>
{/* preload highest priority fonts defined in ../lib/styles/fonts/ */}
{fonts.preloadUrls.map((relativeUrl, index) => (
<link
key={`font-${index}`}
rel="preload"
as="font"
type="font/woff2"
href={relativeUrl}
crossOrigin="anonymous"
/>
))}
{/* stitches SSR: https://stitches.dev/blog/using-nextjs-with-stitches#step-3-ssr */}
<style id="stitches" dangerouslySetInnerHTML={{ __html: getCssText() }} />

View File

@@ -1,6 +1,6 @@
import pRetry from "p-retry";
import faunadb from "faunadb";
import { getAllNotes } from "../../lib/parse-notes";
import { getAllNotes } from "../../lib/helpers/parse-notes";
import { logServerError } from "../../lib/helpers/sentry";
import type { NextApiRequest, NextApiResponse } from "next";

View File

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

View File

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

View File

@@ -5,8 +5,8 @@ import { htmlEscape } from "escape-goat";
import Content from "../../components/Content/Content";
import NoteMeta from "../../components/NoteMeta/NoteMeta";
import Comments from "../../components/Comments/Comments";
import * as mdxComponents from "../../lib/mdx-components";
import { getNote, getNoteSlugs } from "../../lib/parse-notes";
import * as mdxComponents from "../../lib/helpers/mdx-components";
import { getNote, getNoteSlugs } from "../../lib/helpers/parse-notes";
import * as config from "../../lib/config";
import { articleJsonLd } from "../../lib/config/seo";
import type { GetStaticProps, GetStaticPaths } from "next";

View File

@@ -2,7 +2,7 @@ import { NextSeo } from "next-seo";
import { format } from "date-fns";
import Content from "../../components/Content/Content";
import NotesList, { NotesListProps } from "../../components/NotesList/NotesList";
import { getAllNotes } from "../../lib/parse-notes";
import { getAllNotes } from "../../lib/helpers/parse-notes";
import type { GetStaticProps } from "next";
const Notes = ({ notesByYear }: NotesListProps) => (

View File

@@ -1,5 +1,5 @@
import { getServerSideSitemap } from "next-sitemap";
import { getAllNotes } from "../lib/parse-notes";
import { getAllNotes } from "../lib/helpers/parse-notes";
import { baseUrl } from "../lib/config";
import type { GetServerSideProps } from "next";
import type { ISitemapField } from "next-sitemap";