Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-generator-redirect

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-generator-redirect - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

31

lib/generator.js
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc