elringus / imgit

Transform images, video and YouTube links to HTML optimized for web vitals
https://imgit.dev
MIT License
21 stars 1 forks source link

add asset import #15

Closed elringus closed 7 months ago

elringus commented 7 months ago

This adds an option to directly import media assets allowing to build HTML manually instead of transforming the sources.

Astro page example:

---
import psd from "imgit:https://example.com/photo.psd";
import mkv from "imgit:/assets/video.mkv";
---

<img src={psd.content.encoded}
     height={psd.info.height}
     loading="lazy"/>

<video src={mkv.content.encoded}
       poster={mkv.content.cover}
       height={mkv.info.height}
       autoplay loop/>

Documentation: https://imgit.dev/guide/asset-import

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (bd6f70f) 100.00% compared to head (9895064) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #15 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 29 31 +2 Lines 1596 1658 +62 Branches 312 320 +8 ========================================= + Hits 1596 1658 +62 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.