nashvillefcc / nashvillefccwebsite

Contains code related to Nashville FCC website
https://www.nashvillefcc.com
MIT License
9 stars 12 forks source link

Added null check to fix build error #64

Closed MoribundMedium closed 3 years ago

MoribundMedium commented 3 years ago

Added null check to location property to fix a build error that was introduced in PR #47. The site was working fine in development mode with the gatsby develop command, but broke with gatsby build. I resolved the issue using the recommended fix listed here as number 1: https://www.gatsbyjs.com/docs/debugging-html-builds/

I assumed that location in the original PR is the same as window.location, but I'm not entirely sure if those are the same or different than document.location. The article on MDN for location links to the same W3 spec that the article for window.location does, so I assumed it is.

Main changes are the introduction of lines 18 and 19, and change to the function invocation on line 36. The rest of the changes were introduced by my linter.

christianzoll commented 3 years ago

This is cool. What does the forward slash represent?

image

tylermwatts commented 3 years ago

This is cool. What does the forward slash represent?

image

Hey Hans,

The path (or pathname) here refers to the part of the URL after the host name. Typically, a forward slash by itself indicates the home or index page (www.mywebsite.com). If the full URL were instead something like "www.mywebsite.com/about", the path or pathname would be "/about".