2022-03-07 19:42:47 -05:00
|
|
|
import Head from 'next/head'
|
|
|
|
import styles from '../styles/Home.module.css'
|
2022-03-09 20:47:54 -05:00
|
|
|
import { Page, Spacer, Text } from '@geist-ui/core'
|
2022-03-07 19:42:47 -05:00
|
|
|
|
|
|
|
import Header from '../components/header'
|
|
|
|
import { ThemeProps } from './_app'
|
|
|
|
import Document from '../components/document'
|
2022-03-09 20:47:54 -05:00
|
|
|
import Image from 'next/image'
|
|
|
|
import ShiftBy from '../components/shift-by'
|
2022-03-08 19:39:24 -05:00
|
|
|
|
|
|
|
export function getStaticProps() {
|
2022-03-09 20:47:54 -05:00
|
|
|
const introDoc = `### Drift is a self-hostable clone of GitHub Gist.
|
2022-03-08 19:39:24 -05:00
|
|
|
#### It is a simple way to share code and text snippets with your friends, with support for the following:
|
|
|
|
|
|
|
|
- Render GitHub Extended Markdown (including images)
|
|
|
|
- User authentication
|
|
|
|
- Private, public, and secret posts
|
|
|
|
|
|
|
|
If you want to signup, you can join at [/signup](/signup) as long as you have a passcode provided by the administrator (which you don't need for this demo).
|
|
|
|
**This demo is on a memory-only database, so accounts and pastes can be deleted at any time.**
|
|
|
|
You can find the source code on [GitHub](https://github.com/MaxLeiter/drift).
|
|
|
|
|
|
|
|
Drift was inspired by [this tweet](https://twitter.com/emilyst/status/1499858264346935297):
|
|
|
|
> What is the absolute closest thing to GitHub Gist that can be self-hosted?
|
|
|
|
In terms of design and functionality. Hosts images and markdown, rendered. Creates links that can be private or public. Uses/requires registration.
|
|
|
|
I have looked at dozens of pastebin-like things.
|
|
|
|
`
|
|
|
|
const todoDoc =
|
|
|
|
`#### In no particular order:
|
|
|
|
|
|
|
|
- Less JavaScript usage (it's currently required)
|
|
|
|
- A non-Node backend
|
|
|
|
- Hosting images
|
|
|
|
- Password-protected posts
|
|
|
|
- Administrator panel
|
|
|
|
- Meta tags
|
|
|
|
- User settings
|
|
|
|
- Search
|
|
|
|
- "Forking"
|
|
|
|
- LaTeX
|
2022-03-09 04:37:56 -05:00
|
|
|
- Syntax highlighting based on filename ending`
|
2022-03-08 19:39:24 -05:00
|
|
|
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
introContent: introDoc,
|
|
|
|
todoContent: todoDoc,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type Props = ThemeProps & {
|
|
|
|
introContent: string
|
|
|
|
todoContent: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const Home = ({ theme, changeTheme, introContent, todoContent }: Props) => {
|
2022-03-07 19:42:47 -05:00
|
|
|
return (
|
2022-03-07 21:36:36 -05:00
|
|
|
<Page className={styles.container} width="100%">
|
2022-03-07 19:42:47 -05:00
|
|
|
<Head>
|
|
|
|
<title>Drift</title>
|
|
|
|
<meta name="description" content="A self-hostable clone of GitHub Gist" />
|
|
|
|
</Head>
|
|
|
|
<Page.Header>
|
|
|
|
<Header theme={theme} changeTheme={changeTheme} />
|
|
|
|
</Page.Header>
|
2022-03-08 19:39:24 -05:00
|
|
|
<Page.Content width={"var(--main-content-width)"} margin="auto" paddingTop={"var(--gap)"}>
|
2022-03-09 20:47:54 -05:00
|
|
|
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
|
|
|
<ShiftBy y={-2}><Image src={'/assets/logo-optimized.svg'} width={'48px'} height={'48px'} alt="" /></ShiftBy>
|
|
|
|
<Spacer />
|
|
|
|
<Text style={{ display: 'inline' }} h1> Welcome to Drift</Text>
|
|
|
|
</div>
|
2022-03-07 19:42:47 -05:00
|
|
|
<Document
|
|
|
|
editable={false}
|
2022-03-08 19:39:24 -05:00
|
|
|
content={introContent}
|
2022-03-08 00:02:51 -05:00
|
|
|
title={`Welcome to Drift.md`}
|
|
|
|
initialTab={`preview`}
|
|
|
|
/>
|
|
|
|
<Document
|
|
|
|
editable={false}
|
2022-03-08 19:39:24 -05:00
|
|
|
content={todoContent}
|
2022-03-08 00:02:51 -05:00
|
|
|
title={`TODO.md`}
|
2022-03-07 19:42:47 -05:00
|
|
|
initialTab={`preview`}
|
|
|
|
/>
|
|
|
|
</Page.Content>
|
|
|
|
</Page >
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Home
|