Skip to content

Commit 86fdb3a

Browse files
consistent formatting
1 parent 31c3477 commit 86fdb3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+4849
-3380
lines changed

.prettierrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: false,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 2,
7+
};

netlify.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build]
22
base = "."
33
publish = "_site"
4-
command = "npm install && npm run build"
4+
command = "npm install && npm run fmt && npm run build"
55
[context.deploy-preview]
66
NODE_ENV = "preview"
7-
command = "npm install && mkdir -p _site && echo -e \"\nDisallow: /\" >> _site/robots.txt && npm run build"
7+
command = "npm install && mkdir -p _site && echo -e \"\nDisallow: /\" >> _site/robots.txt && npm run fmt && npm run build"
88
[context.production.environment]
99
NODE_ENV = "production"
1010
[[headers]]

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"minify": "for i in `find _site -name \"*.html\" -type f`; do inline-source --root ./_site $i $i; done",
77
"build": "npx ts-node --files src/index.tsx && cp favicon.ico _site",
8-
"svgo": "npx ts-node src/svgo.ts"
8+
"svgo": "npx ts-node src/svgo.ts",
9+
"fmt": "prettier 'src/**/*.{ts,tsx,md}' --list-different"
910
},
1011
"author": "Learnk8s",
1112
"license": "MIT",
@@ -35,6 +36,7 @@
3536
"moment": "^2.24.0",
3637
"moment-timezone": "^0.5.23",
3738
"postcss": "^7.0.14",
39+
"prettier": "^1.16.4",
3840
"prismjs": "^1.15.0",
3941
"react": "^16.8.1",
4042
"react-dom": "^16.8.1",

src/404.tsx

+38-35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { LinkedNode, Sitemap, getAbsoluteUrl } from './sitemap'
3-
import { Navbar, Footer, Layout} from './layout'
3+
import { Navbar, Footer, Layout } from './layout'
44
import { Image, CSSBundle } from './assets'
55
import { renderToStaticMarkup } from 'react-dom/server'
66

@@ -10,46 +10,49 @@ export const Details = {
1010
seoTitle: 'Oops! Not found',
1111
title: 'Not Found',
1212
description: 'We are sorry but he page you tried to visit does not exist',
13-
openGraphImage: Image({url: 'assets/open_graph_preview.png', description: 'Learnk8s preview'}),
13+
openGraphImage: Image({ url: 'assets/open_graph_preview.png', description: 'Learnk8s preview' }),
1414
}
1515

1616
function identity<T>(value: T): T {
1717
return value
1818
}
1919

2020
export function render(website: Sitemap, currentNode: LinkedNode<typeof Details>, siteUrl: string): string {
21-
return renderToStaticMarkup(<Layout
22-
website={website}
23-
seoTitle={currentNode.payload.seoTitle}
24-
title={currentNode.payload.title}
25-
description={currentNode.payload.description}
26-
openGraphImage={currentNode.payload.openGraphImage}
27-
absoluteUrl={getAbsoluteUrl(currentNode, siteUrl)}
28-
cssBundle={CSSBundle({
29-
paths: [
30-
'node_modules/tachyons/css/tachyons.css',
31-
'assets/style.css',
32-
],
33-
})}>
34-
35-
<div className='trapezoid-1 white pt3 pt0-ns pb2 pb4-ns'>
36-
37-
<Navbar root={website} />
38-
39-
<section className='ph5-l'>
40-
<div className='w-100'>
41-
<h1 className='f1 pl3 pl4-ns f-subheadline-l'>Oops!</h1>
42-
<h2 className='f4 normal measure-narrow lh-copy ph3 ph4-ns f3-l pb4'>Something went wrong!</h2>
43-
</div>
21+
return renderToStaticMarkup(
22+
<Layout
23+
website={website}
24+
seoTitle={currentNode.payload.seoTitle}
25+
title={currentNode.payload.title}
26+
description={currentNode.payload.description}
27+
openGraphImage={currentNode.payload.openGraphImage}
28+
absoluteUrl={getAbsoluteUrl(currentNode, siteUrl)}
29+
cssBundle={CSSBundle({
30+
paths: ['node_modules/tachyons/css/tachyons.css', 'assets/style.css'],
31+
})}
32+
>
33+
<div className="trapezoid-1 white pt3 pt0-ns pb2 pb4-ns">
34+
<Navbar root={website} />
35+
36+
<section className="ph5-l">
37+
<div className="w-100">
38+
<h1 className="f1 pl3 pl4-ns f-subheadline-l">Oops!</h1>
39+
<h2 className="f4 normal measure-narrow lh-copy ph3 ph4-ns f3-l pb4">Something went wrong!</h2>
40+
</div>
41+
</section>
42+
</div>
43+
44+
<section className="ph3 measure-wide pv4 center">
45+
<h3 className="f3 f2-l navy">Are we missing something?</h3>
46+
<p className="lh-copy black-70">
47+
Please get in touch{' '}
48+
<a href="mailto:[email protected]" className="link navy underline">
49+
50+
</a>
51+
.
52+
</p>
4453
</section>
4554

46-
</div>
47-
48-
<section className='ph3 measure-wide pv4 center'>
49-
<h3 className='f3 f2-l navy'>Are we missing something?</h3>
50-
<p className='lh-copy black-70'>Please get in touch <a href='mailto:[email protected]' className='link navy underline'>[email protected]</a>.</p>
51-
</section>
52-
53-
<Footer root={website} />
54-
</Layout>)
55-
}
55+
<Footer root={website} />
56+
</Layout>,
57+
)
58+
}

0 commit comments

Comments
 (0)