mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-25 05:57:53 +02:00
Versioning ids should be based on whether translation is enabled (#333)
* Versioning ids should be based on whether translation is enabled Ref:ff117979c6
anda5e963dba1
Tested locally on: Docusaurus Relay Test site from `npm run examples` * Prettier
This commit is contained in:
parent
250395a96a
commit
5bb062b6f0
3 changed files with 10 additions and 6 deletions
|
@ -12,7 +12,7 @@ const fs = require('fs');
|
|||
const glob = require('glob');
|
||||
const chalk = require('chalk');
|
||||
|
||||
const env = require('./env');
|
||||
const env = require('./env.js');
|
||||
const siteConfig = require(CWD + '/siteConfig.js');
|
||||
const versionFallback = require('./versionFallback.js');
|
||||
const escapeStringRegexp = require('escape-string-regexp');
|
||||
|
@ -272,14 +272,18 @@ function generateMetadataDocs() {
|
|||
'version-' + metadata.version + '-',
|
||||
''
|
||||
);
|
||||
metadata.next = metadata.language + '-' + order[id].next;
|
||||
metadata.next =
|
||||
(env.translation.enabled ? metadata.language + '-' : '') +
|
||||
order[id].next;
|
||||
}
|
||||
if (order[id].previous) {
|
||||
metadata.previous_id = order[id].previous.replace(
|
||||
'version-' + metadata.version + '-',
|
||||
''
|
||||
);
|
||||
metadata.previous = metadata.language + '-' + order[id].previous;
|
||||
metadata.previous =
|
||||
(env.translation.enabled ? metadata.language + '-' : '') +
|
||||
order[id].previous;
|
||||
}
|
||||
}
|
||||
metadatas[metadata.id] = metadata;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue