Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
15 lines
463 B
JavaScript
15 lines
463 B
JavaScript
// add a new redirect string to redirect_from frontmatter
|
|
|
|
module.exports = function addRedirectToFrontmatter (redirectFromData, newRedirectString) {
|
|
if (Array.isArray(redirectFromData)) {
|
|
redirectFromData.push(newRedirectString)
|
|
} else if (typeof redirectFromData === 'string') {
|
|
redirectFromData = [redirectFromData]
|
|
redirectFromData.push(newRedirectString)
|
|
} else {
|
|
redirectFromData = [newRedirectString]
|
|
}
|
|
|
|
return redirectFromData
|
|
}
|