Skip to content

Commit

Permalink
Tweaking, cleaning, configging.
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonmoeller committed Jul 5, 2015
1 parent a48c9be commit ebf7986
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 61 deletions.
20 changes: 20 additions & 0 deletions .config/togafile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

var toga = require('toga'),
css = require('toga-css'),
md = require('toga-markdown'),
sample = require('toga-sample'),
pura = require('toga-pura'),

config = {
src: './src/assets/**/*.css',
dest: './dist/docs'
};

toga
.src(config.src)
.pipe(css.parser())
.pipe(md.formatter())
.pipe(sample.formatter())
.pipe(pura.compiler())
.pipe(toga.dest(config.dest));
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ indent_style = space

[*.md]
indent_style = space

[.*rc]
indent_size = 2
indent_style = space
10 changes: 6 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"parser": "babel-eslint",

"env": {
"amd": false,
"browser": false,
Expand Down Expand Up @@ -40,7 +42,7 @@
"rules": {
// Possible Errors
"comma-dangle": [2, "never"], // disallow or enforce trailing commas
"no-cond-assign": "except-parens", // disallow assignment in conditional expressions
"no-cond-assign": [2, "except-parens"], // disallow assignment in conditional expressions
"no-console": 0, // disallow use of console (off by default in the node environment)
"no-constant-condition": 2, // disallow use of constant expressions in conditions
"no-control-regex": 2, // disallow control characters in regular expressions
Expand Down Expand Up @@ -131,7 +133,7 @@
"yoda": 0, // require or disallow Yoda conditions

// Strict mode
"strict": "global", // controls location of Use Strict Directives
"strict": [1, "global"], // controls location of Use Strict Directives

// Variables
"no-catch-shadow": 2, // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)
Expand All @@ -153,7 +155,7 @@
"no-mixed-requires": 0, // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)
"no-new-require": 2, // disallow use of new operator with the require function (off by default) (on by default in the node environment)
"no-path-concat": 2, // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)
"no-process-exit": 2, // disallow process.exit() (on by default in the node environment)
"no-process-exit": 0, // disallow process.exit() (on by default in the node environment)
"no-restricted-modules": 0, // restrict usage of specified node modules (off by default)
"no-sync": 0, // disallow use of synchronous methods (off by default)

Expand Down Expand Up @@ -217,7 +219,7 @@
}],
"space-in-brackets": 0, /* need v1.0 */ // require or disallow spaces inside brackets (off by default)
"space-in-parens": [2, "never"], // require or disallow spaces inside parentheses (off by default)
"space-infix-ops": [2, "always"], // require spaces around operators
"space-infix-ops": 2, // require spaces around operators
"space-return-throw-case": 2, // require a space after return, throw, and case
"space-unary-ops": [1, { // Require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
"words": true,
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@

coverage/
docs/
dist/
node_modules/
test/actual/
web/

*.log
.*.swp
.DS_Store
.publish

59 changes: 22 additions & 37 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,69 +1,54 @@
'use strict';

var gulp = require('gulp'),
base = { base: './src/' },
config = { isWatching: false };
config = {
src: './src',
dest: './dist',
isWatching: false
},
base = {
base: config.src
};

gulp.task('default', ['html', 'css', 'copy']);

gulp.task('deploy', ['default'], function () {
var deploy = require('gulp-gh-pages');

return gulp
.src('./web/**/*')
.pipe(deploy({
branch: 'master'
}));
});

gulp.task('html', function () {
var fm = require('gulp-front-matter'),
hb = require('gulp-hb');

return gulp
.src('./src/*.html', base)
.src(config.src + '/*.html', base)
.pipe(fm({ property: 'meta' }))
.pipe(hb())
.pipe(gulp.dest('./web/'));
.pipe(gulp.dest(config.dest));
});

gulp.task('css', function () {
var myth = require('gulp-myth');

return gulp
.src('./src/assets/css/*.css', base)
.src(config.src + '/assets/css/*.css', base)
.pipe(myth({
browsers: ['last 2 versions'],
compress: true,
source: './src/assets/css/',
source: config.src + '/assets/css/',
sourcemap: config.isWatching
}))
.pipe(gulp.dest('./web/'));
.pipe(gulp.dest(config.dest));
});

gulp.task('copy', function () {
return gulp
.src('./src/{CNAME,LICENSE,README.md,assets/img/**}', base)
.pipe(gulp.dest('./web/'));
.src(config.src + '/{CNAME,LICENSE,README.md,assets/img/**}', base)
.pipe(gulp.dest(config.dest));
});

gulp.task('watch', function () {
var watch = require('gulp-watch'),
lr = require('gulp-livereload');

config.isWatching = true;

watch('./src/**/*.html', function () {
gulp.start('html');
});

watch('./src/**/*.css', function () {
gulp.start('css');
});

watch('./src/assets/images/**/*.*', function () {
gulp.start('copy');
});
gulp.task('deploy', ['default'], function () {
var deploy = require('gulp-gh-pages');

watch('./web/**/*.*').pipe(lr());
return gulp
.src(config.dest + '/**/*')
.pipe(deploy({
branch: 'master'
}));
});
42 changes: 27 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,46 @@
"version": "0.0.1",
"private": true,
"homepage": "https://togajs.com",
"bugs": "https://github.com/togajs/togajs.github.io/issues",
"license": "MIT",
"author": "Shannon Moeller <me@shannonmoeller.com> (http://shannonmoeller.com)",
"repository": {
"type": "git",
"url": "https://github.com/togajs/togajs.github.io"
},
"dependencies": {},
"devDependencies": {
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.2.0",
"babel-istanbul": "^0.2.9",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-build": "^0.5.3",
"gulp-front-matter": "^1.2.2",
"gulp-gh-pages": "^0.5.1",
"gulp-hb": "^2.4.3",
"gulp-front-matter": "^1.2.3",
"gulp-gh-pages": "^0.5.2",
"gulp-hb": "^2.6.1",
"gulp-html-prettify": "^0.0.1",
"gulp-if": "^1.2.5",
"gulp-jscs": "^1.6.0",
"gulp-jshint": "^1.10.0",
"gulp-jshint": "^1.11.2",
"gulp-livereload": "^3.8.0",
"gulp-minify-css": "^1.1.0",
"gulp-myth": "^1.0.2",
"gulp-plumber": "^1.0.0",
"gulp-minify-css": "^1.2.0",
"gulp-myth": "^1.0.3",
"gulp-plumber": "^1.0.1",
"gulp-rework": "^1.0.3",
"gulp-sourcemaps": "^1.5.2",
"gulp-util": "^3.0.4",
"gulp-util": "^3.0.6",
"gulp-watch": "^4.2.4",
"handlebars": "^3.0.3",
"handlebars-layouts": "^2.0.2",
"jshint-stylish": "^1.0.1",
"rework-plugin-inline": "^1.0.1"
"handlebars-layouts": "^3.1.0",
"jshint-stylish": "^2.0.1",
"rework-plugin-inline": "^1.0.1",
"toga": "^0.5.1",
"toga-css": "^0.1.3",
"toga-markdown": "^0.4.1",
"toga-pura": "^0.1.2",
"toga-sample": "0.1.0-alpha"
},
"engines": {
"node": ">= 0.10"
"scripts": {
"all": "npm run build",
"build": "gulp"
}
}
52 changes: 51 additions & 1 deletion src/assets/css/base/vars.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,60 @@
/**
* # Variables
*
* Site variables.
*
* @name variables
* @parent base
*/

/**
* ## Colors
*/

/**
* Colors to use.
*
* @sample {colors.html|hidden} colors
* <div class="swatch swatch_background">Background</div>
* <div class="swatch swatch_foreground">Foreground</div>
* <div class="swatch swatch_primary">Primary</div>
* <div class="swatch swatch_primaryDark">Primary Dark</div>
* <div class="swatch swatch_accent">Accent</div>
*
* @sample {colors.css|hidden} colors
* .swatch { height: 200px; width: 200%; }
* .swatch_background { background-color: var(--color-background); }
* .swatch_foreground { background-color: var(--color-foreground); }
* .swatch_primary { background-color: var(--color-primary); }
* .swatch_primaryDark { background-color: var(--color-primaryDark); }
* .swatch_accent { background-color: var(--color-accent); }
*/
:root {
--color-background: hsl(0, 0%, 100%);
--color-foreground: hsl(0, 0%, 20%);
--color-primary: hsla(110, 60%, 70%, 0.8);
--color-primary-dark: hsla(110, 60%, 50%, 0.8);
--color-primaryDark: hsla(110, 60%, 50%, 0.8);
--color-accent: hsla(346, 70%, 60%, 0.8);
}

/**
* ## Fonts
*/

/**
* Fonts to use.
*
* @sample {fonts.html} fonts
* <div class="swatch swatch_display">Josefin Slab 700</div>
* <div class="swatch swatch_header">Josefin Slab 300</div>
* <div class="swatch swatch_text">Lato 300</div>
*
* @sample {fonts.css} fonts
* .swatch_display { font: var(--font-display-weight) 1em/1 var(--font-display); }
* .swatch_header { font: var(--font-header-weight) 1em/1 var(--font-header); }
* .swatch_text { font: var(--font-text-weight) 1em/1 var(--font-text); }
*/
:root {
--font-display: 'Josefin Slab', arial, sans-serif;
--font-display-weight: 700;
--font-header: 'Josefin Sans', arial, sans-serif;
Expand Down

0 comments on commit ebf7986

Please sign in to comment.