Skip to content

Commit 027879f

Browse files
committed
deploy to GitHub Pages
1 parent c261140 commit 027879f

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

explorer/components/DrawingTile.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import React from 'react'
22
import { Drawing } from '../types/drawing-models'
33
import styled from 'styled-components'
4+
import { assetPrefix } from '../lib/assetPrefix'
45

56
export const DrawingTile: React.FC<Drawing> = ({ date, title, slug, image }) => {
67
return (
78
<Container>
89
<Date>{date}</Date>
910
<Title>{title}</Title>
1011
<a href={`http://explodingdog.com/title/${slug}.html`} target='_blank'>
11-
<Image src={`/images/${image}`} alt={title} />
12+
<Image src={`${assetPrefix}/images/${image}`} alt={title} />
1213
</a>
1314
</Container>
1415
)

explorer/components/PageLayout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react'
22
import Head from 'next/head'
33
import { PageHeader } from './PageHeader'
44
import { PageFooter } from './PageFooter'
5+
import { assetPrefix } from '../lib/assetPrefix'
56

67
type Props = {
78
children?: ReactNode
@@ -19,11 +20,11 @@ export const PageLayout = ({
1920
<title>{title}</title>
2021
<meta charSet="utf-8" />
2122
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
22-
<link rel="icon" href="/favicon.ico" />
23-
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
23+
<link rel="icon" href={`${assetPrefix}/favicon.ico`} />
24+
<link rel="apple-touch-icon" href={`${assetPrefix}/apple-touch-icon.png`} />
2425
<meta name="theme-color" content="#000000" />
2526
<meta name="description" content={description} />
26-
<link rel="manifest" href="/manifest.json" />
27+
<link rel="manifest" href={`${assetPrefix}/manifest.json`} />
2728
</Head>
2829
<PageHeader />
2930
{children}

explorer/lib/assetPrefix.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const assetPrefix = '/explodingdog'

explorer/next.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
trailingSlash: true,
3+
basePath: '/explodingdog',
4+
assetPrefix: '/explodingdog/',
5+
}

explorer/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
"license": "MIT",
77
"scripts": {
88
"dev": "next",
9-
"build": "next build",
9+
"build": "next build && next export",
1010
"start": "next start",
11+
"deploy": "yarn build && touch out/.nojekyll && gh-pages -d out",
1112
"type-check": "tsc"
1213
},
1314
"dependencies": {

0 commit comments

Comments
 (0)