Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milestone #1: Setup the boilerplate for success #1

Merged
merged 4 commits into from
Apr 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- 10.16.1
cache:
directories:
- node_modules
script:
- yarn
- yarn build
13 changes: 13 additions & 0 deletions components/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Head from 'next/head';
import * as SITE_CONFIG from '../public/site.config.json';

export default ({ children, title = SITE_CONFIG.seo.title }) => (
<div>
<Head>
<title>{title}</title>
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
{children}
</div>
)
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require('dotenv').config()
module.exports = {
env: {
NEWS_API: process.env.NEWS_API,
},
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"start": "next start"
},
"dependencies": {
"dotenv": "^8.2.0",
"isomorphic-unfetch": "^3.0.0",
"next": "9.3.4",
"react": "16.13.1",
"react-dom": "16.13.1"
Expand Down
6 changes: 6 additions & 0 deletions pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

import '../style.css';

export default function QriusApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
96 changes: 9 additions & 87 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,91 +1,13 @@
import React from 'react'
import Link from 'next/link'
import Head from 'next/head'
import Nav from '../components/nav'
import React from 'react';
import * as SITE_CONFIG from '../public/site.config.json';

const Home = () => (
<div>
<Head>
<title>Home</title>
</Head>
import Layout from '../components/layout';

<Nav />

<div className='hero'>
<h1 className='title'>Welcome to Next.js!</h1>
<p className='description'>
To get started, edit <code>pages/index.js</code> and save to reload.
export default () => (
<Layout>
<h1 className="title">{SITE_CONFIG.siteName}</h1>
<p className="description">
{SITE_CONFIG.seo.description}
</p>

<div className='row'>
<Link href='https://github.com/zeit/next.js#getting-started'>
<a className='card'>
<h3>Getting Started &rarr;</h3>
<p>Learn more about Next.js on GitHub and in their examples</p>
</a>
</Link>
<Link href='https://github.com/zeit/next.js/tree/master/examples'>
<a className='card'>
<h3>Examples &rarr;</h3>
<p>Find other example boilerplates on the Next.js GitHub</p>
</a>
</Link>
<Link href='https://github.com/zeit/next.js'>
<a className='card'>
<h3>Create Next App &rarr;</h3>
<p>Was this tool helpful? Let us know how we can improve it!</p>
</a>
</Link>
</div>
</div>

<style jsx>{`
.hero {
width: 100%;
color: #333;
}
.title {
margin: 0;
width: 100%;
padding-top: 80px;
line-height: 1.15;
font-size: 48px;
}
.title,
.description {
text-align: center;
}
.row {
max-width: 880px;
margin: 80px auto 40px;
display: flex;
flex-direction: row;
justify-content: space-around;
}
.card {
padding: 18px 18px 24px;
width: 220px;
text-align: left;
text-decoration: none;
color: #434343;
border: 1px solid #9b9b9b;
}
.card:hover {
border-color: #067df7;
}
.card h3 {
margin: 0;
color: #067df7;
font-size: 18px;
}
.card p {
margin: 0;
padding: 12px 0 0;
font-size: 13px;
color: #333;
}
`}</style>
</div>
</Layout>
)

export default Home
12 changes: 12 additions & 0 deletions public/site.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"siteName": "Y",
"seo": {
"title": "Qrius - News, views and stuff making a difference...",
"description": "HN Clone",
"openGraph": {
"type": "website",
"locale": "en_IE",
"site_name": "Y"
}
}
}
4 changes: 4 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

body {
background-color: antiquewhite;
}
Loading