Skip to content

Commit 4059e78

Browse files
retrieve component creation time using git API
1 parent 4b787bb commit 4059e78

13 files changed

+6408
-585
lines changed

build.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const componentsBuildScreenshots = require('./src/components-build-screenshots')
2222
// See src/components-build-defaults for list of options that can be overriden
2323
const options = {
2424
components: {
25-
globPattern: 'src/components/banners/*.html',
25+
globPattern: 'src/components/article-lists/*.html',
2626
// frontMatter: {
2727
// bodyClass: 'bg-red',
2828
// screenshot: {
@@ -48,7 +48,7 @@ const options = {
4848
co(function* generator() {
4949
yield componentsBuildIndex(options); // <- builds component index page and JSON index
5050
yield componentsBuildPages(options); // <- comment to skip building pages
51-
yield componentsBuildScreenshots(options); // <- comment to skip building screenshots
51+
// yield componentsBuildScreenshots(options); // <- comment to skip building screenshots
5252
}).then(() => {
5353
const elapsed = process.hrtime(startTime);
5454
console.log(chalk.green('All done'), chalk.dim(prettyHrtime(elapsed)));

package.json

+17-20
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,7 @@
3636
"url": "https://github.com/tachyons-css/tachyons-css.github.io/issues"
3737
},
3838
"dependencies": {
39-
"chalk": "^1.1.3",
40-
"co": "^4.6.0",
41-
"express": "^4.14.0",
42-
"filesize": "^3.3.0",
43-
"imagemin": "^5.2.2",
44-
"imagemin-mozjpeg": "^6.0.0",
45-
"jimp": "^0.2.27",
46-
"lazysizes": "^3.0.0-rc2",
47-
"nightmare": "^2.8.1",
48-
"pretty-hrtime": "^1.0.3",
39+
"tachyons": "^4.5.4",
4940
"tachyons-background-size": "^5.0.3",
5041
"tachyons-base": "^1.2.5",
5142
"tachyons-border-colors": "^4.2.2",
@@ -62,7 +53,7 @@
6253
"tachyons-debug": "^1.1.7",
6354
"tachyons-debug-grid": "^1.2.0",
6455
"tachyons-display": "^5.0.1",
65-
"tachyons-flexbox": "^2.0.0",
56+
"tachyons-flexbox": "^2.0.4",
6657
"tachyons-floats": "^3.0.1",
6758
"tachyons-font-family": "^4.3.0",
6859
"tachyons-font-style": "^4.0.1",
@@ -76,11 +67,14 @@
7667
"tachyons-links": "^3.0.6",
7768
"tachyons-lists": "^2.0.9",
7869
"tachyons-max-widths": "^4.0.1",
70+
"tachyons-modules": "^1.1.8",
7971
"tachyons-opacity": "^1.1.5",
8072
"tachyons-outlines": "^1.0.0",
8173
"tachyons-overflow": "^4.0.1",
8274
"tachyons-position": "^6.0.1",
75+
"tachyons-queries": "^0.3.1",
8376
"tachyons-skins": "^4.0.0",
77+
"tachyons-skins-pseudo": "^1.0.1",
8478
"tachyons-spacing": "^6.0.1",
8579
"tachyons-tables": "^1.0.4",
8680
"tachyons-text-align": "^3.0.1",
@@ -94,31 +88,39 @@
9488
"tachyons-white-space": "^4.0.1",
9589
"tachyons-widths": "^5.0.1",
9690
"tachyons-word-break": "3.0.1",
97-
"tachyons-z-index": "^1.0.4",
98-
"tmp": "0.0.31"
91+
"tachyons-z-index": "^1.0.4"
9992
},
10093
"devDependencies": {
10194
"autoprefixer": "^6.5.1",
10295
"browser-sync": "^2.17.5",
10396
"camelize": "^1.0.0",
97+
"chalk": "^1.1.3",
98+
"co": "^4.6.0",
10499
"color": "^0.11.3",
105100
"colorable": "^1.0.5",
106101
"css": "^2.2.1",
107102
"css-mqpacker": "^5.0.1",
108103
"css-parse": "^2.0.0",
109104
"cssstats": "^3.0.0-beta.2",
110105
"escape-html": "^1.0.3",
106+
"express": "^4.14.0",
111107
"filesize": "^3.3.0",
112108
"get-classes-from-html": "^1.0.1",
113109
"glob": "^7.1.1",
114110
"gzip-size": "^3.0.0",
111+
"imagemin": "^5.2.2",
112+
"imagemin-mozjpeg": "^6.0.0",
115113
"immutable-css": "^1.1.2",
116114
"is-blank": "^1.1.0",
117115
"is-css-root": "^1.0.1",
116+
"jimp": "^0.2.27",
118117
"json-front-matter": "^1.0.0",
118+
"lazysizes": "^3.0.0-rc2",
119119
"lodash": "^4.16.6",
120120
"mkdirp": "^0.5.1",
121+
"nightmare": "^2.8.1",
121122
"node-minify": "^1.3.9",
123+
"nodegit": "^0.16.0",
122124
"normalize": "^0.3.1",
123125
"perfectionist": "^2.3.1",
124126
"pixrem": "^3.0.2",
@@ -132,16 +134,11 @@
132134
"postcss-discard-empty": "^2.1.0",
133135
"postcss-import": "^8.1.2",
134136
"postcss-select": "^2.1.0",
137+
"pretty-hrtime": "^1.0.3",
135138
"remove-html-extension": "0.0.1",
136139
"s3": "^4.4.0",
137-
"tachyons": "^4.5.4",
138-
"tachyons-cli": "^1.0.9",
139-
"tachyons-debug-grid": "^1.2.0",
140-
"tachyons-flexbox": "^2.0.1",
141-
"tachyons-modules": "^1.1.8",
142-
"tachyons-queries": "^0.3.1",
143-
"tachyons-skins-pseudo": "^1.0.1",
144140
"titleize": "^1.0.0",
141+
"tmp": "0.0.31",
145142
"watch": "^1.0.1"
146143
},
147144
"contributors": [

src/components-build-defaults.js

+39-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,51 @@
1+
const titleize = require('titleize');
2+
3+
const cleanTitleize = str => titleize(str.replace(/(_|-)/g, ' '));
4+
15
module.exports = {
26
// Components
37
components: {
4-
globPattern: 'src/components/**/*.html', // source components to process
5-
forNavPath: 'tmp/componentsForNav.json', // temporary file built by the index
6-
indexPath: 'components/index.html', // target location of components index
7-
buildPages: true, // false to skip building pages
8-
buildScreenshots: true, // false to skip building screenshots
9-
frontMatter: { // font matter defaults (i.e. optional)
10-
name: undefined, // undefined to infer component name
11-
title: undefined, // undefined to infer component title
12-
bodyClass: 'bg-white', // class to apply on <body>
13-
screenshot: { // per-component screenshot options
14-
selector: '[data-name="component"]', // DOM element to capture
15-
autocrop: true, // autocrop the capture
16-
'background-position': 'center center', // CSS background position
17-
'background-size': 'cover', // CSS background size ('cover', 'contain', 'auto')
8+
globPattern: 'src/components/**/*.html', // source components to process
9+
indexByCategory: {
10+
path: 'components/index.html', // target location of index by category
11+
json: 'tmp/componentsByCategory.json', // temporary JSON file built by the index
12+
},
13+
build: {
14+
pages: true, // false to skip building pages
15+
screenshots: true, // false to skip building screenshots
16+
},
17+
prettify: {
18+
id: cleanTitleize, // prettify component id into component name
19+
category: cleanTitleize, // prettify component category
20+
title: (category, name) => `${category} | ${name}`, // compose title from category and name
21+
},
22+
frontMatter: { // font matter defaults (i.e. optional)
23+
name: undefined, // undefined to infer component name
24+
title: undefined, // undefined to infer component title
25+
category: undefined, // undefined to infer component category
26+
bodyClass: 'bg-white', // class to apply on <body>
27+
screenshot: { // per-component screenshot options
28+
selector: '[data-name="component"]', // DOM element to capture
29+
autocrop: true, // autocrop the capture
30+
'background-position': 'center center', // CSS bg position
31+
'background-size': 'cover', // CSS bg size ('cover', 'contain', 'auto')
1832
},
1933
},
2034
},
2135
// Screenshot options
2236
// (components only for now, but could apply to other areas for consistency)
2337
screenshot: {
24-
basename: 'screenshot.jpg', // name of *JPEG* screenshot
25-
aspectRatio: '4x3', // Tachyons aspect ratio of screenshots
26-
viewportWidth: 1024, // viewport width used for capture
27-
viewportHeight: 768, // viewport height used for capture
28-
targetMinWidth: 400, // min width of target (final) screenshot
29-
targetMinHeight: 160, // min height of target (final) screenshot
30-
mozjpegQuality: 90, // mozjpeg optimizer quality (default 75)
38+
basename: 'screenshot.jpg', // name of *JPEG* screenshot
39+
aspectRatio: '4x3', // Tachyons aspect ratio of screenshots
40+
viewport: {
41+
width: 1024, // viewport width used for capture
42+
height: 768, // viewport height used for capture
43+
},
44+
target: {
45+
minWidth: 400, // min width of target (final) screenshot
46+
minHeight: 160, // min height of target (final) screenshot
47+
},
48+
mozjpegQuality: 90, // mozjpeg optimizer quality (default 75)
3149
},
3250
// Misc
3351
tachyonsCssPath: 'src/css/tachyons.css',

0 commit comments

Comments
 (0)