test config changes before messing everything up too much

This commit is contained in:
2022-01-03 09:59:42 -05:00
parent c708383afb
commit 36e3cfa18e
9 changed files with 178 additions and 169 deletions
+10 -11
View File
@@ -3,22 +3,21 @@ import { getAllNotes } from "./parse-notes";
import * as config from "./config";
export const buildFeed = () => {
const baseURL = config.baseURL || "http://localhost:3000"; // necessary for local testing
const feed = new Feed({
id: `${baseURL}/`,
link: `${baseURL}/`,
id: `${config.baseUrl}/`,
link: `${config.baseUrl}/`,
title: config.siteName,
description: config.longDescription,
copyright: "https://creativecommons.org/licenses/by/4.0/",
updated: new Date(),
image: `${baseURL}/static/images/me.jpg`,
image: `${config.baseUrl}/static/images/me.jpg`,
feedLinks: {
rss: `${baseURL}/feed.xml`,
atom: `${baseURL}/feed.atom`,
rss: `${config.baseUrl}/feed.xml`,
atom: `${config.baseUrl}/feed.atom`,
},
author: {
name: config.authorName,
link: baseURL,
link: config.baseUrl,
email: "jake@jarv.is",
},
});
@@ -27,14 +26,14 @@ export const buildFeed = () => {
notes.forEach((note: any) => {
feed.addItem({
title: note.title,
link: `${baseURL}/notes/${note.slug}/`,
guid: `${baseURL}/notes/${note.slug}/`,
link: `${config.baseUrl}/notes/${note.slug}/`,
guid: `${config.baseUrl}/notes/${note.slug}/`,
description: note.description,
image: note.image ? `${baseURL}${note.image}` : "",
image: note.image ? `${config.baseUrl}${note.image}` : "",
author: [
{
name: config.authorName,
link: baseURL,
link: config.baseUrl,
},
],
date: new Date(note.date),
+24 -30
View File
@@ -1,33 +1,27 @@
// Site info
export const siteName = "Jake Jarvis";
export const siteDomain = "jarv.is";
export const shortDescription = "Front-End Web Developer in Boston, MA";
export const longDescription =
"Hi there! I'm a frontend web developer based in Boston, Massachusetts specializing in the JAMstack, modern JavaScript frameworks, and progressive web apps.";
export const themeColorLight = "#fcfcfc";
export const themeColorDark = "#252525";
export const githubRepo = "jakejarvis/jarv.is";
export const fathomSiteId = "WBGNQUKW";
export const fathomCustomDomain = "blue-chilly.jarv.is";
module.exports = {
// Site info
siteName: "Jake Jarvis",
siteDomain: "jarv.is",
onionDomain: "jarvis2i2vp4j4tbxjogsnqdemnte5xhzyi7hziiyzxwge3hzmh57zad.onion",
baseUrl: process.env.BASE_URL,
shortDescription: "Front-End Web Developer in Boston, MA",
longDescription:
"Hi there! I'm a frontend web developer based in Boston, Massachusetts specializing in the JAMstack, modern JavaScript frameworks, and progressive web apps.",
themeColorLight: "#fcfcfc",
themeColorDark: "#252525",
githubRepo: "jakejarvis/jarv.is",
fathomSiteId: "WBGNQUKW",
fathomCustomDomain: "blue-chilly.jarv.is",
let baseURL = ""; // default to relative URLs
if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") {
// vercel production (set manually above)
baseURL = `https://${siteDomain}`;
} else if (process.env.NEXT_PUBLIC_VERCEL_URL) {
// vercel deploy previews
baseURL = `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`;
}
export { baseURL };
// Me info
authorName: "Jake Jarvis",
twitterHandle: "jakejarvis",
facebookAppId: "3357248167622283",
webmentionId: "jarv.is",
monetization: "$ilp.uphold.com/BJp6d2FrEB69",
// Me info
export const authorName = "Jake Jarvis";
export const twitterHandle = "jakejarvis";
export const facebookAppId = "3357248167622283";
export const webmentionId = "jarv.is";
export const monetization = "$ilp.uphold.com/BJp6d2FrEB69";
// Next.js constants
NOTES_DIR: "./notes",
// Next.js constants
export const NOTES_DIR = "notes";
// ...note / TODO: there is still a metric poop ton of this kind of info hard-coded.
// ...note / TODO: there is still a metric poop ton of this kind of info hard-coded.
};
+2 -2
View File
@@ -12,9 +12,9 @@ export const getNoteData = (file: string) => {
return {
...data,
slug: slug,
slug,
date: parseISO(data.date).toISOString(), // validate/normalize the date string provided from front matter
year: parseInt(format(parseISO(data.date), "yyyy")),
year: parseInt(format(parseISO(data.date), "yyyy")), // parse years here so it's easier to group them on list page
};
};