Astro
Here're the steps to integrate Urami with Astro.
Quick install
Use astro add to install @urami/astro package. This will automatically install dependencies, and add integration to astro.config.mjs.
sh
$ npx astro add @urami/astro$ npx astro add @urami/astrosh
$ pnpm astro add @urami/astro$ pnpm astro add @urami/astrosh
$ yarn astro add @urami/astro$ yarn astro add @urami/astroManual install
First, install @urami/astro package.
sh
$ npm add @urami/astro$ npm add @urami/astrosh
$ pnpm add @urami/astro$ pnpm add @urami/astrosh
$ yarn add @urami/astro$ yarn add @urami/astroThen, apply integration to astro.config.mjs. It's important to have output: 'server' in order to use Urami.
js
import { defineConfig } from "astro/config";
import urami from "@urami/astro";
// https://astro.build/config
export default defineConfig({
output: "server",
integrations: [
urami(),
],
});import { defineConfig } from "astro/config";
import urami from "@urami/astro";
// https://astro.build/config
export default defineConfig({
output: "server",
integrations: [
urami(),
],
});Image component
Import Image component from @urami/astro and use it like next/image.
astro
---
import Image from '@urami/astro/image'
---
<Image
src="https://demo.rayriffy.com/tom-scott.jpg"
width={801}
height={801}
alt="Tom Scott"
class="rounded-xl shadow-md"
/>---
import Image from '@urami/astro/image'
---
<Image
src="https://demo.rayriffy.com/tom-scott.jpg"
width={801}
height={801}
alt="Tom Scott"
class="rounded-xl shadow-md"
/>