Skip to content

Commit

Permalink
fix(sliders): adds sliders CPT to link node normalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
avinoamsn committed Feb 2, 2022
1 parent 2a454ec commit 2ee35dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"languageStylus.useSeparator": false,
"editor.formatOnSave": true,
"css.validate": false,
"css.validate": false, // don't recall how the css is configured w/ tailwind, but it doesn't follow typical syntax
// "postcss.validate": false,
"commentAnchors.tags.list": [
{
"tag": "ANCHOR",
Expand Down Expand Up @@ -59,6 +60,6 @@
"scope": "workspace",
"behavior": "link"
}
] // don't recall how the css is configured w/ tailwind, but it doesn't follow typical syntax
// "postcss.validate": false
],
"cSpell.words": ["bbcec", "copays", "elasticlunr", "icer", "WPCOM"]
}
6 changes: 3 additions & 3 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ module.exports = {
normalizers: normalizers => [
...normalizers,
{
// Normalizes the link format, so Gatsby doesn't drop
// one type (link___NODE or external url string)
// ? Normalizes the link format, so it's not left up to (unpredictable) Gatsby type inference (link___NODE or external url string)
name: `AcfLinkNormalizer`,
normalizer: ({ entities }) => {
console.log(`Normalizing links...`)
Expand All @@ -124,7 +123,8 @@ module.exports = {
e.__type === `wordpress__wp_annual_reports` ||
e.__type === `wordpress__wp_events` ||
e.__type === `wordpress__wp_covid_19s` ||
e.__type === `wordpress__wp_icer_resources`
e.__type === `wordpress__wp_icer_resources` ||
e.__type === `wordpress__wp_sliders`
) {
// if the link is being treated as a node, then find and return the actual url
if (e.acf.link___NODE)
Expand Down

0 comments on commit 2ee35dd

Please sign in to comment.