diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 1fe3503..1e77ee2 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -55,6 +55,7 @@ export default defineConfig({ items: [ { text: "Introduction", link: "/guide/" }, { text: "Getting Started", link: "/guide/getting-started" }, + { text: "Asset Import", link: "/guide/asset-import" }, { text: "GPU Acceleration", link: "/guide/gpu-acceleration" }, { text: "Plugins", link: "/guide/plugins" } ] diff --git a/docs/guide/asset-import.md b/docs/guide/asset-import.md new file mode 100644 index 0000000..fe9e593 --- /dev/null +++ b/docs/guide/asset-import.md @@ -0,0 +1,48 @@ +# Asset Import + +By default, imgit is set up to detect and transform Markdown syntax in the source content. This works best for simple documentation and blog websites, but may not be flexible enough for more complex apps authored with frameworks like React. + +To better fit component-based apps, imgit allows importing media assets with `import` statement to manually author the desired HTML. + +Use `imgit:` namespace when importing a media asset to make imgit optimize it and return sources of the generated assets. For example, consider following [Astro](https://astro.build) page: + +```astro +--- +import psd from "imgit:https://example.com/photo.psd"; +import mkv from "imgit:/assets/video.mkv"; +--- + + + +