这个项目能做什么

# astro-umami > 一个用于向网站添加 [Umami Analytics](https://umami.is/) 的 [Astro 集成](https://docs.astro.build/en/guides/integrations-guide/)。 [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/yeskunall/astro-umami) [![Greptile: The War on Bugs](https://www.greptile.com/badge.svg)](https://www.greptile.com/?ref=yeskunall/astro-umami) [![E2E 测试](https://github.com/yeskunall/astro-umami/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/yeskunall/astro-umami/actions/workflows/test.yml) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/yeskunall/astro-umami/blob/main/license) [![npm version](https://badge.fury.io/js/@yeskunall%2Fastro-umami.svg)](https://badge.fury.io/js/@yeskunall%2Fastro-umami) ![monthly downloads](https://img.shields.io/npm/dm/@yeskunall%2Fastro-umami.svg?logo=npm) ## 亮点 - 自动检测您是否使用了 [View Transitions](https://docs.astro.build/en/guides/view-transitions/),并添加 [`data-astro-rerun`](https://docs.astro.build/en/guides/view-transitions/#data-astro-rerun) 属性 - 在开发过程中禁用事件和页面浏览量追踪 - 支持所有 [配置](https://docs.umami.is/docs/tracker-configuration) 选项,不同于 [`astro-analytics`](https://github.com/Destiner/astro-analytics) - 为所有配置选项提供内联文档(感谢 [TypeScript](https://github.com/yeskunall/astro-umami/blob/main/packages/astro-umami/src/index.ts#L7)) - (可选)使用 [Partytown](https://partytown.qwik.dev/) 提供追踪脚本(v0.0.5 及以上版本) - **积极维护中** - **零依赖** ## 使用方法 ### 安装 从项目目录运行以下命令并按提示操作: ```sh pnpm astro add @yeskunall/astro-umami@0.0.9 ``` 这将自动安装并在 Astro 配置中进行相应更改。 ### 手动安装 1. 安装所需依赖项 ```sh pnpm add @yeskunall/astro-umami@0.0.9 ``` 2. 将集成添加到您的 Astro 配置: ```diff + import umami from "@yeskunall/astro-umami"; export default defineConfig({ integrations: [ + umami({ id: "94db1cb1-74f4-4a40-ad6c-962362670409" }), ], }); ``` ###### 所有可配置选项请参阅 [interface](https://github.com/yeskunall/astro-umami/blob/main/packages/astro-umami/src/index.ts#L7)。