1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 13:06:37 -04:00

a bit more cleanup

This commit is contained in:
2025-03-07 14:56:49 -05:00
parent 354dade9aa
commit 9229f92c0c
23 changed files with 50 additions and 58 deletions

View File

@ -3,7 +3,7 @@
import { headers } from "next/headers";
import { z } from "zod";
import { Resend } from "resend";
import config from "../../lib/config";
import config from "../../lib/config/constants";
const schema = z.object({
name: z.string().min(1, { message: "Name is required" }),

View File

@ -3,7 +3,7 @@ import { buildFeed } from "../../lib/helpers/build-feed";
export const dynamic = "force-static";
export const GET = async () => {
return new Response(await buildFeed({ type: "atom" }), {
return new Response((await buildFeed()).atom1(), {
headers: {
"content-type": "application/atom+xml; charset=utf-8",
},

View File

@ -3,7 +3,7 @@ import { buildFeed } from "../../lib/helpers/build-feed";
export const dynamic = "force-static";
export const GET = async () => {
return new Response(await buildFeed({ type: "rss" }), {
return new Response((await buildFeed()).rss2(), {
headers: {
"content-type": "application/rss+xml; charset=utf-8",
},

View File

@ -4,7 +4,7 @@ import { ThemeProvider } from "../contexts/ThemeContext";
import Header from "../components/Header";
import Footer from "../components/Footer";
import { SkipToContentLink, SkipToContentTarget } from "../components/SkipToContent";
import config from "../lib/config";
import config from "../lib/config/constants";
import type { Metadata } from "next";
import type { Person, WithContext } from "schema-dts";

View File

@ -1,4 +1,4 @@
import config from "../lib/config";
import config from "../lib/config/constants";
import type { MetadataRoute } from "next";
const manifest = (): MetadataRoute.Manifest => {

View File

@ -8,7 +8,7 @@ import Loading from "../../../components/Loading";
import HitCounter from "./counter";
import { getPostSlugs, getFrontMatter } from "../../../lib/helpers/posts";
import { metadata as defaultMetadata } from "../../layout";
import config from "../../../lib/config";
import config from "../../../lib/config/constants";
import { FiCalendar, FiTag, FiEdit, FiEye } from "react-icons/fi";
import type { Metadata, Route } from "next";
import type { Article, WithContext } from "schema-dts";

View File

@ -2,7 +2,7 @@ import Content from "../../components/Content";
import Link from "../../components/Link";
import Time from "../../components/Time";
import { getAllPosts } from "../../lib/helpers/posts";
import config from "../../lib/config";
import config from "../../lib/config/constants";
import { metadata as defaultMetadata } from "../layout";
import type { ReactElement } from "react";
import type { Metadata, Route } from "next";

View File

@ -4,7 +4,7 @@ import PageTitle from "../../components/PageTitle";
import Link from "../../components/Link";
import RelativeTime from "../../components/RelativeTime";
import commaNumber from "comma-number";
import config from "../../lib/config";
import config from "../../lib/config/constants";
import { metadata as defaultMetadata } from "../layout";
import { GoStar, GoRepoForked } from "react-icons/go";
import { SiGithub } from "react-icons/si";
@ -43,8 +43,8 @@ type Project = {
async function getRepos(): Promise<Project[] | null> {
// don't fail the entire site build if the required API key for this page is missing
if (!process.env.GH_PUBLIC_TOKEN || process.env.GH_PUBLIC_TOKEN === "") {
console.warn(`ERROR: I can't fetch any GitHub projects without "GH_PUBLIC_TOKEN" set! Skipping for now...`);
if (!process.env.GITHUB_TOKEN || process.env.GITHUB_TOKEN === "") {
console.warn(`ERROR: I can't fetch any GitHub projects without "GITHUB_TOKEN" set! Skipping for now...`);
return null;
}
@ -86,7 +86,7 @@ async function getRepos(): Promise<Project[] | null> {
limit: 12,
headers: {
accept: "application/vnd.github.v3+json",
authorization: `token ${process.env.GH_PUBLIC_TOKEN}`,
authorization: `token ${process.env.GITHUB_TOKEN}`,
},
}
);

View File

@ -1,4 +1,4 @@
import config from "../lib/config";
import config from "../lib/config/constants";
import type { MetadataRoute } from "next";
export const dynamic = "force-static";

View File

@ -1,7 +1,7 @@
import path from "path";
import glob from "fast-glob";
import { getAllPosts } from "../lib/helpers/posts";
import config from "../lib/config";
import config from "../lib/config/constants";
import type { MetadataRoute } from "next";
export const dynamic = "force-static";