git ssb

0+

Rômulo Alves / website



Commit 6b5b84b3614cf087b2199be76f9d915b13d8ae89

Starting a new version using zeit/next

Rômulo Alves committed on 10/26/2016, 9:42:21 PM
Parent: 20738f5c6c86f792bd1d29630749a0e32572a0b6

Files changed

.gitignorechanged
package.jsonchanged
gulpfile.jsdeleted
_components/common/Head.jsadded
_components/common/globalStyles.jsadded
_components/index/Header.jsadded
src/favicon.pngdeleted
src/index.htmldeleted
src/index.jsdeleted
src/service-worker.jsdeleted
src/style.cssdeleted
pages/index.jsadded
static/favicon.pngadded
.gitignoreView
@@ -1,4 +1,3 @@
11 node_modules
2-dist
3-.publish
4-.DS_Store
2+.DS_Store
3+.next
package.jsonView
@@ -1,20 +1,15 @@
11 {
22 "name": "romuloalves.github.io",
33 "version": "1.0.0",
4- "description": "",
5- "main": "gulpfile.js",
6- "dependencies": {},
7- "devDependencies": {
8- "gulp": "^3.9.1",
9- "gulp-clean-css": "^2.0.13",
10- "gulp-minify-html": "^1.0.6",
11- "gulp-rev": "^7.1.2",
12- "gulp-uglify": "^2.0.0",
13- "gulp-usemin": "^0.3.24"
4+ "description": "Rômulo Alves website",
5+ "dependencies": {
6+ "next": "^1.0.0"
147 },
158 "scripts": {
16- "test": "echo \"Error: no test specified\" && exit 1"
9+ "dev": "next",
10+ "build": "next build",
11+ "start": "next start"
1712 },
1813 "repository": {
1914 "type": "git",
2015 "url": "git+https://github.com/romuloalves/romuloalves.github.io.git"
gulpfile.jsView
@@ -1,32 +1,0 @@
1-const gulp = require('gulp');
2-const minifyHtml = require('gulp-minify-html');
3-const cleanCSS = require('gulp-clean-css');
4-const usemin = require('gulp-usemin');
5-const uglify = require('gulp-uglify');
6-const rev = require('gulp-rev');
7-
8-gulp.task('copy', () =>
9- gulp.src(['src/favicon.png'])
10- .pipe(gulp.dest('dist/')));
11-
12-gulp.task('sw', () =>
13- gulp.src(['src/service-worker.js'])
14- .pipe(uglify())
15- .pipe(gulp.dest('dist/')));
16-
17-gulp.task('build', ['copy'], () => {
18- return gulp.src('src/index.html')
19- .pipe(usemin({
20- css: [ rev() ],
21- js: [ uglify(), rev() ],
22- html: [ minifyHtml({ empty: true }) ],
23- inlinecss: [ cleanCSS, 'concat' ]
24- }))
25- .pipe(gulp.dest('dist/'));
26-});
27-
28-gulp.task('dist', ['build', 'sw']);
29-
30-gulp.task('dev', ['build'], () => {
31- gulp.watch(['src/index.html', 'src/style.css'], ['build']);
32-});
_components/common/Head.jsView
@@ -1,0 +1,25 @@
1+// Packages
2+import React from 'react';
3+import Head from 'next/head';
4+
5+import globalStyles from './globalStyles'
6+
7+const defaultTitle = '@romuloalves';
8+
9+const getTitle = partialTitle => {
10+ if (!partialTitle) return defaultTitle;
11+ return `${defaultTitle} - ${partialTitle}`;
12+};
13+
14+export default ({title}) => (
15+ <div>
16+ <Head>
17+ <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
18+ <meta name="description" content="@romuloalves - Web Developer" />
19+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
20+ <link rel="icon" type="image/png" href="/static/favicon.png" />
21+ <title>{getTitle(title)}</title>
22+ <style>{globalStyles}</style>
23+ </Head>
24+ </div>
25+);
_components/common/globalStyles.jsView
@@ -1,0 +1,10 @@
1+module.exports = `
2+ * {
3+ border: none;
4+ margin: 0;
5+ padding: 0;
6+ }
7+ body {
8+ min-height: 100%;
9+ }
10+`;
_components/index/Header.jsView
@@ -1,0 +1,16 @@
1+// Packages
2+import React from 'react';
3+import css from 'next/css';
4+
5+export default () => (
6+ <header className={headerStyle}>
7+ <h1>Rômulo Alves</h1>
8+ </header>
9+);
10+
11+const headerStyle = css({
12+ background: '#EF5350',
13+ minHeight: '50%',
14+ top: 0,
15+ width: '100%'
16+});
src/favicon.png
src/favicon.png
src/index.htmlView
@@ -1,20 +1,0 @@
1-<!DOCTYPE html>
2-<html>
3- <head>
4- <meta charset="utf-8">
5- <meta http-equiv="X-UA-Compatible" content="IE=edge">
6- <meta name="description" content="@romuloalves - Web Developer">
7- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8- <link rel="icon" type="image/png" href="favicon.png" />
9- <title>@romuloalves</title>
10- <!-- build:inlinecss -->
11- <link rel="stylesheet" type="text/css" href="style.css">
12- <!-- endbuild -->
13- </head>
14- <body>
15- <div class="background"></div>
16- <header>
17- <h1>Rômulo Alves</h1>
18- </header>
19- </body>
20-</html>
src/index.jsView
@@ -1,5 +1,0 @@
1-if ('serviceWorker' in navigator) {
2- navigator.serviceWorker.register('/service-worker.js').then(function(registration) {
3- console.log('ServiceWorker for offline registered!', registration.scope);
4- });
5-}
src/service-worker.jsView
@@ -1,42 +1,0 @@
1-var CACHE_NAME = '20161003';
2-var urlsToCache = [
3- '/',
4- '/favicon.png'
5-];
6-
7-self.addEventListener('install', function(event) {
8- event.waitUntil(
9- caches.open(CACHE_NAME)
10- .then(function(cache) {
11- return cache.addAll(urlsToCache);
12- })
13- );
14-});
15-
16-self.addEventListener('fetch', function(event) {
17- event.respondWith(
18- caches.match(event.request)
19- .then(function(response) {
20- if (response) {
21- return response;
22- }
23-
24- var fetchRequest = event.request.clone();
25- return fetch(fetchRequest).then(
26- function(response) {
27- if(!response || response.status !== 200 || response.type !== 'basic') {
28- return response;
29- }
30-
31- var responseToCache = response.clone();
32- caches.open(CACHE_NAME)
33- .then(function(cache) {
34- cache.put(event.request, responseToCache);
35- });
36-
37- return response;
38- }
39- );
40- })
41- );
42-});
src/style.cssView
@@ -1,27 +1,0 @@
1-* {
2- border: none;
3- font-family: Menlo, Monaco, Consolas;
4- margin: 0;
5- padding: 0;
6-}
7-
8-.background {
9- background: #2196F3;
10- height: 100%;
11- left: -50%;
12- position: absolute;
13- top: 0;
14- transform: skewX(-25deg);
15- width: 100%;
16-}
17-
18-header {
19- height: 100%;
20- padding: 10% 15%;
21- position: relative;
22- width: 50%;
23-}
24-
25-header h1 {
26- color: #FFF;
27-}
pages/index.jsView
@@ -1,0 +1,13 @@
1+// Packages
2+import React from 'react';
3+
4+// Components
5+import Head from '../_components/common/Head';
6+import Header from '../_components/index/Header';
7+
8+export default () => (
9+ <div>
10+ <Head />
11+ <Header />
12+ </div>
13+);
static/favicon.png
static/favicon.png

Built with git-ssb-web