Skip to content

Commit 9d63e9d

Browse files
committed
init commit
0 parents  commit 9d63e9d

Some content is hidden

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

42 files changed

+7260
-0
lines changed

.babelrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
presets: [["next/babel", { "preset-react": { runtime: "automatic" } }]],
3+
plugins: ["babel-plugin-macros", ["styled-components", { ssr: true }]],
4+
};

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel
35+
36+
.blog_index_data
37+
.blog_index_data_previews

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"bracketSpacing": true,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"arrowParens": "avoid"
6+
}

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
14+
15+
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
16+
17+
## Learn More
18+
19+
To learn more about Next.js, take a look at the following resources:
20+
21+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
22+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
23+
24+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
25+
26+
## Deploy on Vercel
27+
28+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
29+
30+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

next-env.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />

next.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
images: {
3+
domains: ["user-images.githubusercontent.com"],
4+
},
5+
};

package.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"name": "railway-blog",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start --port ${PORT-3000}",
9+
"clean": "rm -rf .next",
10+
"tsc": "tsc -p ."
11+
},
12+
"dependencies": {
13+
"@tailwindcss/typography": "^0.3.1",
14+
"dayjs": "^1.9.7",
15+
"github-slugger": "^1.3.0",
16+
"globby": "^11.0.1",
17+
"gray-matter": "^4.0.2",
18+
"next": "10.0.3",
19+
"next-google-fonts": "^1.2.1",
20+
"next-mdx-remote": "^1.0.1",
21+
"next-seo": "^4.17.0",
22+
"next-themes": "^0.0.10",
23+
"prismjs": "^1.22.0",
24+
"react": "17.0.1",
25+
"react-dom": "17.0.1",
26+
"react-feather": "^2.0.9",
27+
"styled-components": "^5.2.1",
28+
"theme-custom-properties": "^1.0.0",
29+
"twin.macro": "^2.0.8",
30+
"uuid": "^8.3.2"
31+
},
32+
"devDependencies": {
33+
"@types/node": "^14.14.11",
34+
"@types/react": "^17.0.0",
35+
"@types/styled-components": "^5.1.7",
36+
"autoprefixer": "^10.1.0",
37+
"postcss": "^8.2.1",
38+
"prettier": "^2.2.1",
39+
"tailwindcss": "^2.0.1",
40+
"ts-node": "^9.1.1",
41+
"typescript": "^4.1.2"
42+
},
43+
"babelMacros": {
44+
"twin": {
45+
"preset": "styled-components"
46+
}
47+
}
48+
}

postcss.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: ["tailwindcss", "autoprefixer"],
3+
};

public/android-chrome-192x192.png

12.2 KB
Loading

public/android-chrome-512x512.png

21.2 KB
Loading

public/apple-touch-icon.png

31.8 KB
Loading

public/blog.png

602 KB
Loading

public/favicon-16x16.png

731 Bytes
Loading

public/favicon-32x32.png

1.32 KB
Loading

public/favicon-96x96.png

6.2 KB
Loading

public/favicon.ico

5.78 KB
Binary file not shown.

public/og.png

30.3 KB
Loading

public/railway.svg

+1
Loading

public/site.webmanifest

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Railway",
3+
"short_name": "Railway",
4+
"icons": [
5+
{
6+
"src": "/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#100F13",
17+
"background_color": "#100F13",
18+
"display": "standalone"
19+
}

scripts/create-table.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createTable } from "../src/lib/notion/createTable";
2+
3+
createTable();

src/authors.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export interface Author {
2+
name: string;
3+
link: string;
4+
handle: string;
5+
}
6+
7+
export const authors: Record<string, Author> = {
8+
runzer: {
9+
name: "Jake Runzer",
10+
link: "https://twitter.com/jakerunzer",
11+
handle: "jakerunzer",
12+
},
13+
cooper: {
14+
name: "Jake Cooper",
15+
link: "https://twitter.com/JustJake",
16+
handle: "justjake",
17+
},
18+
};

src/components/Button.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React, { ButtonHTMLAttributes } from "react";
2+
3+
export const Button: React.FC<
4+
ButtonHTMLAttributes<HTMLButtonElement>
5+
> = props => <button className="btn-primary" {...props} />;

src/components/Footer.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import React from "react";
2+
import "twin.macro";
3+
4+
export const Footer: React.FC = () => <footer tw="text-center">feet</footer>;

src/components/Link.tsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import NLink from "next/link";
2+
import React, { useMemo } from "react";
3+
4+
export interface Props {
5+
href: string;
6+
external?: boolean;
7+
className?: string;
8+
}
9+
10+
const isExternalLink = (href: string) =>
11+
href == null || href.startsWith("http://") || href.startsWith("https://");
12+
13+
const useIsExternalLink = (href: string) =>
14+
useMemo(() => isExternalLink(href), [href]);
15+
16+
export const Link: React.FC<Props> = ({
17+
href,
18+
external,
19+
children,
20+
...props
21+
}) => {
22+
const isExternal = (useIsExternalLink(href) || external) ?? false;
23+
24+
if (isExternal) {
25+
return (
26+
<a href={href} target="_blank" rel="noopener" {...props}>
27+
{children}
28+
</a>
29+
);
30+
}
31+
32+
return (
33+
<NLink href={href} passHref>
34+
<a {...props}>{children}</a>
35+
</NLink>
36+
);
37+
};

