Closed MoribundMedium closed 3 years ago
This is cool. What does the forward slash represent?
This is cool. What does the forward slash represent?
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"
.
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 thegatsby develop
command, but broke withgatsby 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 aswindow.location
, but I'm not entirely sure if those are the same or different thandocument.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.