Guide listing page

pull/1331/head
Kamran Ahmed 5 years ago
parent c96412b8e5
commit 3704b89bea
  1. 2
      components/featured-guide/index.js
  2. 2
      components/row-block/style.js
  3. 10
      data/guides.json
  4. 4
      lib/guide.js
  5. 15
      pages/guides/index.js
  6. 2
      pages/roadmaps.js

@ -7,7 +7,7 @@ import { findByUsername } from 'lib/author';
const FeaturedGuide = ({ guide }) => { const FeaturedGuide = ({ guide }) => {
const author = findByUsername(guide.author) || {}; const author = findByUsername(guide.author) || {};
return ( return (
<div className="col-xl-4 col-lg-4 col-md-6 col-sm-12 col-12 grid-item-container"> <div className="col-xl-4 col-lg-6 col-md-6 col-sm-12 col-12 grid-item-container">
<Link href={ guide.url } passHref> <Link href={ guide.url } passHref>
<BlockLink> <BlockLink>
<BlockTitle>{ guide.title }</BlockTitle> <BlockTitle>{ guide.title }</BlockTitle>

@ -5,7 +5,7 @@ export const ItemWrap = styled.div`
`; `;
export const BlockItem = styled.a` export const BlockItem = styled.a`
height: 114px; min-height: 114px;
box-shadow: rgba(0, 0, 0, 0.12) 0 5px 10px; box-shadow: rgba(0, 0, 0, 0.12) 0 5px 10px;
transition: box-shadow 0.2s ease 0s; transition: box-shadow 0.2s ease 0s;
align-items: stretch; align-items: stretch;

@ -58,5 +58,15 @@
"author": "kamranahmedse", "author": "kamranahmedse",
"updatedAt": "2019-10-09T12:00:00.860Z", "updatedAt": "2019-10-09T12:00:00.860Z",
"createdAt": "2019-01-23T17:00:00.860Z" "createdAt": "2019-01-23T17:00:00.860Z"
},
{
"title": "Journey to HTTP/2",
"description": "The evolution of HTTP. How it all started and where we stand today",
"url": "/guides/journey-to-http2",
"fileName": "http-caching",
"featured": false,
"author": "kamranahmedse",
"updatedAt": "2019-10-09T12:00:00.860Z",
"createdAt": "2019-01-23T17:00:00.860Z"
} }
] ]

@ -2,6 +2,10 @@ import guides from "data/guides";
import authors from "data/authors"; import authors from "data/authors";
import siteConfig from "data/site"; import siteConfig from "data/site";
export const getAllGuides = () => {
return guides;
};
export const getRequestedGuide = req => { export const getRequestedGuide = req => {
const guide = guides.find(guide => guide.url === req.url); const guide = guides.find(guide => guide.url === req.url);
if (!guide) { if (!guide) {

@ -2,18 +2,23 @@ import DefaultLayout from 'layouts/default/index';
import SiteNav from 'components/site-nav'; import SiteNav from 'components/site-nav';
import PageHeader from 'components/page-header'; import PageHeader from 'components/page-header';
import PageFooter from 'components/page-footer'; import PageFooter from 'components/page-footer';
import { getAllGuides } from 'lib/guide';
import FeaturedGuide from '../../components/featured-guide';
const Roadmap = () => ( const Roadmap = () => (
<DefaultLayout> <DefaultLayout>
<SiteNav /> <SiteNav />
<PageHeader <PageHeader
title="Guides" title="Programming Guides"
subtitle="Community written guides, <a href='/signup'>subscribe to get new guides</a>" subtitle="Easy to follow guides on complex topics written and maintained by the community"
/> />
<div className="border-top bg-light"> <div className="pt-5 pb-5 bg-light border-top">
<div className="container"> <div className="container">
<p>Show all guides here</p> <div className="row">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis eaque mollitia nobis perferendis perspiciatis, quas sed vitae. Ad commodi culpa dolorum id iusto natus nesciunt quam ratione repudiandae sed? Ab! { getAllGuides().map(guide => (
<FeaturedGuide guide={guide} key={ guide.url } />
)) }
</div>
</div> </div>
</div> </div>
<PageFooter /> <PageFooter />

@ -14,7 +14,7 @@ const RoadmapsList = () => (
<SiteNav /> <SiteNav />
<div className="container"> <div className="container">
<PageHeader <PageHeader
title="Roadmaps" title="Developer Roadmaps"
subtitle="Step by step guides and paths to learn different tools or technologies" subtitle="Step by step guides and paths to learn different tools or technologies"
/> />
</div> </div>

Loading…
Cancel
Save