Restructure and update imports
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import Link from 'next/link';
|
||||
import { FeaturedContentWrap } from './style';
|
||||
import roadmaps from 'data/roadmaps';
|
||||
import roadmaps from 'storage/roadmaps';
|
||||
import FeaturedRoadmap from 'components/featured-roadmap';
|
||||
|
||||
const FeaturedRoadmaps = () => (
|
||||
|
@ -1,5 +1,5 @@
|
||||
import NextHead from 'next/head';
|
||||
import siteConfig from 'data/site';
|
||||
import siteConfig from 'storage/site';
|
||||
import { GA_TRACKING_ID } from 'lib/gtag';
|
||||
|
||||
const prepareTitle = (givenTitle) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import styled from 'styled-components';
|
||||
import Link from '../icons/link.svg';
|
||||
import Link from 'components/icons/link.svg';
|
||||
|
||||
const linkify = (Component) => {
|
||||
return (props) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
import siteConfig from "data/site";
|
||||
import siteConfig from "storage/site";
|
||||
import { FooterWrap } from './style.js'
|
||||
|
||||
const PageFooter = () => (
|
||||
|
@ -1,5 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
import classNames from 'classnames';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faEnvelope, faClock, faHandshake, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
||||
import {
|
||||
SummaryContainer,
|
||||
Title,
|
||||
@ -12,17 +14,15 @@ import {
|
||||
} from './style';
|
||||
import SharePage from 'components/share-page';
|
||||
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 siteConfig from "data/site";
|
||||
import siteConfig from "storage/site";
|
||||
|
||||
const isActiveRoadmap = (loadedVersion, roadmapVersion) => (
|
||||
(loadedVersion === roadmapVersion) ||
|
||||
(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 }) => (
|
||||
<SummaryContainer>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import Helmet from 'components/helmet';
|
||||
import './global.scss';
|
||||
import { firePageView } from '../../lib/gtag';
|
||||
import { firePageView } from 'lib/gtag';
|
||||
|
||||
class DefaultLayout extends React.Component {
|
||||
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) || {};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import guides from "data/guides";
|
||||
import authors from "data/authors";
|
||||
import siteConfig from "data/site";
|
||||
import guides from "storage/guides";
|
||||
import authors from "storage/authors";
|
||||
import siteConfig from "storage/site";
|
||||
|
||||
export const getAllGuides = () => {
|
||||
return guides.filter(guide => !guide.draft)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import roadmaps from "data/roadmaps";
|
||||
import roadmaps from "storage/roadmaps";
|
||||
|
||||
export const getRequestedRoadmap = req => {
|
||||
// Considering it a new roadmap URL e.g. `/roadmaps/frontend`
|
||||
|
@ -1,5 +1,5 @@
|
||||
import queryString from 'query-string';
|
||||
import siteConfig from 'data/site';
|
||||
import siteConfig from 'storage/site';
|
||||
|
||||
export const prefixHost = (url) => {
|
||||
return /^\//.test(url) ? `${siteConfig.url}${url}` : url;
|
||||
|
@ -13,7 +13,7 @@ const Guide = ({ guide }) => {
|
||||
return <Error statusCode={ 404 } />
|
||||
}
|
||||
|
||||
const GuideContent = require(`../../data/guides/${guide.fileName}.md`).default;
|
||||
const GuideContent = require(`../../storage/guides/${guide.fileName}.md`).default;
|
||||
|
||||
return (
|
||||
<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 SiteNav from 'components/site-nav';
|
||||
import PageHeader from 'components/page-header';
|
||||
import PageFooter from 'components/page-footer';
|
||||
import SiteNav from 'components/site-nav';
|
||||
import { getAllGuides } from 'lib/guide';
|
||||
import FeaturedGuide from '../../components/featured-guide';
|
||||
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";
|
||||
import siteConfig from 'storage/site';
|
||||
|
||||
const Roadmap = () => (
|
||||
<DefaultLayout>
|
||||
|
@ -4,11 +4,11 @@ import DefaultLayout from 'layouts/default/index';
|
||||
import SiteNav from 'components/site-nav';
|
||||
import PageFooter from 'components/page-footer';
|
||||
import PageHeader from 'components/page-header';
|
||||
import roadmaps from "data/roadmaps";
|
||||
import roadmaps from "storage/roadmaps";
|
||||
import RowBlock from 'components/row-block';
|
||||
import IconRowBlock from 'components/icon-row-block';
|
||||
import siteConfig from "data/site";
|
||||
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from '../components/badges';
|
||||
import siteConfig from "storage/site";
|
||||
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faEnvelope, faCodeBranch } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
const path = require('path');
|
||||
const glob = require('glob');
|
||||
|
||||
const guides = require('./data/guides.json');
|
||||
const roadmaps = require('./data/roadmaps');
|
||||
const guides = require('./storage/guides.json');
|
||||
const roadmaps = require('./storage/roadmaps');
|
||||
|
||||
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
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const guides = require('../data/guides');
|
||||
const roadmaps = require('../data/roadmaps');
|
||||
const guides = require('../storage/guides');
|
||||
const roadmaps = require('../storage/roadmaps');
|
||||
|
||||
const {
|
||||
getPageRoutes,
|
||||
@ -50,7 +50,7 @@ describe("Build scripts tests", () => {
|
||||
guides.forEach(guide => {
|
||||
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 : '';
|
||||
|
||||
expect(foundFile).toEqual(expectedFile);
|
||||
|
Reference in New Issue
Block a user