hexo-generator-redirect
Advanced tools
Comparing version 1.0.0 to 1.1.0
const generator = ({ posts, pages }) => | ||
[ | ||
...posts.filter(({ redirect_from }) => redirect_from && Array.isArray(redirect_from) && redirect_from.length > 0).map(page => page.redirect_from.map(redirect => ({ redirect, page }))).reduce((result, current) => [...result, ...current], []), | ||
...pages.filter(({ redirect_from }) => redirect_from && Array.isArray(redirect_from) && redirect_from.length > 0).map(page => page.redirect_from.map(redirect => ({ redirect, page }))).reduce((result, current) => [...result, ...current], []) | ||
] | ||
.map(({ redirect, page }) => ({ | ||
[ | ||
...posts | ||
.filter( | ||
({ redirect_from }) => | ||
redirect_from && | ||
Array.isArray(redirect_from) && | ||
redirect_from.length > 0 | ||
) | ||
.map((page) => page.redirect_from.map((redirect) => ({ redirect, page }))) | ||
.reduce((result, current) => [...result, ...current], []), | ||
...pages | ||
.filter( | ||
({ redirect_from }) => | ||
redirect_from && | ||
Array.isArray(redirect_from) && | ||
redirect_from.length > 0 | ||
) | ||
.map((page) => page.redirect_from.map((redirect) => ({ redirect, page }))) | ||
.reduce((result, current) => [...result, ...current], []), | ||
].map(({ redirect, page }) => ({ | ||
path: `${redirect}/index.html`, | ||
data: { target: page, redirect_from: redirect }, | ||
layout: 'redirect' | ||
})); | ||
data: { target: page, redirect_from: redirect, layout: "redirect" }, | ||
layout: "redirect", | ||
})); | ||
module.exports = generator; |
{ | ||
"name": "hexo-generator-redirect", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Hexo plugin that generates additional redirect pages", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# hexo-generator-redirect | ||
![Publish on NPM](https://github.com/sergeyzwezdin/hexo-generator-redirect/workflows/Publish%20on%20NPM/badge.svg?branch=master) | ||
![Publish on NPM](https://github.com/sergeyzwezdin/hexo-generator-redirect/workflows/Publish%20on%20NPM/badge.svg?branch=master) ![](https://img.shields.io/npm/v/hexo-generator-redirect) | ||
@@ -5,0 +5,0 @@ [Hexo](https://hexo.io/) plugin that generates additional redirect pages |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3848
26