This repository has been archived by the owner on Jun 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
126 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
"name": "<%= slug(name).toLowerCase() %>", | ||
"version": "0.0.0", | ||
"main": "index.html", | ||
"browserify-shim": {}, | ||
"dependencies": {<% if (bootstrap4) { %> | ||
"bootstrap": "[email protected]:twbs/bootstrap.git#v4-dev",<% } else if (bootstrapSass) { %> | ||
"bootstrap-sass": "~3.3.5",<% } %> | ||
|
@@ -15,7 +16,9 @@ | |
"babel-core": "6.8.0", | ||
"babel-loader": "6.2.4", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babelify": "^7.3.0", | ||
"browser-sync": "^2.7.1", | ||
"browserify-shim": "^3.8.12", | ||
"casperjs": "^1.1.0-beta3", | ||
"chai": "^3.4.1", | ||
"contentful-metalsmith": "^0.1.0", | ||
|
@@ -76,6 +79,8 @@ | |
"stylelint": "^6.2.2", | ||
"swig": "^1.4.2", | ||
"toolbox-utils": "^0.0.2", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0", | ||
"yargs": "^4.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// You will use that file to import all your scripts | ||
// Ex: import gallery from './gallery'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
$accent-color: #f04c00; | ||
$heading-color: #fff; | ||
$text-color: #242426; | ||
$menu-bg: #28313a; | ||
$menu-fg: #e3eaf3; | ||
$accent-color: #f04c00; | ||
$heading-color: #fff; | ||
$text-color: #242426; | ||
$menu-bg: #28313a; | ||
$menu-fg: #e3eaf3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
{% extends "base.html.swig" %} | ||
|
||
{% block content %} | ||
{% set path = '../components/pages/' + title + '.html.swig' %} | ||
{% set path = '../components/pages/' + name + '.html.swig' %} | ||
<div id="page-wrapper"> | ||
{% include path %} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block javascripts %} | ||
<script> | ||
(function($){ | ||
$(document).ready(function(){ | ||
$('#page-wrapper').each(function(){ | ||
var formatted = $(this).html().replace(/---[\s\S]*?---/g, ''); | ||
$(this).html(formatted); | ||
}); | ||
}); | ||
}(jQuery)); | ||
</script> | ||
{% endblock %} |
2 changes: 1 addition & 1 deletion
2
app/templates/assets/templates/styleguide/item-content.html.swig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,93 @@ | ||
'use strict'; | ||
|
||
var gulp = require('gulp'), | ||
$ = require('gulp-load-plugins')(), | ||
config = require('../gulp_config.json'), | ||
argv = require('yargs').argv; | ||
var gulp = require('gulp'), | ||
$ = require('gulp-load-plugins')(), | ||
config = require('../gulp_config.json'), | ||
argv = require('yargs').argv, | ||
browserify = require('browserify'), | ||
babelify = require('babelify'), | ||
browserifyshim = require('browserify-shim'), | ||
source = require('vinyl-source-stream'), | ||
buffer = require('vinyl-buffer'), | ||
path = require('path'); | ||
|
||
|
||
module.exports = function() { | ||
|
||
function errorAlert(error){ | ||
if (!argv.production) { | ||
$.notify.onError({title: "JS Error", message: "Check your terminal", sound: "Sosumi"})(error); | ||
$.notify.onError({title: 'JS Error', message: 'Check your terminal', sound: 'Sosumi'})(error); | ||
$.util.log(error.messageFormatted); | ||
} | ||
this.emit("end"); | ||
this.emit('end'); | ||
}; | ||
|
||
function handleErrors() { | ||
var args = Array.prototype.slice.call(arguments); | ||
$.notify.onError({ | ||
title: 'Compile Error', | ||
message: '<%= error.message %>' | ||
}).apply(this, args); | ||
this.emit('end'); | ||
} | ||
|
||
/** | ||
* Build JS | ||
* With error reporting on compiling (so that there's no crash) | ||
* And jshint check to highlight errors as we go. | ||
*/ | ||
gulp.task('scripts', function() { | ||
return gulp.src(config.assets + 'js/*.js') | ||
gulp.task('scripts', ['scripts-lint'], function() { | ||
if (argv.local) { | ||
return browserify( | ||
{ | ||
entries: ['./' + config.assets + 'js/index.js'], | ||
debug: true | ||
}) | ||
.transform(babelify.configure({ | ||
presets: ['es2015'], | ||
sourceMaps: true | ||
})) | ||
.bundle() | ||
.on('error', handleErrors) | ||
.pipe(source('bundle.js')) | ||
.pipe(buffer()) | ||
.pipe($.sourcemaps.init({loadMaps: true})) | ||
.pipe($.if(argv.production, $.uglify())) | ||
.on('error', handleErrors) | ||
.pipe(argv.production ? $.util.noop() : $.sourcemaps.write('./')) | ||
.pipe(gulp.dest(config.build)); | ||
} else { | ||
return browserify( | ||
{ | ||
entries: ['./' + config.assets + 'js/index.js'], | ||
debug: true | ||
}) | ||
.transform(babelify.configure({ | ||
presets: ['es2015'], | ||
sourceMaps: true | ||
})) | ||
.transform(browserifyshim) | ||
.bundle() | ||
.on('error', handleErrors) | ||
.pipe(source('bundle.js')) | ||
.pipe(buffer()) | ||
.pipe($.sourcemaps.init({loadMaps: true})) | ||
.pipe($.if(argv.production, $.uglify())) | ||
.on('error', handleErrors) | ||
.pipe(argv.production ? $.util.noop() : $.sourcemaps.write('./')) | ||
.pipe($.size({title: 'BUNDLE SIZE', showFiles: true})) | ||
.pipe(gulp.dest(config.build)); | ||
} | ||
}); | ||
|
||
/** | ||
* Lint JS | ||
*/ | ||
gulp.task('scripts-lint', function() { | ||
return gulp.src(config.assets + '**/*.{js,jsx}') | ||
.pipe($.plumber({errorHandler: errorAlert})) | ||
.pipe($.eslint()) | ||
.pipe($.eslint.format()) | ||
.pipe($.babel({presets: ['es2015']})) | ||
.pipe($.concat('main.js')) | ||
.pipe($.if(argv.production, $.uglify())) | ||
.pipe($.size({title: 'JS SCRIPTS', showFiles: true})) | ||
.pipe(gulp.dest(config.build + 'js')); | ||
.pipe($.eslint.format()); | ||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters