File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,10 @@ function replaceTokens(html) {
240
240
async function processComponent ( url , component ) {
241
241
const title = component . name
242
242
const filename = cleanFilename ( title )
243
- const path = `${ url } /${ filename } `
243
+
244
+ // Remove the rootUrl from the url to get the local path
245
+ const localOutput = url . replace ( 'https://tailwindui.com' , '' )
246
+ const path = `${ localOutput } /${ filename } `
244
247
245
248
// output snippets by language
246
249
component . snippets . forEach ( ( snippet ) => {
@@ -439,7 +442,9 @@ function debugLog(...args) {
439
442
debugLog ( `📣 ${ i + 1 } : ${ url } ` )
440
443
if ( ! url || ! url . match ( / \/ c o m p o n e n t s \/ / ) ) continue
441
444
// check if component is in list of components to save
442
- const component = url . split ( '/' ) [ 2 ]
445
+ // Example URL: https://tailwindui.com/components/application-ui/navigation/navbars
446
+ // Parse out "application-ui" | "marketing" | "ecommerce" from the URL to ensure we only download the components we want
447
+ const component = url . split ( '/' ) [ 4 ]
443
448
if (
444
449
component &&
445
450
components [ 0 ] !== 'all' &&
You can’t perform that action at this time.
0 commit comments