remove changelog from OSS
This commit is contained in:
@@ -1,124 +0,0 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { groupBy, map } from 'lodash';
|
||||
import format from 'date-fns/format';
|
||||
import styled from 'styled-components';
|
||||
import Grid from 'styled-components-grid';
|
||||
import PageTitle from './components/PageTitle';
|
||||
import Markdown from './components/Markdown';
|
||||
import Header from './components/Header';
|
||||
import Content from './components/Content';
|
||||
|
||||
type Release = {
|
||||
id: string,
|
||||
name: string,
|
||||
body: string,
|
||||
created_at: string,
|
||||
};
|
||||
|
||||
type Props = { releases: Release[] };
|
||||
|
||||
function Changelog({ releases }: Props) {
|
||||
const categories = groupBy(releases, i =>
|
||||
format(new Date(i.created_at), 'MMMM, YYYY')
|
||||
);
|
||||
|
||||
return (
|
||||
<Grid>
|
||||
<Helmet>
|
||||
<link
|
||||
rel="alternate"
|
||||
type="application/atom+xml"
|
||||
title="Release Notes"
|
||||
href="https://github.com/outline/outline/releases.atom"
|
||||
/>
|
||||
</Helmet>
|
||||
<PageTitle title="Changelog" />
|
||||
<Header background="#00ADFF">
|
||||
<h1>Changelog</h1>
|
||||
<p>We’re building in public. Here’s what has changed recently.</p>
|
||||
</Header>
|
||||
<Content>
|
||||
<Grid>
|
||||
<Grid.Unit
|
||||
size={{ tablet: 1 / 4 }}
|
||||
visible={{ mobile: false, tablet: true }}
|
||||
>
|
||||
<nav>
|
||||
{map(categories, (releases, category) => (
|
||||
<React.Fragment key={category}>
|
||||
<h3>{category.split(',')[0]}</h3>
|
||||
<List>
|
||||
{releases.map(release => (
|
||||
<li key={release.id}>
|
||||
<MenuItem href={`#${release.name}`}>
|
||||
{release.name}
|
||||
</MenuItem>
|
||||
</li>
|
||||
))}
|
||||
</List>
|
||||
</React.Fragment>
|
||||
))}
|
||||
</nav>
|
||||
</Grid.Unit>
|
||||
<Grid.Unit size={{ tablet: 3 / 4 }}>
|
||||
{releases.map(release => (
|
||||
<Article key={release.id}>
|
||||
<Heading id={release.name}>
|
||||
<a href={`#${release.name}`}>{release.name}</a>
|
||||
</Heading>
|
||||
<Time dateTime={release.created_at}>
|
||||
{format(new Date(release.created_at), 'MMMM Do, YYYY')}
|
||||
</Time>
|
||||
<Markdown source={release.body} />
|
||||
</Article>
|
||||
))}
|
||||
</Grid.Unit>
|
||||
</Grid>
|
||||
</Content>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
||||
const MenuItem = styled.a`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 16px;
|
||||
color: ${props => props.theme.text};
|
||||
`;
|
||||
|
||||
const List = styled.ul`
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
`;
|
||||
|
||||
const Heading = styled.h1`
|
||||
margin-top: 0.5em;
|
||||
|
||||
a {
|
||||
color: ${props => props.theme.text};
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
`;
|
||||
|
||||
const Time = styled.time`
|
||||
color: ${props => props.theme.slateDark};
|
||||
margin-top: -16px;
|
||||
display: block;
|
||||
`;
|
||||
|
||||
const Article = styled.div`
|
||||
border-bottom: 1px solid ${props => props.theme.slateLight};
|
||||
padding-bottom: 2em;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
`;
|
||||
|
||||
export default Changelog;
|
||||
@@ -1,33 +0,0 @@
|
||||
// @flow
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import styled from 'styled-components';
|
||||
|
||||
export default styled(ReactMarkdown)`
|
||||
blockquote {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
background-color: ${props => props.theme.smoke};
|
||||
border-left: 6px solid ${props => props.theme.smokeDark};
|
||||
padding: 15px 30px 15px 15px;
|
||||
font-style: italic;
|
||||
font-size: 16px;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
zoom: 50%;
|
||||
box-shadow: 0 10px 80px rgba(0, 0, 0, 0.1), 0 1px 10px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 15px;
|
||||
background: ${props => props.theme.smoke};
|
||||
padding: 2px 4px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
`;
|
||||
@@ -56,18 +56,6 @@ if (process.env.NODE_ENV === 'production') {
|
||||
// static pages
|
||||
router.get('/developers', ctx => renderpage(ctx, <Developers />));
|
||||
router.get('/developers/api', ctx => renderpage(ctx, <Api />));
|
||||
router.get('/changelog', async ctx => {
|
||||
const data = await fetch(
|
||||
`https://api.github.com/repos/outline/outline/releases`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `token ${process.env.GITHUB_ACCESS_TOKEN || ''}`,
|
||||
},
|
||||
}
|
||||
);
|
||||
const releases = await data.json();
|
||||
return renderpage(ctx, <Changelog releases={releases} />);
|
||||
});
|
||||
|
||||
// home page
|
||||
router.get('/', async ctx => {
|
||||
|
||||
Reference in New Issue
Block a user