1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-09-13 23:55:35 -04:00

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

View File

@@ -49,16 +49,16 @@ const App = ({ Component, pageProps }: AppProps) => {
defaultTitle={`${config.siteName} ${config.shortDescription}`}
titleTemplate={`%s ${config.siteName}`}
description={config.longDescription}
canonical={`${config.baseURL}/`}
canonical={`${config.baseUrl}/`}
openGraph={{
site_name: config.siteName,
title: `${config.siteName} ${config.shortDescription}`,
url: `${config.baseURL}/`,
url: `${config.baseUrl}/`,
locale: "en_US",
type: "website",
images: [
{
url: `${config.baseURL}${meJpg.src}`,
url: `${config.baseUrl}${meJpg.src}`,
alt: `${config.siteName} ${config.shortDescription}`,
},
],
@@ -170,9 +170,9 @@ const App = ({ Component, pageProps }: AppProps) => {
<SocialProfileJsonLd
type="Person"
name="Jake Jarvis"
url={`${config.baseURL}/`}
url={`${config.baseUrl}/`}
sameAs={[
`${config.baseURL}/`,
`${config.baseUrl}/`,
"https://github.com/jakejarvis",
"https://keybase.io/jakejarvis",
"https://twitter.com/jakejarvis",

View File

@@ -12,8 +12,6 @@ Sentry.init({
environment: process.env.NODE_ENV || process.env.VERCEL_ENV || process.env.NEXT_PUBLIC_VERCEL_ENV || "",
});
const BASE_URL = config.baseURL === "" ? `https://${config.siteDomain}/` : `${config.baseURL}/`;
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
try {
// permissive access control headers
@@ -94,7 +92,7 @@ const getSiteStats = async (client) => {
// get database and RSS results asynchronously
const parser = new Parser();
const [feed, result] = await Promise.all([
parser.parseURL(`${BASE_URL}feed.xml`),
parser.parseURL(`${config.baseUrl}/feed.xml`),
client.query(
q.Map(
q.Paginate(q.Documents(q.Collection("hits")), { size: 99 }),
@@ -111,7 +109,7 @@ const getSiteStats = async (client) => {
pages.map((p) => {
// match URLs from RSS feed with db to populate some metadata
const match = feed.items.find((x) => x.link === `${BASE_URL}${p.slug}/`);
const match = feed.items.find((x) => x.link === `${config.baseUrl}/${p.slug}/`);
if (match) {
p.title = decode(match.title);
p.url = match.link;

View File

@@ -32,7 +32,7 @@ const Note = ({ source, frontMatter, slug }) => (
},
images: [
{
url: `${config.baseURL}${frontMatter.image}`,
url: `${config.baseUrl}${frontMatter.image}`,
alt: frontMatter.title,
},
],
@@ -44,15 +44,15 @@ const Note = ({ source, frontMatter, slug }) => (
}}
/>
<ArticleJsonLd
url={`${config.baseURL}/notes/${slug}`}
url={`${config.baseUrl}/notes/${slug}`}
title={frontMatter.title}
description={frontMatter.description}
datePublished={frontMatter.date}
dateModified={frontMatter.date}
images={[`${config.baseURL}${frontMatter.image}`]}
images={[`${config.baseUrl}${frontMatter.image}`]}
authorName={[config.authorName]}
publisherName={config.siteName}
publisherLogo={`${config.baseURL}/static/images/me.jpg`}
publisherLogo={`${config.baseUrl}/static/images/me.jpg`}
/>
<Layout>