Unverified Commit 81fd7046 authored by Paco's avatar Paco Committed by GitHub

Update the default template of create-next-app (#10327)

* Update the default template for create-next-app

* Fix link
parent 90015e35
import React from 'react'
import Link from 'next/link'
const links = [
{ href: 'https://zeit.co/now', label: 'ZEIT' },
{ href: 'https://github.com/zeit/next.js', label: 'GitHub' },
].map(link => ({
...link,
key: `nav-link-${link.href}-${link.label}`,
}))
const Nav = () => (
<nav>
<ul>
<li>
<Link href="/">
<a>Home</a>
</Link>
</li>
{links.map(({ key, href, label }) => (
<li key={key}>
<a href={href}>{label}</a>
</li>
))}
</ul>
<style jsx>{`
:global(body) {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Avenir,
Helvetica, sans-serif;
}
nav {
text-align: center;
}
ul {
display: flex;
justify-content: space-between;
}
nav > ul {
padding: 4px 16px;
}
li {
display: flex;
padding: 6px 8px;
}
a {
color: #067df7;
text-decoration: none;
font-size: 13px;
}
`}</style>
</nav>
)
export default Nav
import React from 'react' import React from 'react'
import Head from 'next/head' import Head from 'next/head'
import Nav from '../components/nav'
const Home = () => ( const Home = () => (
<div> <div className="container">
<Head> <Head>
<title>Home</title> <title>Create Next App</title>
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
</Head> </Head>
<Nav /> <main>
<h1 className="title">
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
<div className="hero">
<h1 className="title">Welcome to Next.js!</h1>
<p className="description"> <p className="description">
To get started, edit <code>pages/index.js</code> and save to reload. Get started by editing <code>pages/index.js</code>
</p> </p>
<div className="row"> <div className="grid">
<a href="https://nextjs.org/docs" className="card"> <a href="https://nextjs.org/docs" className="card">
<h3>Documentation &rarr;</h3> <h3>Documentation &rarr;</h3>
<p>Learn more about Next.js in the documentation.</p> <p>Find in-depth information about Next.js features and API.</p>
</a> </a>
<a href="https://nextjs.org/learn" className="card"> <a href="https://nextjs.org/learn" className="card">
<h3>Next.js Learn &rarr;</h3> <h3>Learn &rarr;</h3>
<p>Learn about Next.js by following an interactive tutorial!</p> <p>Learn about Next.js in an interactive course with quizzes!</p>
</a> </a>
<a <a
href="https://github.com/zeit/next.js/tree/master/examples" href="https://github.com/zeit/next.js/tree/master/examples"
className="card" className="card"
> >
<h3>Examples &rarr;</h3> <h3>Examples &rarr;</h3>
<p>Find other example boilerplates on the Next.js GitHub.</p> <p>Discover and deploy boilerplate example Next.js projects.</p>
</a>
<a href="https://zeit.co/new/nextjs" className="card">
<h3>Deploy &rarr;</h3>
<p>
Instantly deploy your Next.js site to a public URL with ZEIT Now.
</p>
</a> </a>
</div> </div>
</div> </main>
<footer>
<a href="https://zeit.co" target="_blank" rel="noopener noreferrer">
Powered by <img src="/zeit.svg" alt="ZEIT Logo" />
</a>
</footer>
<style jsx>{` <style jsx>{`
.hero { .container {
min-height: 100vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
footer {
width: 100%; width: 100%;
color: #333; height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
footer img {
margin-left: 0.5rem;
}
footer a {
display: flex;
justify-content: center;
align-items: center;
}
a {
color: inherit;
text-decoration: none;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
} }
.title { .title {
margin: 0; margin: 0;
width: 100%;
padding-top: 80px;
line-height: 1.15; line-height: 1.15;
font-size: 48px; font-size: 4rem;
} }
.title, .title,
.description { .description {
text-align: center; text-align: center;
} }
.row {
max-width: 880px; .description {
margin: 80px auto 40px; line-height: 1.5;
font-size: 1.5rem;
}
code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono,
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex; display: flex;
flex-direction: row; align-items: center;
justify-content: space-around; justify-content: center;
flex-wrap: wrap;
max-width: 800px;
margin-top: 3rem;
} }
.card { .card {
padding: 18px 18px 24px; margin: 1rem;
width: 220px; flex-basis: 45%;
padding: 1.5rem;
text-align: left; text-align: left;
color: inherit;
text-decoration: none; text-decoration: none;
color: #434343; border: 1px solid #eaeaea;
border: 1px solid #9b9b9b; border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
} }
.card:hover {
border-color: #067df7; .card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
} }
.card h3 { .card h3 {
margin: 0; margin: 0 0 1rem 0;
color: #067df7; font-size: 1.5rem;
font-size: 18px;
} }
.card p { .card p {
margin: 0; margin: 0;
padding: 12px 0 0; font-size: 1.25rem;
font-size: 13px; line-height: 1.5;
color: #333; }
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
`}</style>
<style jsx global>{`
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
* {
box-sizing: border-box;
} }
`}</style> `}</style>
</div> </div>
......
<svg width="82" height="16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="url(#prefix__paint0_linear)" d="M9.018 0l9.019 16H0L9.018 0z"/>
<path fill="#333" fill-rule="evenodd" d="M51.634 12.028h-6.492V2.052h6.492v1.256H46.61v3.007h4.37V7.57h-4.37v3.202h5.024v1.255zm-14.063 0h-7.235v-1.096l5.342-7.624h-5.253V2.052h7.058v1.097l-5.342 7.623h5.43v1.256zm21.88 0h6.333v-1.256h-2.423V3.308h2.423V2.052h-6.332v1.256h2.441v7.465h-2.441v1.255zm18.22 0h-1.468v-8.72h-3.36V2.052h8.225v1.256H77.67v8.72z" clip-rule="evenodd"/>
<defs>
<linearGradient id="prefix__paint0_linear" x1="28.022" x2="16.189" y1="22.991" y2="8.569" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff"/>
<stop offset="1"/>
</linearGradient>
</defs>
</svg>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment