Skip to content

Commit 598b209

Browse files
committed
update all docs
1 parent 5875f24 commit 598b209

32 files changed

+199
-63
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Railway Corp.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+10-21
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
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).
1+
# Railway Documentation
22

3-
## Getting Started
3+
Visit [docs.railway.app](https://docs.railway.app)
44

5-
First, run the development server:
5+
![](https://railway.app/og.png)
6+
7+
## Contributing
8+
9+
Thi is a [NextJS](https://nextjs.org) project.
10+
11+
Develop with
612

713
```bash
814
npm run dev
915
# or
1016
yarn dev
1117
```
1218

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.
19+
Open [http://localhost:3000](http://localhost:3000) to see the result.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "railway-blog",
2+
"name": "railway-docs",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {

src/components/Icons.tsx

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Twitter } from "react-feather";
2+
import tw, { styled } from "twin.macro";
3+
4+
export const TwitterIcon = styled(Twitter)`
5+
stroke: none;
6+
fill: #1da1f2;
7+
`;
8+
9+
export const DiscordIcon = () => (
10+
<svg
11+
xmlns="http://www.w3.org/2000/svg"
12+
viewBox="0 0 245 240"
13+
css={[tw`w-8 h-8`, `fill: #7289da`]}
14+
>
15+
<path d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z" />
16+
<path d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z" />
17+
</svg>
18+
);
19+
20+
export const RssIcon = () => (
21+
<svg
22+
xmlns="http://www.w3.org/2000/svg"
23+
fill="none"
24+
viewBox="0 0 24 24"
25+
stroke="currentColor"
26+
tw="w-8 h-8"
27+
>
28+
<path
29+
strokeLinecap="round"
30+
strokeLinejoin="round"
31+
strokeWidth={2}
32+
d="M6 5c7.18 0 13 5.82 13 13M6 11a7 7 0 017 7m-6 0a1 1 0 11-2 0 1 1 0 012 0z"
33+
/>
34+
</svg>
35+
);

src/components/Nav.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ export const Nav: React.FC<Props> = () => {
1818
return (
1919
<>
2020
<header
21-
css={[tw`flex items-center justify-between`, tw`px-8 py-6 text-center`]}
21+
css={[
22+
tw`flex items-center justify-between`,
23+
tw`px-4 md:px-8 py-6 text-center`,
24+
]}
2225
>
2326
<div>
2427
<Logo tw="md:hidden" />

src/components/SEO.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface Props extends NextSeoProps {
1111

1212
const title = "Railway Docs";
1313
export const url = "https://docs.railway.app";
14-
const description = "Railway documentation website";
14+
const description = "Documentation for Railway";
1515
const image = "https://railway.app/og.png";
1616

1717
const config: DefaultSeoProps = {

src/components/Sidebar.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ const SidebarContent: React.FC = () => {
5050
{section.pages.map(page => (
5151
<li key={page.slug}>
5252
<Link
53-
href={`/docs/${page.slug}`}
53+
href={page.slug}
5454
css={[
5555
tw`text-gray-700 text-sm`,
5656
tw`block px-4 py-2`,
5757
tw`hover:bg-gray-100 hover:text-foreground`,
58-
pathname === `/docs/${page.slug}` &&
58+
pathname === page.slug &&
5959
tw`bg-pink-100 text-pink-900 hover:bg-pink-100`,
6060
]}
6161
>

src/data/sidebar.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@ import { IPage, ISidebarContent } from "../types";
22

33
const makePage = (title: string, subPath?: string, slug?: string): IPage => ({
44
title,
5-
slug: `${subPath != null ? subPath + "/" : ""}${
6-
slug ?? title.toLowerCase().replace(/\s+/g, "-")
7-
}`,
5+
slug:
6+
slug ??
7+
`/${subPath != null ? subPath + "/" : ""}${title
8+
.toLowerCase()
9+
.replace(/\s+/g, "-")}`,
810
});
911

1012
export const sidebarContent: ISidebarContent = [
1113
{
1214
title: "General",
1315
pages: [
14-
makePage("Introduction"),
16+
makePage("Introduction", undefined, "/"),
1517
makePage("Getting Started"),
1618
makePage("Environments"),
1719
],
@@ -27,12 +29,13 @@ export const sidebarContent: ISidebarContent = [
2729
{
2830
title: "Deployments",
2931
pages: [
30-
makePage("Railway Up", "deployment", "up"),
32+
makePage("Railway Up", "deployment", "/deployment/up"),
3133
makePage("GitHub Triggers", "deployment"),
3234
makePage("Builds", "deployment"),
3335
makePage("Serverless", "deployment"),
3436
makePage("Self Hosted Server", "deployment"),
3537
makePage("Project Tokens", "deployment"),
38+
makePage("Procfiles", "deployment"),
3639
],
3740
},
3841
{

src/layouts/DocsLayout.tsx

+6-19
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import { useState } from "react";
21
import "twin.macro";
3-
import { Nav } from "../components/Nav";
42
import { PageNav } from "../components/PageNav";
5-
import { Sidebar } from "../components/Sidebar";
63
import { FrontMatter } from "../types";
74
import { Page, Props as PageProps } from "./Page";
85

@@ -16,24 +13,14 @@ export const DocsLayout: React.FC<Props> = ({
1613
...props
1714
}) => {
1815
return (
19-
<Page {...props}>
20-
<div tw="min-h-screen relative flex max-w-6xl mx-auto">
21-
<Sidebar />
16+
<Page {...props} seo={{ title: `${frontMatter.title} - Railway` }}>
17+
<div tw="max-w-prose flex-auto prose">
18+
<h1>{frontMatter.title}</h1>
2219

23-
<div tw="flex flex-col flex-1">
24-
<Nav />
25-
26-
<main tw="flex justify-between ">
27-
<div tw="max-w-prose flex-auto px-4 sm:px-6 xl:px-8 pt-8 pb-24 lg:pb-16 prose">
28-
<h1>{frontMatter.title}</h1>
29-
30-
<div className="docs-content">{children}</div>
31-
</div>
32-
33-
<PageNav title={frontMatter.title} />
34-
</main>
35-
</div>
20+
<div className="docs-content">{children}</div>
3621
</div>
22+
23+
<PageNav title={frontMatter.title} />
3724
</Page>
3825
);
3926
};

src/layouts/Page.tsx

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import GoogleFonts from "next-google-fonts";
12
import React from "react";
2-
import { Footer } from "../components/Footer";
3+
import "twin.macro";
34
import { Nav } from "../components/Nav";
45
import { Props as SEOProps, SEO } from "../components/SEO";
5-
import GoogleFonts from "next-google-fonts";
6-
import "twin.macro";
6+
import { Sidebar } from "../components/Sidebar";
77

88
export interface Props {
99
seo?: SEOProps;
@@ -15,7 +15,17 @@ export const Page: React.FC<Props> = props => {
1515
<SEO {...props.seo} />
1616
<GoogleFonts href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" />
1717

18-
{props.children}
18+
<div tw="min-h-screen relative flex max-w-6xl mx-auto">
19+
<Sidebar />
20+
21+
<div tw="flex flex-col flex-1">
22+
<Nav />
23+
24+
<main tw="flex justify-between px-4 md:px-8 pt-8 pb-24">
25+
{props.children}
26+
</main>
27+
</div>
28+
</div>
1929
</>
2030
);
2131
};

src/pages/404.tsx

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import { Page } from "../layouts/Page";
3+
import "twin.macro";
4+
5+
const NotFoundPage: React.FC = () => (
6+
<Page seo={{ title: "Not Found" }}>
7+
<div tw="prose">
8+
<h1>Page not found</h1>
9+
10+
<p>Maybe you were looking for one of the following</p>
11+
</div>
12+
</Page>
13+
);
14+
15+
export default NotFoundPage;
File renamed without changes.
File renamed without changes.

src/pages/docs/cli/quick-start.md src/pages/cli/quick-start.md

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ infrastructure hosted on Railway by injecting environment variables.
3232
railway run CMD
3333
```
3434

35+
For example, to run your node project with Railway:
36+
37+
```bash
38+
railway run npm start
39+
```
40+
3541
## Deploy
3642

3743
Deploy current directory to Railway.
File renamed without changes.

src/pages/deployment/procfiles.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Procfiles
3+
---
4+
5+
Railway supports [Procfiles](https://devcenter.heroku.com/articles/procfile), a
6+
file that can be included in the project to specify which command to run when
7+
the deployment starts.
File renamed without changes.
File renamed without changes.

src/pages/docs/introduction.md

-5
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/pages/index.tsx

+69-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,82 @@
11
import { NextPage } from "next";
22
import React from "react";
3+
import { DocsLayout } from "../layouts/DocsLayout";
34
import { Page } from "../layouts/Page";
5+
import tw, { styled } from "twin.macro";
6+
import { Link } from "../components/Link";
7+
import { Twitter } from "react-feather";
8+
import { DiscordIcon, RssIcon, TwitterIcon } from "../components/Icons";
49

510
const Home: NextPage = () => {
611
return (
712
<Page>
8-
<div className="max-w-4xl px-4 mx-auto">
9-
<header className="py-20">
10-
<h1 className="text-6xl font-bold text-center">Railway Docs</h1>
11-
</header>
13+
<div>
14+
<h1 tw="text-6xl font-bold mb-12">Railway Docs</h1>
15+
16+
<div tw="flex items-center space-x-4 mb-8">
17+
<ButtonLink
18+
href="/getting-started"
19+
css={[
20+
tw`bg-foreground border-2 border-foreground text-background`,
21+
tw`hover:bg-background hover:text-foreground`,
22+
tw`focus:ring-2 focus:ring-pink-700`,
23+
]}
24+
>
25+
Get Started
26+
</ButtonLink>
27+
28+
<ButtonLink
29+
href="https://railway.app"
30+
css={[
31+
tw`bg-pink-500 text-white border-2 border-pink-500`,
32+
tw`hover:bg-pink-400`,
33+
tw`focus:ring-2 focus:ring-pink-700`,
34+
]}
35+
>
36+
Visit Railway
37+
</ButtonLink>
38+
</div>
39+
40+
<div tw="prose mt-16">
41+
<section>
42+
<h2>Connect with Us</h2>
43+
44+
<h3 tw="flex items-center space-x-4">
45+
<RssIcon /> <span>Changelog</span>
46+
</h3>
47+
<p>Weekly update with features and improvements made to Railway.</p>
48+
<p>
49+
<Link href="https://railway.app/changelog">View Changelog</Link>
50+
</p>
51+
52+
<h3 tw="flex items-center space-x-4">
53+
<TwitterIcon /> <span>Twitter</span>
54+
</h3>
55+
<p>Keep up with the latest news and updates.</p>
56+
<p>
57+
<Link href="https://twitter.com/Railway_App">
58+
Follow @Railway_App
59+
</Link>
60+
</p>
61+
62+
<h3 tw="flex items-center space-x-4">
63+
<DiscordIcon /> <span>Discord</span>
64+
</h3>
65+
<p>Chat with our Railway members, ask questions, hang out.</p>
66+
<p>
67+
<Link href="https://discord.gg/xAm2w6g">Join Discord</Link>
68+
</p>
69+
</section>
70+
</div>
1271
</div>
1372
</Page>
1473
);
1574
};
1675

1776
export default Home;
77+
78+
const ButtonLink = styled(Link)`
79+
${tw`block font-medium rounded shadow`}
80+
${tw`px-3 py-2`}
81+
${tw`focus:outline-none`}
82+
`;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)