mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-11-05 07:05:40 -05:00
a bit more cleanup
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
// @ts-check
|
||||
|
||||
const config = {
|
||||
const constants = {
|
||||
// Site info
|
||||
siteName: "Jake Jarvis",
|
||||
siteLocale: "en-US",
|
||||
@@ -20,11 +18,6 @@ const config = {
|
||||
licenseUrl: "https://creativecommons.org/licenses/by/4.0/",
|
||||
copyrightYearStart: 2001,
|
||||
githubRepo: "jakejarvis/jarv.is",
|
||||
giscusConfig: {
|
||||
// https://github.com/giscus/giscus-component/tree/main/packages/react#readme
|
||||
repoId: "MDEwOlJlcG9zaXRvcnk1MzM0MDgxMQ==",
|
||||
categoryId: "DIC_kwDOAy3qi84CAsjS",
|
||||
},
|
||||
|
||||
// Me info
|
||||
authorName: "Jake Jarvis",
|
||||
@@ -42,4 +35,4 @@ const config = {
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
export default constants;
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Feed } from "feed";
|
||||
import { getAllPosts } from "./posts";
|
||||
import config from "../config";
|
||||
import config from "../config/constants";
|
||||
|
||||
import meJpg from "../../app/me.jpg";
|
||||
|
||||
export const buildFeed = async (options: { type: "rss" | "atom" | "json" }): Promise<string> => {
|
||||
export const buildFeed = async (): Promise<Feed> => {
|
||||
// https://github.com/jpmonette/feed#example
|
||||
const feed = new Feed({
|
||||
id: config.baseUrl,
|
||||
@@ -43,15 +43,5 @@ export const buildFeed = async (options: { type: "rss" | "atom" | "json" }): Pro
|
||||
});
|
||||
});
|
||||
|
||||
if (options.type === "rss") {
|
||||
return feed.rss2();
|
||||
} else if (options.type === "atom") {
|
||||
return feed.atom1();
|
||||
} else if (options.type === "json") {
|
||||
// rare but including as an option because why not...
|
||||
// https://www.jsonfeed.org/
|
||||
return feed.json1();
|
||||
} else {
|
||||
throw new TypeError(`Invalid feed type "${options.type}", must be "rss", "atom", or "json".`);
|
||||
}
|
||||
return feed;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ import dayjsRelativeTime from "dayjs/plugin/relativeTime";
|
||||
import dayjsLocalizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import dayjsAdvancedFormat from "dayjs/plugin/advancedFormat";
|
||||
import "dayjs/locale/en";
|
||||
import config from "../config";
|
||||
import config from "../config/constants";
|
||||
|
||||
const IsomorphicDayJs = (date?: dayjs.ConfigType): dayjs.Dayjs => {
|
||||
// plugins
|
||||
|
||||
@@ -3,7 +3,7 @@ import glob from "fast-glob";
|
||||
import pMap from "p-map";
|
||||
import pMemoize from "p-memoize";
|
||||
import { formatDate } from "./format-date";
|
||||
import config from "../config";
|
||||
import config from "../config/constants";
|
||||
|
||||
// path to directory with .mdx files, relative to project root
|
||||
const POSTS_DIR = "notes";
|
||||
|
||||
Reference in New Issue
Block a user