Restructure and update imports
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { FeaturedContentWrap } from './style';
|
import { FeaturedContentWrap } from './style';
|
||||||
import roadmaps from 'data/roadmaps';
|
import roadmaps from 'storage/roadmaps';
|
||||||
import FeaturedRoadmap from 'components/featured-roadmap';
|
import FeaturedRoadmap from 'components/featured-roadmap';
|
||||||
|
|
||||||
const FeaturedRoadmaps = () => (
|
const FeaturedRoadmaps = () => (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import NextHead from 'next/head';
|
import NextHead from 'next/head';
|
||||||
import siteConfig from 'data/site';
|
import siteConfig from 'storage/site';
|
||||||
import { GA_TRACKING_ID } from 'lib/gtag';
|
import { GA_TRACKING_ID } from 'lib/gtag';
|
||||||
|
|
||||||
const prepareTitle = (givenTitle) => {
|
const prepareTitle = (givenTitle) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import Link from '../icons/link.svg';
|
import Link from 'components/icons/link.svg';
|
||||||
|
|
||||||
const linkify = (Component) => {
|
const linkify = (Component) => {
|
||||||
return (props) => {
|
return (props) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import siteConfig from "data/site";
|
import siteConfig from "storage/site";
|
||||||
import { FooterWrap } from './style.js'
|
import { FooterWrap } from './style.js'
|
||||||
|
|
||||||
const PageFooter = () => (
|
const PageFooter = () => (
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
import { faEnvelope, faClock, faHandshake, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
||||||
import {
|
import {
|
||||||
SummaryContainer,
|
SummaryContainer,
|
||||||
Title,
|
Title,
|
||||||
@ -12,17 +14,15 @@ import {
|
|||||||
} from './style';
|
} from './style';
|
||||||
import SharePage from 'components/share-page';
|
import SharePage from 'components/share-page';
|
||||||
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge, DarkBadge } from 'components/badges';
|
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge, DarkBadge } from 'components/badges';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
||||||
import { faEnvelope, faClock, faHandshake, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
|
||||||
import GuideBody from 'components/guide-body';
|
import GuideBody from 'components/guide-body';
|
||||||
import siteConfig from "data/site";
|
import siteConfig from "storage/site";
|
||||||
|
|
||||||
const isActiveRoadmap = (loadedVersion, roadmapVersion) => (
|
const isActiveRoadmap = (loadedVersion, roadmapVersion) => (
|
||||||
(loadedVersion === roadmapVersion) ||
|
(loadedVersion === roadmapVersion) ||
|
||||||
(loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear())
|
(loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear())
|
||||||
);
|
);
|
||||||
|
|
||||||
const UpcomingGuide = require(`../../data/roadmaps/upcoming.md`).default;
|
const UpcomingGuide = require(`../../storage/roadmaps/upcoming.md`).default;
|
||||||
|
|
||||||
const RoadmapSummary = ({ roadmap }) => (
|
const RoadmapSummary = ({ roadmap }) => (
|
||||||
<SummaryContainer>
|
<SummaryContainer>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Helmet from 'components/helmet';
|
import Helmet from 'components/helmet';
|
||||||
import './global.scss';
|
import './global.scss';
|
||||||
import { firePageView } from '../../lib/gtag';
|
import { firePageView } from 'lib/gtag';
|
||||||
|
|
||||||
class DefaultLayout extends React.Component {
|
class DefaultLayout extends React.Component {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
import authors from "data/authors";
|
import authors from "storage/authors";
|
||||||
|
|
||||||
export const findByUsername = (username) => authors.find(author => author.username === username) || {};
|
export const findByUsername = (username) => authors.find(author => author.username === username) || {};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import guides from "data/guides";
|
import guides from "storage/guides";
|
||||||
import authors from "data/authors";
|
import authors from "storage/authors";
|
||||||
import siteConfig from "data/site";
|
import siteConfig from "storage/site";
|
||||||
|
|
||||||
export const getAllGuides = () => {
|
export const getAllGuides = () => {
|
||||||
return guides.filter(guide => !guide.draft)
|
return guides.filter(guide => !guide.draft)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import roadmaps from "data/roadmaps";
|
import roadmaps from "storage/roadmaps";
|
||||||
|
|
||||||
export const getRequestedRoadmap = req => {
|
export const getRequestedRoadmap = req => {
|
||||||
// Considering it a new roadmap URL e.g. `/roadmaps/frontend`
|
// Considering it a new roadmap URL e.g. `/roadmaps/frontend`
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import queryString from 'query-string';
|
import queryString from 'query-string';
|
||||||
import siteConfig from 'data/site';
|
import siteConfig from 'storage/site';
|
||||||
|
|
||||||
export const prefixHost = (url) => {
|
export const prefixHost = (url) => {
|
||||||
return /^\//.test(url) ? `${siteConfig.url}${url}` : url;
|
return /^\//.test(url) ? `${siteConfig.url}${url}` : url;
|
||||||
|
@ -13,7 +13,7 @@ const Guide = ({ guide }) => {
|
|||||||
return <Error statusCode={ 404 } />
|
return <Error statusCode={ 404 } />
|
||||||
}
|
}
|
||||||
|
|
||||||
const GuideContent = require(`../../data/guides/${guide.fileName}.md`).default;
|
const GuideContent = require(`../../storage/guides/${guide.fileName}.md`).default;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<GuideLayout>
|
<GuideLayout>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
import { faCodeBranch, faEnvelope } from '@fortawesome/free-solid-svg-icons/index';
|
||||||
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
|
||||||
|
import FeaturedGuide from 'components/featured-guide';
|
||||||
import DefaultLayout from 'layouts/default/index';
|
import DefaultLayout from 'layouts/default/index';
|
||||||
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 SiteNav from 'components/site-nav';
|
||||||
import { getAllGuides } from 'lib/guide';
|
import { getAllGuides } from 'lib/guide';
|
||||||
import FeaturedGuide from '../../components/featured-guide';
|
import siteConfig from 'storage/site';
|
||||||
import { faCodeBranch, faEnvelope } from '@fortawesome/free-solid-svg-icons/index';
|
|
||||||
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
||||||
import siteConfig from "data/site";
|
|
||||||
|
|
||||||
const Roadmap = () => (
|
const Roadmap = () => (
|
||||||
<DefaultLayout>
|
<DefaultLayout>
|
||||||
|
@ -4,11 +4,11 @@ import DefaultLayout from 'layouts/default/index';
|
|||||||
import SiteNav from 'components/site-nav';
|
import SiteNav from 'components/site-nav';
|
||||||
import PageFooter from 'components/page-footer';
|
import PageFooter from 'components/page-footer';
|
||||||
import PageHeader from 'components/page-header';
|
import PageHeader from 'components/page-header';
|
||||||
import roadmaps from "data/roadmaps";
|
import roadmaps from "storage/roadmaps";
|
||||||
import RowBlock from 'components/row-block';
|
import RowBlock from 'components/row-block';
|
||||||
import IconRowBlock from 'components/icon-row-block';
|
import IconRowBlock from 'components/icon-row-block';
|
||||||
import siteConfig from "data/site";
|
import siteConfig from "storage/site";
|
||||||
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from '../components/badges';
|
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faEnvelope, faCodeBranch } from '@fortawesome/free-solid-svg-icons';
|
import { faEnvelope, faCodeBranch } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
|
|
||||||
const guides = require('./data/guides.json');
|
const guides = require('./storage/guides.json');
|
||||||
const roadmaps = require('./data/roadmaps');
|
const roadmaps = require('./storage/roadmaps');
|
||||||
|
|
||||||
const PAGES_PATH = path.join(__dirname, 'pages');
|
const PAGES_PATH = path.join(__dirname, 'pages');
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ If you think that these can be improved in anyway, please do suggest.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Back-end Roadmap
|
## Backend Roadmap
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## DevOps Roadmap
|
## DevOps Roadmap
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const guides = require('../data/guides');
|
const guides = require('../storage/guides');
|
||||||
const roadmaps = require('../data/roadmaps');
|
const roadmaps = require('../storage/roadmaps');
|
||||||
|
|
||||||
const {
|
const {
|
||||||
getPageRoutes,
|
getPageRoutes,
|
||||||
@ -50,7 +50,7 @@ describe("Build scripts tests", () => {
|
|||||||
guides.forEach(guide => {
|
guides.forEach(guide => {
|
||||||
const [,, slug] = guide.url.split('/');
|
const [,, slug] = guide.url.split('/');
|
||||||
|
|
||||||
const expectedFile = path.join(__dirname, `../data/guides/${slug}.md`);
|
const expectedFile = path.join(__dirname, `../storage/guides/${slug}.md`);
|
||||||
const foundFile = fs.existsSync(expectedFile) ? expectedFile : '';
|
const foundFile = fs.existsSync(expectedFile) ? expectedFile : '';
|
||||||
|
|
||||||
expect(foundFile).toEqual(expectedFile);
|
expect(foundFile).toEqual(expectedFile);
|
||||||
|
Reference in New Issue
Block a user