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

prepare for new next/link behavior

see new-next-link branch
This commit is contained in:
2022-04-28 12:32:50 -04:00
parent ad1d1bbce1
commit e1da53a1fe
9 changed files with 13 additions and 16 deletions

View File

@@ -113,7 +113,7 @@ const getSiteStats = async (client: faunadb.Client) => {
pages,
};
pages.map((page) => {
pages.forEach((page) => {
// match URLs from RSS feed with db to populate some metadata
const match = notes.find((note) => `notes/${note.slug}` === page.slug);
if (match) {

View File

@@ -5,12 +5,10 @@ const ColorfulLink = ({
lightColor,
darkColor,
css,
fancy = true,
...rest
}: CustomLinkProps & {
lightColor: string;
darkColor: string;
fancy?: boolean;
}) => {
return (
<Link
@@ -25,7 +23,6 @@ const ColorfulLink = ({
...css,
}}
fancy={fancy}
{...rest}
/>
);
@@ -319,7 +316,7 @@ const Index = () => (
title="My Public Key"
lightColor="#757575"
darkColor="#959595"
fancy={false}
underline={false}
forceNewWindow
>
🔐 <PGPKey>2B0C 9CF2 51E6 9A39</PGPKey>

View File

@@ -25,7 +25,7 @@ export const getStaticProps: GetStaticProps = async () => {
const notes = await getAllNotes();
const notesByYear: NotesListProps["notesByYear"] = {};
notes.map((note) => {
notes.forEach((note) => {
const year = new Date(note.date).getUTCFullYear();
(notesByYear[year] || (notesByYear[year] = [])).push(note);
});

View File

@@ -33,7 +33,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
// push notes separately and use their metadata
const notes = await getAllNotes();
notes.map((note) =>
notes.forEach((note) =>
pages.push({
loc: urlJoin("/notes/", note.slug, "/"),
// pull lastMod from front matter date
@@ -43,7 +43,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
);
// make all relative URLs absolute
pages.map((page) => (page.loc = urlJoin(baseUrl, page.loc)));
pages.forEach((page) => (page.loc = urlJoin(baseUrl, page.loc)));
// cache on edge for 12 hours
const { res } = context;

View File

@@ -35,7 +35,7 @@ const Stats = () => (
<Content>
<PoweredBy>
Powered by{" "}
<Link href="https://usefathom.com/ref/ZEYG0O" fancy={false}>
<Link href="https://usefathom.com/ref/ZEYG0O" underline={false}>
<FathomIcon /> Fathom Analytics
</Link>
</PoweredBy>