+ redirect table support
This commit is contained in:
1 parent
80719055b3
commit
26c0534372
4 files changed
+41
-1
No files matched your search
+13
-1
@@ -37,4 +37,16 @@ export default Object.keys(privateData)
|
||||
.reduce((config, key) => {
|
||||
config[key] = privateData[key];
|
||||
return config;
|
||||
}, config);
|
||||
}, config);
|
||||
|
||||
let redirectPath = path.join(__dirname, '../redirect.tsv');
|
||||
export const redirectionTable = fs.readFileSync(redirectPath, 'utf-8')
|
||||
.split('\n')
|
||||
.map(row => row.split(/\s+/))
|
||||
.map(row => {
|
||||
let [from, to] = row;
|
||||
return {
|
||||
'url': from,
|
||||
'redirect': to
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user