Skip to content

Commit 38e9d85

Browse files
atualização do site
1 parent 5dc4d8f commit 38e9d85

File tree

120 files changed

+13014
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+13014
-0
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.babelrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015", "stage-2"]
3+
}

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/assets/scripts/main.js
2+
src/assets/scripts/main.js

.eslintrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": ["airbnb-base"],
3+
"rules": {
4+
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}]
5+
},
6+
"env": {
7+
"browser": true,
8+
"node": true,
9+
"es6": true
10+
}
11+
}
12+

CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coderockr.com

README.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
coderockr
2+
====================
3+
4+
## Setup
5+
### Requirements
6+
7+
Node `"V7.10.1"` (use nvm [here](https://github.com/creationix/nvm)
8+
9+
### Structure folder
10+
11+
```
12+
coderockr
13+
├── README.md
14+
├── CNAME
15+
├── crossdomain.xml
16+
├── humans.txt
17+
├── Makefile
18+
├── robots.txt
19+
├── .gitignore
20+
├── dist
21+
│ └── index.html
22+
│ └── about.html
23+
│ └── contact.html
24+
│ └── bundle.min.js
25+
│ └── fonts
26+
│ └── images
27+
│ └── lib
28+
│ └── styles
29+
└── src
30+
└── .babelrc
31+
└── .editorconfig
32+
└── .eslintrc
33+
└── config.js
34+
└── gulpfile.babel.js
35+
└── node_modules
36+
└── package-lock.json
37+
└── package.json
38+
└── site
39+
└── tasks
40+
└── yarn.lock
41+
```
42+
43+
### Install dependencies
44+
45+
```bash
46+
cd src
47+
```
48+
49+
```bash
50+
yarn install
51+
```
52+
53+
### Rebuild node-sass
54+
55+
```bash
56+
npm rebuild node-sass
57+
```
58+
59+
### Run
60+
61+
```bash
62+
gulp
63+
```
64+
65+
## Features
66+
67+
### tecnlogias
68+
69+
- [Gulp.js](http://gulpjs.com/) – Automate and enhance your workflow.
70+
- [BrowserSync](https://www.browsersync.io/) – Time-saving synchronised browser testing.
71+
- [Rsync](https://en.wikipedia.org/wiki/Rsync) – Deployment made easy.
72+
73+
### Stylesheets
74+
75+
- [Autoprefixer](https://github.com/postcss/autoprefixer) – Parse CSS and add vendor prefixes to rules by Can I Use.
76+
- [Sass](http://sass-lang.com/) – Sass makes CSS fun again.
77+
- [CSSO](http://css.github.io/csso/) - CSS Optimization.
78+
- [PostCSS](https://github.com/postcss/postcss) – A tool for transforming styles with JS plugins.
79+
80+
### Javascript (ES6)
81+
82+
- [Browserify](http://browserify.org/) – Bundling up all of your dependencies.
83+
- [Babel](https://babeljs.io/) – A compiler for writing next generation JavaScript.
84+
- [ESLint](http://eslint.org/) – The pluggable linting utility for JavaScript and JSX.
85+
- [UglifyJS](https://github.com/mishoo/UglifyJS2) – A JavaScript parser, minifier, compressor or beautifier toolkit.
86+
87+
### Miscellaneous
88+
89+
- [SVGStore](https://github.com/w0rm/gulp-svgstore) – Combine svg files into one with <symbol> elements.

crossdomain.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
3+
<cross-domain-policy>
4+
5+
6+
<!-- Read this: www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
7+
8+
<!-- Most restrictive policy: -->
9+
<site-control permitted-cross-domain-policies="none"/>
10+
11+
12+
13+
<!-- Least restrictive policy: -->
14+
<!--
15+
<site-control permitted-cross-domain-policies="all"/>
16+
<allow-access-from domain="*" to-ports="*" secure="false"/>
17+
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
18+
-->
19+
<!--
20+
If you host a crossdomain.xml file with allow-access-from domain="*"
21+
and don’t understand all of the points described here, you probably
22+
have a nasty security vulnerability. ~ simon willison
23+
-->
24+
25+
</cross-domain-policy>

gh-pages.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
yarn build
3+
cp ./CNAME ./dist/CNAME
4+
cp ./humans.txt ./dist/humans.txt
5+
cp ./crossdomain.xml ./dist/crossdomain.xml
6+
cp ./README.md ./dist/README.md
7+
git subtree push --prefix dist origin master

gulpfile.js

+224
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
const assemble = require('fabricator-assemble');
2+
const autoprefixer = require('gulp-autoprefixer');
3+
const browserSync = require('browser-sync');
4+
const cssnano = require('gulp-cssnano');
5+
const del = require('del');
6+
const gulp = require('gulp');
7+
const gulpif = require('gulp-if');
8+
const gutil = require('gulp-util');
9+
const imagemin = require('gulp-imagemin');
10+
const notifier = require('node-notifier');
11+
const runSequence = require('run-sequence');
12+
const sass = require('gulp-sass');
13+
const sourcemaps = require('gulp-sourcemaps');
14+
const webpack = require('webpack');
15+
16+
const reload = browserSync.reload;
17+
18+
// configuration
19+
const config = {
20+
templates: {
21+
src: ['src/templates/**/*', '!src/templates/layouts/**'],
22+
dest: 'dist',
23+
watch: ['src/templates/**/*', 'src/data/**/*.json'],
24+
layouts: 'src/templates/layouts/*',
25+
partials: ['src/templates/components/**/*'],
26+
data: 'src/data/**/*.{json,yml}',
27+
},
28+
scripts: {
29+
src: './src/assets/scripts/main.js',
30+
dest: 'dist/assets/scripts',
31+
watch: 'src/assets/scripts/**/*',
32+
},
33+
styles: {
34+
src: 'src/assets/styles/main.scss',
35+
dest: 'dist/assets/styles',
36+
watch: 'src/assets/styles/**/*',
37+
browsers: ['last 1 version'],
38+
},
39+
images: {
40+
src: 'src/assets/images/**/*',
41+
dest: 'dist/assets/images',
42+
watch: 'src/assets/images/**/*',
43+
},
44+
fonts: {
45+
src: 'src/assets/fonts/**/*',
46+
dest: 'dist/assets/fonts',
47+
watch: 'src/assets/fonts/**/*',
48+
},
49+
data: {
50+
src: 'src/data/**/*',
51+
watch: 'src/data/**/*',
52+
},
53+
dev: gutil.env.dev,
54+
};
55+
56+
// clean
57+
gulp.task('clean', del.bind(null, ['dist']));
58+
59+
// templates
60+
gulp.task('templates', (done) => {
61+
assemble({
62+
layouts: config.templates.layouts,
63+
views: config.templates.src,
64+
materials: config.templates.partials,
65+
data: config.templates.data,
66+
keys: {
67+
views: 'templates',
68+
materials: 'components',
69+
},
70+
dest: config.templates.dest,
71+
logErrors: config.dev,
72+
helpers: {
73+
// {{ default description "string of content used if description var is undefined" }}
74+
default: function defaultFn(...args) {
75+
return args.find(value => !!value);
76+
},
77+
// {{ concat str1 "string 2" }}
78+
concat: function concat(...args) {
79+
return args.slice(0, args.length - 1).join('');
80+
},
81+
// {{> (dynamicPartial name) }} ---- name = 'nameOfComponent'
82+
dynamicPartial: function dynamicPartial(name) {
83+
return name;
84+
},
85+
eq: function eq(v1, v2) {
86+
return v1 === v2;
87+
},
88+
ne: function ne(v1, v2) {
89+
return v1 !== v2;
90+
},
91+
and: function and(v1, v2) {
92+
return v1 && v2;
93+
},
94+
or: function or(v1, v2) {
95+
return v1 || v2;
96+
},
97+
not: function not(v1) {
98+
return !v1;
99+
},
100+
gte: function gte(a, b) {
101+
return +a >= +b;
102+
},
103+
lte: function lte(a, b) {
104+
return +a <= +b;
105+
},
106+
plus: function plus(a, b) {
107+
return +a + +b;
108+
},
109+
minus: function minus(a, b) {
110+
return +a - +b;
111+
},
112+
divide: function divide(a, b) {
113+
return +a / +b;
114+
},
115+
multiply: function multiply(a, b) {
116+
return +a * +b;
117+
},
118+
abs: function abs(a) {
119+
return Math.abs(a);
120+
},
121+
mod: function mod(a, b) {
122+
return +a % +b;
123+
},
124+
},
125+
});
126+
done();
127+
});
128+
129+
// scripts
130+
const webpackConfig = require('./webpack.config')(config);
131+
132+
gulp.task('scripts', (done) => {
133+
webpack(webpackConfig, (err, stats) => {
134+
if (err) {
135+
gutil.log(gutil.colors.red(err()));
136+
}
137+
const result = stats.toJson();
138+
if (result.errors.length) {
139+
result.errors.forEach((error) => {
140+
gutil.log(gutil.colors.red(error));
141+
notifier.notify({
142+
title: 'JS Build Error',
143+
message: error,
144+
});
145+
});
146+
}
147+
done();
148+
});
149+
});
150+
151+
// SASS styles
152+
gulp.task('styles', () =>
153+
gulp.src(config.styles.src)
154+
.pipe(sourcemaps.init())
155+
.pipe(sass({
156+
includePaths: './node_modules',
157+
}).on('error', sass.logError))
158+
.pipe(autoprefixer({
159+
browsers: config.styles.browsers,
160+
}))
161+
.pipe(gulpif(!config.dev, cssnano({ autoprefixer: false })))
162+
.pipe(sourcemaps.write())
163+
.pipe(gulp.dest(config.styles.dest))
164+
.pipe(gulpif(config.dev, reload({ stream: true }))));
165+
166+
// images
167+
gulp.task('images', () =>
168+
gulp.src(config.images.src)
169+
.pipe(imagemin({
170+
progressive: true,
171+
interlaced: true,
172+
}))
173+
.pipe(gulp.dest(config.images.dest)));
174+
175+
// fonts
176+
gulp.task('fonts', () =>
177+
gulp.src(config.fonts.src).pipe(gulp.dest(config.fonts.dest)));
178+
179+
// data
180+
gulp.task('data', () =>
181+
gulp.src(config.data.src))
182+
183+
// server
184+
gulp.task('serve', () => {
185+
browserSync({
186+
server: {
187+
baseDir: config.templates.dest,
188+
},
189+
notify: false,
190+
logPrefix: 'BrowserSync',
191+
});
192+
193+
gulp.task('templates:watch', ['templates'], reload);
194+
gulp.watch(config.templates.watch, ['templates:watch']);
195+
gulp.task('styles:watch', ['styles']);
196+
gulp.watch(config.styles.watch, ['styles:watch']);
197+
gulp.task('scripts:watch', ['scripts'], reload);
198+
gulp.watch(config.scripts.watch, ['scripts:watch']);
199+
gulp.task('images:watch', ['images'], reload);
200+
gulp.watch(config.images.watch, ['images:watch']);
201+
gulp.task('fonts:watch', ['fonts'], reload);
202+
gulp.watch(config.fonts.watch, ['fonts:watch']);
203+
gulp.task('data:watch', ['templates'], reload);
204+
gulp.watch(config.data.watch, ['data:watch']);
205+
});
206+
207+
// default build task
208+
gulp.task('default', ['clean'], () => {
209+
const tasks = [
210+
'templates',
211+
'scripts',
212+
'styles',
213+
'images',
214+
'fonts',
215+
'data',
216+
];
217+
218+
// run build
219+
runSequence(tasks, () => {
220+
if (config.dev) {
221+
gulp.start('serve');
222+
}
223+
});
224+
});

0 commit comments

Comments
 (0)