oleeskild / digitalgarden

261 stars 147 forks source link

Local graph blocked on Home node #247

Open Shynif opened 5 months ago

Shynif commented 5 months ago

Local graph only shows the graph from the home node

Why

Netlify makes lowercase url but the graph.json containing the graph is case sensitive. It can't find the url in the JSON so it goes on the Home node as a default backup value.

Fix

Quick and dirty fix (makes the current node graph case insensitive !!! Watchout for collisions) Edit src/site/_includes/components/graphScript.njk Add the following right after line 30

for (var key in remaining) {
    if (key.toLowerCase()==currentLink) {
        currentNode = remaining[key];
    }
}

I just post this here in case someone ran in that same problem. I don't think there is a universal magic trick to properly fix this.