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

Image Paths #17

Closed zellwk closed 6 months ago

zellwk commented 7 months ago

Imgit with Astro fetches the file from the public directory. But there are many instances where I want to fetch images from the /src/assets directory instead (since I use Astro's image optimization tool as well). Is it possible to remove the /public?

Example 
// Passed in value 
const test = await import('imgit:/asset/image.png') 

// Path used now
// /absolute-path-to-project/public/src/asset/image.png

// Preferred path 
// /absolute-path-to-project/src/asset/image.png
elringus commented 7 months ago

Sure, you can set the preferred root directory in the options:

https://github.com/elringus/imgit/blob/46f5765eb5fe5dcb4c5ba75322193fb4f7aecbb5/src/server/config/options.ts#L4-L7

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 14 days with no activity. It will be automatically closed in 7 days.