Skip to content

Commit 2d8d9e9

Browse files
committed
deploy using local files
1 parent 9c2729e commit 2d8d9e9

File tree

4 files changed

+13
-33
lines changed

4 files changed

+13
-33
lines changed

packages/gatsby-theme/src/components/LayoutHeader/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import LayoutWidthContainer from '../LayoutWidthContainer'
1111
import { LayoutModifiers, ILayoutModifiable } from '../MainLayout'
1212

13-
import LayoutAlert from './Alert'
13+
// import LayoutAlert from './Alert'
1414
import { HeaderBranding } from './HeaderBranding'
1515
import Nav from './Nav'
1616
import * as styles from './styles.module.css'
@@ -21,7 +21,7 @@ const LayoutHeader: React.FC<ILayoutModifiable> = ({ modifiers }) => {
2121

2222
const { opened, handleToggle, handleItemClick } = useHamburgerMenu()
2323
const hasCollapsedModifier = includes(modifiers, LayoutModifiers.Collapsed)
24-
const hasHideAlertModifier = includes(modifiers, LayoutModifiers.HideAlert)
24+
// const hasHideAlertModifier = includes(modifiers, LayoutModifiers.HideAlert)
2525
const collapsed = opened || hasCollapsedModifier || scrolled
2626

2727
return (
@@ -32,9 +32,9 @@ const LayoutHeader: React.FC<ILayoutModifiable> = ({ modifiers }) => {
3232
data-collapsed={collapsed}
3333
className={cn(styles.headerContainer)}
3434
>
35-
{!hasHideAlertModifier && LayoutAlert && (
36-
<LayoutAlert collapsed={collapsed} />
37-
)}
35+
{/* {!hasHideAlertModifier && LayoutAlert && ( */}
36+
{/* <LayoutAlert collapsed={collapsed} /> */}
37+
{/* )} */}
3838
<LayoutWidthContainer
3939
className={cn(
4040
styles.header,

scripts/heroku-deploy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ cd $NEWPWD
99
yarn build
1010
rm -rf static .cache
1111
./scripts/deploy-with-s3.js
12-
# Move the 404 HTML file from public into the root dir for Heroku
13-
mv public/404.html 404.html
12+
# Copy the 404 HTML file from public into the root dir for Heroku
13+
cp public/404.html 404.html
1414
./scripts/clear-cloudfront-cache.js
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const { isProduction } = require('../../utils')
1+
// const { isProduction } = require('../../utils')
22

33
const localServeMiddleware = require('./local')
4-
const s3ServeMiddleware = require('./s3')
4+
// const s3ServeMiddleware = require('./s3')
55

6-
module.exports = isProduction ? s3ServeMiddleware : localServeMiddleware
6+
module.exports = localServeMiddleware
Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,10 @@
11
const serveHandler = require('serve-handler')
22

3-
module.exports = (req, res) => {
4-
serveHandler(req, res, {
3+
module.exports = async (req, res) => {
4+
await serveHandler(req, res, {
55
public: 'public',
66
cleanUrls: true,
77
trailingSlash: false,
8-
directoryListing: false,
9-
headers: [
10-
{
11-
source: '**/*.@(jpg|jpeg|gif|png)',
12-
headers: [
13-
{
14-
key: 'Cache-Control',
15-
value: 'max-age=86400'
16-
}
17-
]
18-
},
19-
{
20-
source: '!**/*.@(jpg|jpeg|gif|png)',
21-
headers: [
22-
{
23-
key: 'Cache-Control',
24-
value: 'max-age=0'
25-
}
26-
]
27-
}
28-
]
8+
directoryListing: false
299
})
3010
}

0 commit comments

Comments
 (0)