mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 15:06:36 -04:00
clean up strict types a bit more
This commit is contained in:
@ -61,8 +61,8 @@ const App = ({ Component, pageProps }: AppProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* all SEO config is in ../lib/config/seo.ts except for canonical URLs, which require access to next router */}
|
||||
<DefaultSeo
|
||||
// all SEO config is in ../lib/config/seo.ts except for canonical URLs, which require access to next router
|
||||
{...defaultSeo}
|
||||
canonical={canonical}
|
||||
openGraph={{
|
||||
|
@ -8,11 +8,11 @@ import * as mdxComponents from "../../lib/helpers/mdx-components";
|
||||
import { getNoteSlugs } from "../../lib/helpers/parse-notes";
|
||||
import { compileNote } from "../../lib/helpers/compile-note";
|
||||
import * as config from "../../lib/config";
|
||||
import { articleJsonLd } from "../../lib/config/seo";
|
||||
import { articleJsonLd, favicons } from "../../lib/config/seo";
|
||||
import type { GetStaticProps, GetStaticPaths } from "next";
|
||||
import type { Note, NoteFrontMatter } from "../../types";
|
||||
import type { NoteWithSource, NoteFrontMatter } from "../../types";
|
||||
|
||||
const Note = ({ frontMatter, source }: Note) => {
|
||||
const Note = ({ frontMatter, source }: NoteWithSource) => {
|
||||
return (
|
||||
<>
|
||||
<NextSeo
|
||||
@ -29,10 +29,9 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
publishedTime: frontMatter.date,
|
||||
modifiedTime: frontMatter.date,
|
||||
},
|
||||
// @ts-ignore
|
||||
images: frontMatter.image && [
|
||||
images: [
|
||||
{
|
||||
url: `${config.baseUrl}${frontMatter.image}`,
|
||||
url: `${config.baseUrl}${frontMatter.image || favicons.meJpg.src}`,
|
||||
alt: frontMatter.title,
|
||||
},
|
||||
],
|
||||
@ -47,8 +46,7 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
description={frontMatter.description || config.longDescription}
|
||||
datePublished={frontMatter.date}
|
||||
dateModified={frontMatter.date}
|
||||
// @ts-ignore
|
||||
images={frontMatter.image && [`${config.baseUrl}${frontMatter.image}`]}
|
||||
images={[`${config.baseUrl}${frontMatter.image || favicons.meJpg.src}`]}
|
||||
{...articleJsonLd}
|
||||
/>
|
||||
|
||||
@ -62,7 +60,6 @@ const Note = ({ frontMatter, source }: Note) => {
|
||||
/>
|
||||
</Content>
|
||||
|
||||
{/* comments can be disabled for an individual post via `noComments: true` in its front matter */}
|
||||
{!frontMatter.noComments && (
|
||||
<InView rootMargin="140px" triggerOnce fallbackInView>
|
||||
{({ inView, ref }) => (
|
||||
|
@ -115,7 +115,7 @@ export const getStaticProps: GetStaticProps = async () => {
|
||||
);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const results: { node: { [key: string]: any } }[] = response.user.repositories.edges;
|
||||
const results: Array<{ node: Record<string, any> }> = response.user.repositories.edges;
|
||||
|
||||
const repos = results.map<Repository>(({ node: repo }) => ({
|
||||
name: repo.name,
|
||||
|
Reference in New Issue
Block a user