@antora/redirect-producer
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -7,2 +7,4 @@ 'use strict' | ||
const ALL_SPACES_RX = / /g | ||
/** | ||
@@ -68,6 +70,6 @@ * Produces redirects (HTTP redirections) for registered page aliases. | ||
delete file.out | ||
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`) | ||
} | ||
const from = `${urlContext}${file.pub.url.replace(ALL_SPACES_RX, '%20')}` | ||
const to = `${urlContext}${file.rel.pub.url.replace(ALL_SPACES_RX, '%20')}` | ||
accum.push(`${from} ${to} 301`) | ||
if (includeDirectoryRedirects && from.endsWith('/index.html')) accum.push(`${from.slice(0, -10)} ${to} 301`) | ||
return accum | ||
@@ -85,3 +87,5 @@ }, []) | ||
delete file.out | ||
return `location = ${urlContext}${file.pub.url} { return 301 ${urlContext}${file.rel.pub.url}; }` | ||
const from = `${urlContext}${file.pub.url.replace(ALL_SPACES_RX, '\\ ')}` | ||
const to = `${urlContext}${file.rel.pub.url.replace(ALL_SPACES_RX, '\\ ')}` | ||
return `location = ${from} { return 301 ${to}; }` | ||
}) | ||
@@ -88,0 +92,0 @@ const rewriteConfigFile = new File({ |
{ | ||
"name": "@antora/redirect-producer", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Produces redirects (HTTP redirections) for pages in an Antora site.", | ||
@@ -18,7 +18,7 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/asciidoc-loader": "2.0.0", | ||
"vinyl": "^2.2.0" | ||
"@antora/asciidoc-loader": "2.0.1", | ||
"vinyl": "~2.2" | ||
}, | ||
"engines": { | ||
"node": ">= 8.0.0" | ||
"node": ">=8.11.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "files": [ |
7072
115
+ Added@antora/asciidoc-loader@2.0.1(transitive)
- Removed@antora/asciidoc-loader@2.0.0(transitive)
Updatedvinyl@~2.2