in gatsby/onCreateNode.js [14:26]
function buildRedirectString(permalink, redirect_from) {
if (!permalink || !permalink.endsWith('.html')) {
return redirect_from ? JSON.stringify(redirect_from) : '';
}
let basePath = permalink.slice(0, -'.html'.length);
let redirects = [basePath, basePath + '/'];
if (Array.isArray(redirect_from)) {
redirects = redirects.concat(redirect_from);
}
return JSON.stringify(redirects);
}