src/components/Logo.tsx

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from "react";
2+
import "twin.macro";
3+
4+
export const Logo: React.FC = () => (
5+
<svg
6+
data-v-423bf9ae=""
7+
xmlns="http://www.w3.org/2000/svg"
8+
viewBox="0 0 60 60"
9+
className="logo"
10+
tw="w-10 fill-current"
11+
>
12+
<g
13+
data-v-423bf9ae=""
14+
id="6f639fe5-02e1-4640-a1fb-f4b22b64e5ef"
15+
transform="matrix(0.5999641134746578,0,0,0.5999641134746578,-437.5538206497148,-266.68705118956507)"
16+
stroke="none"
17+
>
18+
<path d="M729.872 487.327a50.86 50.86 0 0 0-.464 5.033h75.879c-.265-.518-.621-.985-.98-1.442-12.972-16.769-19.95-15.315-29.932-15.741-3.328-.137-5.585-.192-18.832-.192-7.09 0-14.798.018-22.304.038.737-1.746 1.6-3.419 2.525-5.061-2.885 5.106-4.865 10.771-5.805 16.789l.891-4.397c.007-.031.018-.063.024-.094h38.883v5.067h-39.885zM805.885 497.432h-76.438c.08 1.352.206 2.686.388 4.002h70.571c3.146 0 4.907-1.786 5.479-4.002zM733.851 515.257a52.226 52.226 0 0 1-1.98-4.997c6.608 19.89 25.328 34.251 47.433 34.251 20.205 0 37.566-12.007 45.452-29.254h-90.905zM729.38 492.915c-.018.531-.08 1.055-.08 1.589 0 .538.063 1.059.08 1.59v-3.179zM824.77 515.229z"></path>
19+
<path d="M779.303 444.505c-18.682 0-34.939 10.265-43.524 25.439 6.709-.014 19.775-.022 19.775-.022h.003v-.005c15.444 0 16.018.069 19.035.195l1.868.069c6.507.217 14.505.916 20.798 5.68 3.416 2.584 8.348 8.287 11.288 12.35 2.718 3.758 3.5 8.078 1.652 12.217-1.701 3.804-5.361 6.073-9.793 6.073H730.85l-.884-4.201c.426 2.707 1.037 5.344 1.879 7.886h94.914a49.863 49.863 0 0 0 2.546-15.682c.001-27.611-22.386-49.999-50.002-49.999z"></path>
20+
</g>
21+
</svg>
22+
);

src/components/Nav.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from "react";
2+
import { Link } from "./Link";
3+
import { Logo } from "./Logo";
4+
import "twin.macro";
5+
6+
export const Nav: React.FC = () => (
7+
<nav tw="flex items-center justify-between px-3 py-3 text-center bg-pink-300">
8+
<Link href="/">
9+
<Logo />
10+
</Link>
11+
</nav>
12+
);

src/components/PageNav.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import "twin.macro";
2+
import React from "react";
3+
4+
export interface Props {}
5+
6+
export const PageNav: React.FC<Props> = () => {
7+
return (
8+
<div tw="flex flex-col bg-yellow-300 pt-10 px-8 pb-6 sticky top-20">
9+
SIDE NAV
10+
</div>
11+
);
12+
};

src/components/SEO.tsx

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import * as React from "react";
2+
import { DefaultSeo, NextSeo, NextSeoProps } from "next-seo";
3+
import Head from "next/head";
4+
import { DefaultSeoProps } from "next-seo";
5+
6+
export interface Props extends NextSeoProps {
7+
title?: string;
8+
description?: string;
9+
image?: string;
10+
}
11+
12+
const title = "Railway Docs";
13+
export const url = "https://docs.railway.app";
14+
const description = "Railway documentation website";
15+
const image = "https://railway.app/og.png";
16+
17+
const config: DefaultSeoProps = {
18+
title,
19+
description,
20+
openGraph: {
21+
type: "website",
22+
url,
23+
site_name: title,
24+
images: [{ url: image }],
25+
},
26+
twitter: {
27+
handle: "@Railway_App",
28+
cardType: "summary_large_image",
29+
},
30+
};
31+
32+
export const SEO: React.FC<Props> = ({ image, ...props }) => {
33+
const title = props.title ?? config.title;
34+
const description = props.description || config.description;
35+
36+
return (
37+
<>
38+
<DefaultSeo {...config} />
39+
40+
<NextSeo
41+
{...props}
42+
{...(image == null
43+
? {}
44+
: {
45+
openGraph: {
46+
images: [{ url: image }],
47+
},
48+
})}
49+
/>
50+
51+
<Head>
52+
<title>{title}</title>
53+
54+
<meta name="description" content={description} />
55+
</Head>
56+
</>
57+
);
58+
};

src/components/Sidebar.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import "twin.macro";
2+
3+
export interface Props {}
4+
5+
export const Sidebar: React.FC<Props> = () => {
6+
return <div tw="bg-blue-300 px-8">SIDEBAR</div>;
7+
};

src/layouts/DocsLayout.tsx

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import "twin.macro";
2+
import { Nav } from "../components/Nav";
3+
import { PageNav } from "../components/PageNav";
4+
import { Sidebar } from "../components/Sidebar";
5+
import { Page, Props as PageProps } from "./Page";
6+
7+
export interface Props extends PageProps {}
8+
9+
export const DocsLayout: React.FC<Props> = props => {
10+
return (
11+
<Page {...props}>
12+
<div tw="min-h-screen flex flex-col max-w-7xl mx-auto">
13+
<Nav />
14+
15+
<div tw="flex flex-1">
16+
<Sidebar tw="" />
17+
18+
<main tw="flex-1 flex justify-between bg-red-200">
19+
<div tw="max-w-prose flex-auto px-4 sm:px-6 xl:px-8 pt-10 pb-24 lg:pb-16 bg-red-400">
20+
{props.children}
21+
</div>
22+
23+
<PageNav />
24+
</main>
25+
</div>
26+
</div>
27+
</Page>
28+
);
29+
};

0 commit comments

Comments
 (0)