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:
@ -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"
|
||||
/>
|
||||
);
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user