From 9224378866418ab3e2d5106701dae4950ce03fcf Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Fri, 13 Dec 2019 11:27:47 +1300 Subject: [PATCH] Remove service worker, fix rendering --- gatsby-config.js | 10 +++++++++- gatsby-ssr.js | 3 ++- src/components/Layout.tsx | 6 ++++-- src/components/NodeProvider.tsx | 1 + src/hooks/useHierarchy.ts | 2 +- src/templates/docs-template.tsx | 4 ++-- 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gatsby-config.js b/gatsby-config.js index dc3288f..d690b21 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -72,7 +72,6 @@ module.exports = { resolve: `gatsby-source-filesystem`, options: { name: `watcher`, - // In dev mode, watch all the source files. Otherwise, point it at a meaningless directory path: `${__dirname}/.cache/gatsby-source-git/`, } }, @@ -164,5 +163,14 @@ module.exports = { }, }, `gatsby-plugin-remove-serviceworker`, +<<<<<<< HEAD +======= + // { + // resolve: `gatsby-plugin-offline`, + // options: { + // precachePages: [`/en/4/developer_guides/**`], + // }, + // } +>>>>>>> Remove service worker, fix rendering ], } diff --git a/gatsby-ssr.js b/gatsby-ssr.js index 4be54e1..9cd58e3 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -1,6 +1,7 @@ const React = require('react'); const Layout = require('./src/components/Layout').default; const NodeProvider = require('./src/components/NodeProvider').default; +const { setCurrentPath } = require('./src/utils/nodes'); /** * Applies the node provider (static query of all documents) @@ -16,7 +17,7 @@ exports.wrapPageElement = ({ element, props }) => { ); }; -exports.onRenderBody = ({ setPostBodyComponents, setHeadComponents }) => { +exports.onRenderBody = ({ setPostBodyComponents, setHeadComponents, pathname }) => { // Rules that cannot be touched by purgecss because they come in from client side rendering setHeadComponents([