Skip to content

Commit 639e19f

Browse files
committed
🎨 add export
1 parent 5da95e7 commit 639e19f

File tree

9 files changed

+63
-19
lines changed

9 files changed

+63
-19
lines changed

Diff for: ‎Makefile

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
deploy:
22
surge build huebee.buzz
33

4-
gulp:
5-
gulp
4+
zip:
5+
rm -rf build/huebee-docs.zip
6+
cp -r build huebee-docs
7+
zip -rq build/huebee-docs.zip huebee-docs/
8+
rm -rf huebee-docs
69

710
reset:
811
rm -rf build/
912

10-
prod: reset gulp deploy
13+
gulp:
14+
gulp
15+
16+
gulp-export: reset
17+
gulp export
18+
make zip
19+
20+
prod: gulp-export gulp deploy

Diff for: ‎content/index.hbs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ description: One-click color picker. Huebee displays a limited set of colors so
2121
<li>
2222
CSS:
2323
<ul>
24-
<li><a href="https://unpkg.com/huebee@1/dist/huebee.min.css">huebee.min.css</a> minified, or</li>
25-
<li><a href="https://unpkg.com/huebee@1/dist/huebee.css">huebee.css</a> un-minified</li>
24+
<li><a href="{{sourceUrlPath}}huebee.min.css">huebee.min.css</a> minified, or</li>
25+
<li><a href="{{sourceUrlPath}}huebee.css">huebee.css</a> un-minified</li>
2626
</ul>
2727
</li>
2828
<li>
2929
JavaScript:
3030
<ul>
31-
<li><a href="https://unpkg.com/huebee@1/dist/huebee.pkgd.min.js">huebee.pkgd.min.js</a> minified, or</li>
32-
<li><a href="https://unpkg.com/huebee@1/dist/huebee.pkgd.js">huebee.pkgd.js</a> un-minified</li>
31+
<li><a href="{{sourceUrlPath}}huebee.pkgd.min.js">huebee.pkgd.min.js</a> minified, or</li>
32+
<li><a href="{{sourceUrlPath}}huebee.pkgd.js">huebee.pkgd.js</a> un-minified</li>
3333
</ul>
3434
</li>
3535
</ul>

Diff for: ‎css/base.css

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
* { box-sizing: border-box; }
22

33
/* rem font sizing */
4-
html {
5-
font-size: 17px;
6-
}
4+
html { font-size: 17px; }
5+
html.export { font-size: 14px; }
76

87
/* font */
98
body, input, button {
10-
font-family: Texta, sans-serif;
9+
font-family: Texta, Avenir Next, sans-serif;
1110
}
1211

1312
body {
@@ -66,9 +65,8 @@ pre code {
6665

6766

6867
@media screen and ( min-width: 768px ) {
69-
html {
70-
font-size: 19px;
71-
}
68+
html { font-size: 19px; }
69+
html.export { font-size: 16px; }
7270

7371
pre, code, kbd { font-size: 15px; }
7472

Diff for: ‎gulpfile.js

+17
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ var data = {
1616
'#FFF',
1717
],
1818
isDev: process.argv[2] == 'dev',
19+
isExport: process.argv[2] == 'export',
1920
};
2021

22+
data.sourceUrlPath = data.isExport ? '' : 'https://unpkg.com/huebee@1/dist/';
23+
2124
// files that will be watched, tasks that will be run
2225
var watchables = [];
2326

@@ -32,16 +35,30 @@ require('./tasks/css')( data, watch );
3235
require('./tasks/js')( data, watch );
3336
require('./tasks/content')( data, watch );
3437
require('./tasks/cache-bust')( data, watch );
38+
require('./tasks/dist')( data, watch );
3539

3640
// ----- ----- //
3741

3842
gulp.task( 'default', [
3943
'assets',
44+
'dist',
45+
'css',
46+
'js',
47+
'content',
48+
]);
49+
50+
// ----- export ----- //
51+
52+
// version of site used in huebee-docs.zip
53+
gulp.task( 'export', [
54+
'dist',
4055
'css',
4156
'js',
4257
'content',
4358
]);
4459

60+
// ----- dev ----- //
61+
4562
gulp.task( 'dev', [ 'assets', 'content' ], function() {
4663
watchables.forEach( function( watchable ) {
4764
gulp.watch.apply( gulp, watchable );

Diff for: ‎layouts/page.hbs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en">
2+
<html lang="en" class="{{#if isExport}}export{{/if}}">
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width" />
@@ -16,7 +16,9 @@
1616

1717
{{> palette-styles}}
1818

19-
{{> head-meta}}
19+
{{#unless isExport}}
20+
{{> head-meta}}
21+
{{/unless}}
2022

2123
</head>
2224
<body class="page--{{@file.basename}} color4-text color5-bg">
@@ -46,7 +48,7 @@
4648
<script src="{{page.rootPath}}js/huebee-docs.min.js?{{cacheVersions.js}}"></script>
4749
{{/if}}
4850

49-
{{#unless isDev}}
51+
{{#unless isExport}}
5052
<script>
5153
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
5254
ga('create','UA-58739927-6','auto');ga('send','pageview')

Diff for: ‎modules/big-buttons/big-buttons.hbs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div class="big-buttons-container">
2-
<a class="big-button big-button--fill color0-bg color5-text color3-bg-hover color5-text-hover" href="#">
2+
<a class="big-button big-button--fill color0-bg color5-text color3-bg-hover color5-text-hover"
3+
href="{{sourceUrlPath}}huebee.pkgd.min.js">
34
<span class="big-button__plain-text">Download</span>
45
<b class="big-button__strong-text">huebee.pkgd.min.js</b>
56
</a>
6-
<a class="big-button big-button--fill color0-bg color5-text color3-bg-hover color5-text-hover" href="#">
7+
<a class="big-button big-button--fill color0-bg color5-text color3-bg-hover color5-text-hover"
8+
href="{{sourceUrlPath}}huebee.css">
79
<span class="big-button__plain-text">Download</span>
810
<b class="big-button__strong-text">huebee.css</b>
911
</a>

Diff for: ‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"glob": "^7.1.1",
1414
"gulp": "^3.9.1",
1515
"gulp-concat": "^2.6.1",
16+
"gulp-filter": "^4.0.0",
1617
"gulp-front-matter": "^1.3.0",
1718
"gulp-hb": "^5.1.4",
1819
"gulp-rename": "^1.2.2",

Diff for: ‎tasks/content.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var gulp = require('gulp');
22
var hbLayouts = require('handlebars-layouts');
33
var frontMatter = require('gulp-front-matter');
4+
var filter = require('gulp-filter');
45
var path = require('path');
56
var handlebars = require('gulp-hb');
67
var rename = require('gulp-rename');
@@ -30,7 +31,11 @@ var partialsSrc = 'modules/**/*/*.hbs';
3031
module.exports = function( data, watch ) {
3132

3233
gulp.task( 'content', function() {
34+
// exclude 404 if export
35+
var filterQuery = data.isExport ? [ '**', '!**/404.*'] : '**';
36+
3337
gulp.src( contentSrc )
38+
.pipe( filter( filterQuery ) )
3439
.pipe( frontMatter({
3540
property: 'data.page',
3641
remove: true

Diff for: ‎tasks/dist.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
var gulp = require('gulp');
2+
3+
// copy packery dist to build/
4+
gulp.task( 'dist', function() {
5+
gulp.src( 'bower_components/huebee/dist/*.*' )
6+
.pipe( gulp.dest('build') );
7+
});
8+
9+
module.exports = function() {};

0 commit comments

Comments
 (0)