@quintype/framework 7.14.0 → 7.15.0-notfound-metadata.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/framework",
3
- "version": "7.14.0",
3
+ "version": "7.15.0-notfound-metadata.0",
4
4
  "description": "Libraries to help build Quintype Node.js apps",
5
5
  "main": "index.js",
6
6
  "engines": {
@@ -346,7 +346,7 @@ exports.notFoundHandler = function notFoundHandler(
346
346
  req,
347
347
  res,
348
348
  next,
349
- { config, client, loadErrorData, renderLayout, pickComponent, logError, domainSlug }
349
+ { config, client, loadErrorData, seo, renderLayout, pickComponent, logError, domainSlug }
350
350
  ) {
351
351
  const url = urlLib.parse(req.url, true);
352
352
 
@@ -365,11 +365,12 @@ exports.notFoundHandler = function notFoundHandler(
365
365
  })
366
366
  .then((result) => {
367
367
  const statusCode = result.httpStatusCode || 404;
368
-
369
368
  const store = createStoreFromResult(url, result, {
370
369
  disableIsomorphicComponent: false,
371
370
  defaultPageType: "not-found",
372
371
  });
372
+ const seoInstance = getSeoInstance(seo, config, result.pageType);
373
+ const seoTags = seoInstance && seoInstance.getMetaTags(config, result.pageType || "not-found", result, { url });
373
374
 
374
375
  res.status(statusCode);
375
376
  res.setHeader("Cache-Control", "public,max-age=15,s-maxage=60, stale-while-revalidate=150,stale-if-error=3600");
@@ -378,7 +379,8 @@ exports.notFoundHandler = function notFoundHandler(
378
379
  return pickComponent.preloadComponent(store.getState().qt.pageType, store.getState().qt.subPageType).then(() =>
379
380
  renderLayout(res, {
380
381
  config,
381
- title: result.title,
382
+ seoTags,
383
+ title: seoInstance ? seoInstance.getTitle(config, result.pageType, result) : result.title,
382
384
  content: renderReduxComponent(IsomorphicComponent, store, {
383
385
  pickComponent,
384
386
  }),
package/server/routes.js CHANGED
@@ -536,6 +536,7 @@ exports.isomorphicRoutes = function isomorphicRoutes(
536
536
  pickComponent,
537
537
  loadErrorData,
538
538
  logError,
539
+ seo,
539
540
  assetHelper,
540
541
  })
541
542
  );