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

@antora/redirect-producer

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/redirect-producer - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

18

lib/produce-redirects.js

@@ -39,3 +39,7 @@ 'use strict'

case 'netlify':
return createNetlifyRedirects(aliases, extractUrlContext(siteUrl))
return createNetlifyRedirects(
aliases,
extractUrlContext(siteUrl),
(playbook.urls.htmlExtensionStyle || 'default') === 'default'
)
case 'nginx':

@@ -61,7 +65,11 @@ return createNginxRewriteConf(aliases, extractUrlContext(siteUrl))

function createNetlifyRedirects (files, urlContext = '') {
const rules = files.map((file) => {
function createNetlifyRedirects (files, urlContext = '', includeDirectoryRedirects = false) {
const rules = files.reduce((accum, file) => {
delete file.out
return `${urlContext}${file.pub.url} ${urlContext}${file.rel.pub.url} 301`
})
accum.push(`${urlContext}${file.pub.url} ${urlContext}${file.rel.pub.url} 301`)
if (includeDirectoryRedirects && file.pub.url.endsWith('/index.html')) {
accum.push(`${urlContext}${file.pub.url.slice(0, -10)} ${urlContext}${file.rel.pub.url} 301`)
}
return accum
}, [])
const redirectsFile = new File({

@@ -68,0 +76,0 @@ contents: Buffer.from(rules.join('\n')),

{
"name": "@antora/redirect-producer",
"version": "1.0.1",
"version": "1.0.2",
"description": "Produces redirects (HTTP redirections) for pages in an Antora site.",

@@ -18,4 +18,4 @@ "license": "MPL-2.0",

"dependencies": {
"@antora/asciidoc-loader": "1.0.1",
"vinyl": "^2.1.0"
"@antora/asciidoc-loader": "1.0.2",
"vinyl": "^2.2.0"
},

@@ -22,0 +22,0 @@ "engines": {

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