Skip to content

Commit

Permalink
add opengraph image
Browse files Browse the repository at this point in the history
  • Loading branch information
lyleschemmerling committed Aug 15, 2023
1 parent 6978adf commit bd0f7ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions astro/src/components/Head.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
const { description, title } = Astro.props;
const openGraphImage = new URL("/img/articles-developers.png", Astro.url);
const { description, title, openGraphImage } = Astro.props;
const openGraphImageUrl = openGraphImage ? new URL(openGraphImage, Astro.url): new URL("/img/articles-developers.png", Astro.url);
const normalizedUrl = Astro.url.toString().replace(/.html$/, '');
const isProd = import.meta.env.PROD as boolean;
---
Expand Down Expand Up @@ -30,7 +30,7 @@ const isProd = import.meta.env.PROD as boolean;
<meta name="og:title" content={title}/>
<meta property="og:type" content="website"/>
<meta property="og:locale" content="en_US"/>
<meta property="og:image" content={openGraphImage}/>
<meta property="og:image" content={openGraphImageUrl}/>
{ isProd &&
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
Expand Down
6 changes: 3 additions & 3 deletions astro/src/layouts/Blog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const markdownStyles = [
---
<!DOCTYPE html>
<html class="antialiased" lang="en">
<HeadComponent title={ title } description={description}></HeadComponent>
<HeadComponent title={ title } description={description} openGraphImage={image}></HeadComponent>
<body class="antialiased leading-tight">
<Nav/>
<!-- Hero -->
Expand Down Expand Up @@ -118,8 +118,8 @@ const markdownStyles = [
</div>
</section>
<section id="blog-content">
<div
class="max-w-8xl mx-auto pt-2 px-6 lg:pr-0 lg:w-10/12 xl:pl-32 xl:w-10/12 2xl:mx-auto 2xl:pl-40 2xl:pr-0 2xl:w-8/12">
<div name="blog-main-div"
class="max-w-8xl mx-auto pt-2 px-6 lg:pr-0 lg:w-10/12 xl:pl-36 xl:w-10/12 2xl:mx-auto 2xl:pl-40 2xl:pr-0 2xl:w-8/12">
<div class="mt-4">
<div class="md:flex md:flex-col md:justify-start lg:flex-row lg:self-start">
<div id="content" class="mb-16 md:basis-full md:mr-10 md:w-full lg:w-4/6 xl:mr-0 2xl:mr-12">
Expand Down
18 changes: 9 additions & 9 deletions src/cloudfront/fusionauth-website-request-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ function handler(event) {
}

// fusionauth:rocks
if (hdrs.host && hdrs.host.value !== 'fusionauth.io' && (!hdrs.authorization || hdrs.authorization.value !== 'Basic ZnVzaW9uYXV0aDpyb2Nrcw==')) {
return {
statusCode: 401,
statusDescription: 'Unauthorized',
headers: {
'www-authenticate': { value: 'Basic' }
}
};
}
//if (hdrs.host && hdrs.host.value !== 'fusionauth.io' && (!hdrs.authorization || hdrs.authorization.value !== 'Basic ZnVzaW9uYXV0aDpyb2Nrcw==')) {
// return {
// statusCode: 401,
// statusDescription: 'Unauthorized',
// headers: {
// 'www-authenticate': { value: 'Basic' }
// }
// };
//}

var uri = req.uri;
if (uri.endsWith('.html')) {
Expand Down

0 comments on commit bd0f7ca

Please sign in to comment.