From c7c2ea0349258572daf865af0e0de4e75769f357 Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Fri, 15 Nov 2019 16:04:03 +1300 Subject: [PATCH] Major CSS purge, update branding --- gatsby-config.js | 15 +++++++++------ gatsby-ssr.js | 20 +++++++++++++++++++- postcss.config.js | 6 ------ src/html.js | 1 + src/theme/assets/scss/ss-docs.scss | 21 ++------------------- static/ss-favicon.png | Bin 0 -> 29852 bytes 6 files changed, 31 insertions(+), 32 deletions(-) delete mode 100644 postcss.config.js create mode 100644 static/ss-favicon.png diff --git a/gatsby-config.js b/gatsby-config.js index 81496d7..3c967e9 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -2,8 +2,8 @@ const path = require('path'); module.exports = { siteMetadata: { - title: `SilverStripe Documentation`, - description: `Developer documentation for the SilverStripe CMS and framework.`, + title: `Silverstripe CMS Documentation`, + description: `Developer documentation for the Silverstripe CMS and framework.`, author: `The Silverstripe Community`, siteUrl: `https://doc.silverstripe.org`, }, @@ -69,20 +69,23 @@ module.exports = { { resolve: `gatsby-plugin-purgecss`, options: { - printRejected: true, - whitelist: ['algolia-autocomplete'], + printRejected: false, + whitelist: ['algolia-autocomplete', 'pre', 'code'], ignore: ['prismjs/','docsearch.js/', 'src/theme/assets/search/algolia.css'], content: [ path.join(process.cwd(), '.cache/gatsby-source-git/**/*.md'), + path.join(process.cwd(), 'src/components/!(*.d).{ts,js,jsx,tsx}'), + path.join(process.cwd(), 'src/pages/!(*.d).{ts,js,jsx,tsx}'), + path.join(process.cwd(), 'src/templates/!(*.d).{ts,js,jsx,tsx}'), ], - extractors: [, + extractors: [ { extractor: class { static extract(content) { return content.match(/[A-Za-z0-9-_:\/]+/g) || []; } }, - extensions: ['js', 'ts', 'jsx', 'tsx', 'md', 'mdx'] + extensions: ['js', 'ts', 'jsx', 'tsx'] }, { extractor: class { diff --git a/gatsby-ssr.js b/gatsby-ssr.js index 17ba2ec..fe5eb83 100644 --- a/gatsby-ssr.js +++ b/gatsby-ssr.js @@ -5,7 +5,25 @@ exports.wrapPageElement = ({ element, props }) => { return {element} }; -exports.onRenderBody = ({ setPostBodyComponents }) => { +exports.onRenderBody = ({ setPostBodyComponents, setHeadComponents }) => { + // Rules that cannot be touched by purgecss because they come in from client side rendering + setHeadComponents([ +