{"id":15286226,"url":"https://github.com/lyonsyonii/astro-preload","last_synced_at":"2025-04-13T03:09:54.143Z","repository":{"id":173994138,"uuid":"651617937","full_name":"LyonSyonII/astro-preload","owner":"LyonSyonII","description":"Download images at build time! Supports Iconify icons and arbitrary images.","archived":false,"fork":false,"pushed_at":"2023-10-19T08:28:07.000Z","size":350,"stargazers_count":32,"open_issues_count":10,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T03:09:47.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Astro","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LyonSyonII.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-09T16:39:13.000Z","updated_at":"2025-01-22T22:48:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8e816b7-f78b-4b8e-b039-7d42961b3461","html_url":"https://github.com/LyonSyonII/astro-preload","commit_stats":{"total_commits":34,"total_committers":6,"mean_commits":5.666666666666667,"dds":"0.23529411764705888","last_synced_commit":"8f78474e0eefde10b7871a473ab5b028da01824a"},"previous_names":["lyonsyonii/astro-prefetch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LyonSyonII%2Fastro-preload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LyonSyonII%2Fastro-preload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LyonSyonII%2Fastro-preload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LyonSyonII%2Fastro-preload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LyonSyonII","download_url":"https://codeload.github.com/LyonSyonII/astro-preload/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657917,"owners_count":21140846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T15:11:15.465Z","updated_at":"2025-04-13T03:09:54.119Z","avatar_url":"https://github.com/LyonSyonII.png","language":"Astro","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astro Preload\nEasily download images at build time!  \nSupports [Iconify](https://icon-sets.iconify.design/) icons and arbitrary images.\n\n## What does it do?\nAt build time, Astro Preload downloads the images from the provided urls and saves them to `public/assets/preloaded/`.\n\nCan be useful in combination with tools like [astro-compress](https://github.com/astro-community/astro-compress) or to avoid including remote assets at runtime.\n\n\u003e In `development` mode Astro Preload will forward the urls directly, to avoid downloading the files multiple times.\n\n## Install\n```bash\nnpx astro add astro-preload\n# or\nyarn astro add astro-preload\n```\n\nRemember to move the integration import function before any other imports.\n\n```mjs\nimport { defineConfig } from \"astro/config\";\nimport compress from \"astro-compress\";\nimport preload from \"astro-preload\";\n\nexport default defineConfig({\n  integrations: [preload(), compress()]\n});\n```\n\n## Usage\nGet icon from Iconify:\n```astro\n---\nimport { Icon } from \"astro-preload/components\";\n---\n\u003c!-- Automatically fetches and downloads Material Design Icon's \"github\" SVG --\u003e\n\u003cIcon pack=\"mdi\" name=\"github\" /\u003e\n\n\u003c!-- Equivalent shorthand --\u003e\n\u003cIcon name=\"mdi:github\" /\u003e\n\n```\n\nGet image from arbitrary URL:\n\n```astro\n---\nimport { Image } from \"astro-preload/components\";\n---\n\u003c!-- Automatically fetches and downloads image --\u003e\n\u003cImage url=\"https://examplecat.com/cat.png\" /\u003e\n```\n\n## API\nThe **Icon** component accepts the following props:\n- `name`: The name of the icon. Follows the format `\u003cpack\u003e:\u003cname\u003e`.\n- `pack`: The pack of the icon. Can be skipped if a name with shorthand is provided.\n- `size`: The size of the icon. Applied to both `width` and `height`.\n- `url`: The URL of the icon. Overrides default Iconify URL.\n\nThe **Image** component accepts the following props:\n- `name`: The name of the downloaded image. If not provided it will try to be inferred from the url.\n- `url`: The URL of the image.\n- `size`: The size of the image. Applied to both `width` and `height`.\n\nAny other props are passed to the wrapped `\u003cimg\u003e` tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyonsyonii%2Fastro-preload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyonsyonii%2Fastro-preload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyonsyonii%2Fastro-preload/lists"}