fix build crash

This commit is contained in:
Chuck Dries 2022-07-10 17:24:25 -07:00
parent 273f3a1d93
commit c846922baf
No known key found for this signature in database
GPG Key ID: A00B7AEAE1DC5BE6
2 changed files with 5 additions and 3 deletions

View File

@ -1,13 +1,15 @@
# chuckdries.com
![screenshot of website](static/screenshot-1.png)
[![Build Status](https://drone.chuckdries.com/api/badges/chuckdries/Personal-Website/status.svg)](https://drone.chuckdries.com/chuckdries/Personal-Website)
My personal website.
My personal website. Built with
- gatsby
- tailwind
- node-vibrant
- react-helmet
and a totally from-scratch masonry gallery component that I will write a blog post about some day.
![screenshot of website](static/screenshot-2.png)
I use node-vibrant in the gatsby OnCreateNode hook to pull colors from the images and store them in the gatsby node structure. I query them in the client, then assign CSS custom properties with react-helmet. In my tailwind config, I define custom colors that use those properties. This gets me classes like `text-vibrant-light` that change colors to vibe with the selected image

View File

@ -84,7 +84,7 @@ export const getGalleryPageUrl = (
{ keyword, sortKey },
hash
) => {
const url = new URL(`${window.location.origin}/photogallery/`);
const url = new URL(`${window?.location.origin ?? 'https://chuckdries.com'}/photogallery/`);
if (keyword !== undefined) {
if (keyword === null) {
url.searchParams.delete("filter");