mnfst-render 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1229,6 +1229,12 @@ async function runPrerender(config) {
1229
1229
  const fileSegments = is404 ? [] : pathToFileSegments(pathSeg ? `/${pathSeg}` : '/');
1230
1230
  const outDir = is404 ? config.output : join(config.output, ...fileSegments);
1231
1231
  const outFile = is404 ? join(config.output, '404.html') : join(outDir, 'index.html');
1232
+ const currentLocale =
1233
+ pathSeg && locales.length > 0
1234
+ ? locales.includes(pathSeg.split('/')[0])
1235
+ ? pathSeg.split('/')[0]
1236
+ : defaultLocale || 'en'
1237
+ : defaultLocale || 'en';
1232
1238
 
1233
1239
  const page = await browser.newPage();
1234
1240
  try {
@@ -1478,12 +1484,6 @@ async function runPrerender(config) {
1478
1484
  }
1479
1485
  html = stripDuplicatedLoopDirectives(html);
1480
1486
  html = stripPrerenderedXDataDirectives(html);
1481
- const currentLocale =
1482
- pathSeg && locales.length > 0
1483
- ? locales.includes(pathSeg.split('/')[0])
1484
- ? pathSeg.split('/')[0]
1485
- : defaultLocale || 'en'
1486
- : defaultLocale || 'en';
1487
1487
  const content = loadContentForPrerender(manifest, config.root, currentLocale);
1488
1488
  const xData = { manifest, content };
1489
1489
  html = resolveHeadXBindings(html, xData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst-render",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Render Manifest sites to static HTML for SEO",
5
5
  "type": "module",
6
6
  "bin": {