-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc updates and prep for portaltech. #89
Conversation
@@ -0,0 +1,37 @@ | |||
# Git normalization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just another dot file :D
@@ -1 +1,2 @@ | |||
GATSBY_STORYBLOK_ACCESS_TOKEN={REPLACE THIS WITH THE ACCESS TOKEN FOR YOUR SPACE} | |||
SECRET={ANY STRING YOU WANT} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be needed for the auth stuff but can be used for other signing purposes and is already on netlify's environment vars.
include_favicon: false, | ||
crossOrigin: `use-credentials`, | ||
icons: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have external favicons and touch icons so we need to disable them in the manifest or we get 404 not found errors in the console.
gatsby-node.js
Outdated
@@ -34,7 +34,7 @@ exports.createPages = ({ graphql, actions }) => { | |||
|
|||
const entries = result.data.allStoryblokEntry.edges | |||
entries.forEach((entry, index) => { | |||
let pagePath = entry.node.full_slug == 'home' ? '' : `${entry.node.full_slug}/` | |||
let pagePath = entry.node.full_slug == 'home' ? '' : `${entry.node.full_slug}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ending slash was causing a number of //
URLs from storyblok
also, not having the slash allows gatsby's routing to function better and navigate()
works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I added the slash because the Gatsby's check for current/active page only works if it has an ending slash 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh never mind - this isn't in the place where it matters so it should be fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, ok, sounds like we need to do some trimming on the slug then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have doxn or a link to the code for the active page checks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or this in the sidebar nav
https://giving-preview.stanford.edu/how-to-make-a-gift/planned-giving/bequests-and-estate-plan-gifts/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's still working with your changes 👍
https://deploy-preview-89--adapt-giving.netlify.app/how-to-make-a-gift/planned-giving/bequests-and-estate-plan-gifts/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm.....so I guess the thing is if someone comes to a page via a link without the ending slash will not get the active class
https://deploy-preview-89--adapt-giving.netlify.app/how-to-make-a-gift/planned-giving/founding-grant-society
All the links within the site which uses the link component adds the trailing slash so if they navigate using links on the site, it's ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting. See: gatsbyjs/gatsby#7737
Looks like we have a bit of sanitization to do. FWIW, ending in a slash looks to be the way to go but you can specify the partiallySelected option to get at things that are double slashed or #
anchored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revise.
@@ -2,7 +2,7 @@ | |||
# ############################################################################## | |||
[build] | |||
publish = "public" | |||
functions = "netlify-functions" | |||
functions = "lambda" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a sort-of-a-standard from other projects
Access-Control-Allow-Origin = "*" | ||
X-Frame-Options = "SAMEORIGIN" | ||
Content-Security-Policy = "form-action https:; frame-src *.stanford.edu *.storyblok.com *.kimbia.com *.stripe.com *.stripe.network" | ||
Referrer-Policy = "origin-when-cross-origin" | ||
Strict-Transport-Security = "max-age=2592000" | ||
Feature-Policy = "vibrate 'none'; geolocation 'none'; midi 'none'; notifications 'none'; push 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; speaker 'none'; vibrate 'none'; fullscreen 'none'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some security hardening.
[[redirects]] | ||
from = "/api/*" | ||
to = "/.netlify/functions/:splat" | ||
status = 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows us to use the urls /api/something/something
instead of netlify's /.netlify/functions/something/something
@katrialesser FYI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just that one thing about the active class check issue if someone access a page without adding a trailing slash at the end. Within site navigation is generally ok since our link component adds the trailing slash (in navigation, card links etc).
I'm off this afternoon. If you need this ready for Monday please feel free to merge this in. I've looked around in this branch's netlify build and things look normal to me (which is good 😄 ). We can figure out the active class thing later.
@yvonnetangsu revised slug/path sanitization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sherakama for the detailed comments about what the changes effectively do. Helps a lot to have that. Everything looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the slug revision - works well! GTG 🥳
READY FOR REVIEW
Summary
Review By (Date)
Criticality
Review Tasks
Associated Issues and/or People
Resources