Roadmap to becoming a developer in 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
890 B

5 years ago
import GuideLayout from '../../layouts/guide';
import { serverOnlyProps } from '../../lib/server';
import GuideHeader from '../../components/guide-header';
import GuideContent from '../../data/guides/keep-it-clean.md';
import GuideBody from '../../components/guide-body';
import ShareGuide from '../../components/share-guide';
import GuideFooter from '../../components/guide-footer';
5 years ago
const Guide = ({ guide }) => {
return (
<GuideLayout>
<GuideHeader/>
<GuideBody>
<GuideContent/>
<ShareGuide/>
</GuideBody>
<GuideFooter/>
5 years ago
</GuideLayout>
);
};
Guide.getInitialProps = serverOnlyProps(({ req }) => {
// Remove URL chunk to make it a slug e.g. /guides/some-guide-item to become `some-guide-item
const slug = req.url
.replace(/^\/*?guides\/*?/, '/')
.replace(/\/*$/, '');
5 years ago
return {
slug,
};
});
export default Guide;