Skip to content

Commit

Permalink
categorized new components so they get imported
Browse files Browse the repository at this point in the history
  • Loading branch information
pbakaus committed Aug 23, 2018
1 parent b9e99d2 commit f3efdf3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions scripts/component_categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"amp-pixel": "ads-analytics",
"amp-auto-ads": "ads-analytics",
"amp-sticky-ad": "ads-analytics",
"amp-share-tracking": "ads-analytics",

"amp-access-laterpay": "dynamic-content",
"amp-access": "dynamic-content",
Expand All @@ -24,6 +25,8 @@
"amp-mustache": "dynamic-content",
"amp-next-page": "dynamic-content",
"amp-selector": "dynamic-content",
"amp-subscriptions": "dynamic-content",
"amp-subscriptions-google": "dynamic-content",
"amp-user-notification": "dynamic-content",
"amp-sortable-table": "dynamic-content",
"amp-web-push": "dynamic-content",
Expand All @@ -35,6 +38,7 @@
"amp-fx-collection": "layout",
"amp-iframe": "layout",
"amp-image-lightbox": "layout",
"amp-image-slider": "layout",
"amp-layout": "layout",
"amp-lightbox": "layout",
"amp-lightbox-gallery": "layout",
Expand Down Expand Up @@ -68,7 +72,9 @@
"amp-soundcloud": "media",
"amp-springboard-player": "media",
"amp-video": "media",
"amp-video-iframe": "media",
"amp-vimeo": "media",
"amp-viqeo-player": "media",
"amp-wistia-player": "media",
"amp-yotpo": "media",
"amp-youtube": "media",
Expand Down
7 changes: 3 additions & 4 deletions scripts/import_docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ function getDependencies(content) {
// find all used amp tags in the page
.match(/<amp-((?!img[\/\s>])[^>\s]+)[^>]*>/g);

console.log("Dependencies: " + dependencies);
if (dependencies) {
return Array.from(new Set(dependencies.map(item => item.match(/<amp-((?!img[\/\s>])[^>\s]+)[^>]*>/)[1])));
}
Expand Down Expand Up @@ -144,7 +143,7 @@ importData.forEach((item) => {
group: (item.group ? item.group : '')
}, function (err) {
if (err) throw err;
console.log('Successfully imported: ' + item.title);
//console.log('Successfully imported: ' + item.title);
});
}, 1);

Expand Down Expand Up @@ -180,7 +179,7 @@ ghrepo.contents('builtins', 'master', function(err, data) {
title: component.name.replace('.md', '') + ' (Built-in)'
}, function (err) {
if (err) throw err;
console.log('Successfully imported: ' + component.name + ' (Built-in)');
//console.log('Successfully imported: ' + component.name + ' (Built-in)');
});
}, 1);

Expand Down Expand Up @@ -239,7 +238,7 @@ ghrepo.contents('extensions', "master", function(err, data) {
title: title || subComponent.name.replace('.md', '')
}, function (err) {
if (err) throw err;
console.log('Successfully imported: ' + subComponent.name + ' (Extended)');
//console.log('Successfully imported: ' + subComponent.name + ' (Extended)');
});
}, 1);

Expand Down

0 comments on commit f3efdf3

Please sign in to comment.