Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Iterating over files in GitHub in svelte [duplicate]

$
0
0

I need to list all dirs under this here github repo, and iterate over them, but I can't find the right way to do it in svelte, other than by just manually typing all the URLs in the code. Is there a better way for this matter?

I saw this answer that uses the import.meta.glob() module to list local files / dirs. I tried using the root URL with this command like:

const imageDirs = import.meta.glob("/https://raw.githubusercontent.com/lieldvd/mturk/main/*.jpg");

Below the code which is intended to pull the directories from GitHub:

<script lang="ts">    let currentIndex = 0;    const imageDirs = import.meta.glob("/https://raw.githubusercontent.com/lieldvd/mturk/main/*.jpg");</script><main>    {#each imageDirs as imgDir}<div>imgDir</div>    {/each}</main>

My app may be cloned here.


Viewing all articles
Browse latest Browse all 1541

Trending Articles