From a6ff2babc157be7b82074fca4d162dde2607ef10 Mon Sep 17 00:00:00 2001 From: Sharyn Date: Wed, 11 Jul 2018 15:47:26 +0200 Subject: [PATCH 1/2] Temp solution to subpages assets path issue --- components/pageHeader/index.js | 7 ++++--- components/searchBar/index.js | 4 +++- next.config.js | 7 ++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/components/pageHeader/index.js b/components/pageHeader/index.js index 9a6911c..05a113e 100644 --- a/components/pageHeader/index.js +++ b/components/pageHeader/index.js @@ -1,16 +1,17 @@ import React from 'react'; import AnchorLink from 'react-anchor-link-smooth-scroll'; +import getConfig from 'next/config'; +const { publicRuntimeConfig } = getConfig(); import './style.scss'; const PageHeader = () => ( -
+
- - ETHPrize logo + ETHPrize logo

Ethereum Report

We’ve interviewed 100+ developers to showcase the biggest opportunities in the diff --git a/components/searchBar/index.js b/components/searchBar/index.js index 8c30da8..9a43801 100644 --- a/components/searchBar/index.js +++ b/components/searchBar/index.js @@ -1,9 +1,11 @@ import React from 'react'; import { PropTypes } from 'prop-types'; +import getConfig from 'next/config'; +const { publicRuntimeConfig } = getConfig(); import './style.scss'; const SearchBar = props => ( -

+

Browse

diff --git a/next.config.js b/next.config.js index ee0c684..82ba401 100644 --- a/next.config.js +++ b/next.config.js @@ -1,13 +1,18 @@ const withSass = require('@zeit/next-sass'); const dev = process && process.env && process.env.NODE_ENV === 'development'; +const subDirPath = dev ? '' : '/nona-creative.github.io-ETHprize'; module.exports = withSass({ - assetPrefix: dev ? '' : '/nona-creative.github.io-ETHprize', + assetPrefix: subDirPath, exportPathMap: function(defaultPathMap) { return { '/': { page: '/' } } } }); + +module.exports.publicRuntimeConfig = { // Will be available on both server and client + subDirPath: subDirPath +}; From f4ebfd16ebda01fa1c3588b2b983dfd2222857d5 Mon Sep 17 00:00:00 2001 From: Sharyn Date: Wed, 11 Jul 2018 15:53:09 +0200 Subject: [PATCH 2/2] lint fixes --- components/pageHeader/index.js | 5 +++-- components/searchBar/index.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/pageHeader/index.js b/components/pageHeader/index.js index 05a113e..6603117 100644 --- a/components/pageHeader/index.js +++ b/components/pageHeader/index.js @@ -1,11 +1,12 @@ import React from 'react'; import AnchorLink from 'react-anchor-link-smooth-scroll'; import getConfig from 'next/config'; -const { publicRuntimeConfig } = getConfig(); import './style.scss'; +const { publicRuntimeConfig } = getConfig(); + const PageHeader = () => ( -
+