1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 17:46:39 -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

@ -1,7 +1,7 @@
"use client";
import Giscus from "@giscus/react";
import config from "../../lib/config";
import config from "../../lib/config/constants";
import type { GiscusProps } from "@giscus/react";
export type CommentsProps = {
@ -10,9 +10,9 @@ export type CommentsProps = {
const Comments = ({ title }: CommentsProps) => {
// fail silently if giscus isn't configured
if (!config.giscusConfig) {
if (!process.env.NEXT_PUBLIC_GISCUS_REPO_ID || !process.env.NEXT_PUBLIC_GISCUS_CATEGORY_ID) {
console.warn(
"[giscus] not configured, ensure giscusConfig.repoId and giscusConfig.categoryId are set in lib/config/index.js"
"[giscus] not configured, ensure 'NEXT_PUBLIC_GISCUS_REPO_ID' and 'NEXT_PUBLIC_GISCUS_CATEGORY_ID' environment variables are set."
);
return null;
@ -22,14 +22,15 @@ const Comments = ({ title }: CommentsProps) => {
return (
<Giscus
repo={config.githubRepo as GiscusProps["repo"]}
repoId={config.giscusConfig.repoId}
repoId={process.env.NEXT_PUBLIC_GISCUS_REPO_ID}
term={title}
category="Comments"
categoryId={config.giscusConfig.categoryId}
categoryId={process.env.NEXT_PUBLIC_GISCUS_CATEGORY_ID}
mapping="specific"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme="preferred_color_scheme"
loading="lazy"
/>
);

View File

@ -2,7 +2,7 @@ import clsx from "clsx";
import Link from "../Link";
import { GoHeartFill } from "react-icons/go";
import { SiNextdotjs } from "react-icons/si";
import config from "../../lib/config";
import config from "../../lib/config/constants";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Footer.module.css";

View File

@ -2,7 +2,7 @@ import clsx from "clsx";
import Link from "../Link";
import Image from "../Image";
import Menu from "../Menu";
import config from "../../lib/config";
import config from "../../lib/config/constants";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Header.module.css";

View File

@ -1,7 +1,7 @@
import NextLink from "next/link";
import clsx from "clsx";
import objStr from "obj-str";
import config from "../../lib/config";
import config from "../../lib/config/constants";
import type { ComponentPropsWithoutRef } from "react";
import styles from "./Link.module.css";

View File

@ -35,10 +35,11 @@ const Video = ({ src, poster, autoplay = false, responsive = true, className, ..
>
{src.map((file) => {
const extension = file.split(".").pop();
if (extension === "vtt") {
return <track key={file} kind="subtitles" src={file} srcLang="en" label="English" default />;
} else {
return <source key={file} src={file} type={`video/${file.split(".").pop()}`} />;
return <source key={file} src={file} type={`video/${extension}`} />;
}
})}
</video>