Skip to content

Commit 64ea200

Browse files
Merge pull request #175 from rileyajones/add-bento-components-dir
Update build paths to include src/bento/components
2 parents d3ca1a7 + f4d22ad commit 64ea200

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

gulpfile.js/importDocs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const markdownItAnchor = require('markdown-it-anchor');
88
const {split} = require('sentence-splitter');
99

1010
const EXTENSIONS_SRC = path.resolve(__dirname, '..', 'amphtml/extensions');
11+
const COMPONENTS_SRC = path.resolve(__dirname, '..', 'amphtml/src/bento/components');
1112
const COMPONENTS_DEST = path.resolve(__dirname, '..', 'site/en/components');
1213
const IGNORED_COMPONENTS = new Set(['bento-iframe']);
1314
const md = markdownIt({
@@ -146,7 +147,10 @@ function _parseComponentName(content) {
146147
}
147148

148149
async function importComponents() {
149-
const filePaths = await fg(path.join(EXTENSIONS_SRC, '**/1.0/README.md'));
150+
const filePaths = await fg([
151+
path.join(EXTENSIONS_SRC, '**/1.0/README.md'),
152+
path.join(COMPONENTS_SRC, '**/1.0/README.md'),
153+
]);
150154
if (!filePaths.length) {
151155
console.error(
152156
chalk.dim('[Import components]'),

gulpfile.js/importHeroExamples.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ const fg = require('fast-glob');
44
const chalk = require('chalk');
55

66
const EXTENSIONS_SRC = path.resolve(__dirname, '..', 'amphtml/extensions');
7+
const COMPONENTS_SRC = path.resolve(__dirname, '..', 'amphtml/src/bento/components');
78
const EXAMPLES_DEST = path.resolve(
89
__dirname,
910
'..',
1011
'assets/iframes/hero-examples'
1112
);
12-
const PATH_COMPONENT_NAME_PATTERN = /amphtml\/extensions\/(.*?)\//m;
13+
const PATH_COMPONENT_NAME_PATTERN = /amphtml\/(?:extensions)|(?:src\/bento\/components)\/(.*?)\//m;
1314

1415
async function importHeroExamples() {
15-
const filePaths = await fg(path.join(EXTENSIONS_SRC, '**/1.0/example/**/*'));
16+
const filePaths = await fg([
17+
path.join(EXTENSIONS_SRC, '**/1.0/example/**/*'),
18+
path.join(COMPONENTS_SRC, '**/1.0/example/**/*'),
19+
]);
1620
if (!filePaths.length) {
1721
console.error(
1822
chalk.dim('[Import hero examples]'),

0 commit comments

Comments
 (0)