🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

siena

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

siena

Optimize markdown images in Astro

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
43
330%
Maintainers
1
Weekly downloads
 
Created
Source

Siena

An Astro integration that makes working with images inside markdown easier.

  • Any image source: Now you can use relative or absolute images and view all your markdown images in text editors and on Github
  • Image optimization: Converts all images to newer formats (avif, webp)

Setup

  • Install Siena as a dev dependency:
npm i -D siena
pnpm add -D siena
yarn add -D siena
  • Add Siena as an Astro integration in Astro config (astro.config.cjs):
import siena from "siena";

// https://astro.build/config
export default defineConfig({
	integrations: [siena()]
});
  • Add public/.siena to .gitignore:
public/.siena

How it works

It will find all images used in your markdown files, convert it to avif, webp, jpg, store them inside .siena directory (which is inside public or the specified directory), and replace all <img/> with <picture/> elements.

Options

import siena from "siena";

// https://astro.build/config
export default defineConfig({
	integrations: [
		siena({
			loading: "eager"
		})
	]
});
  • outputDir (string): Where Siena will generate a .siena directory
  • loading (lazy default, eager)

FAQs

Package last updated on 04 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts