Skip to content

Commit

Permalink
Use consts (#687)
Browse files Browse the repository at this point in the history
feedback from #686
  • Loading branch information
bradystroud authored Sep 25, 2024
1 parent 971674b commit a86fde0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ exports.createPages = async function ({ actions, graphql }) {
});

function getLastSegment(url) {
let segments = url.split('/');
const segments = url.split('/');
return segments[segments.length - 1];
}

Expand All @@ -504,7 +504,7 @@ exports.createPages = async function ({ actions, graphql }) {
}

if (person.path.includes('alumni')) {
var originalPath = getLastSegment(person.path); // Gets the path, removing the /alumni/ prefix
const originalPath = getLastSegment(person.path); // Gets the path, removing the /alumni/ prefix
actions.createRedirect({
fromPath: originalPath,
toPath: `/${person.path}`, // Redirects to the alumni page
Expand Down

0 comments on commit a86fde0

Please sign in to comment.