{"id":13580761,"url":"https://github.com/aminya/astro-plugins","last_synced_at":"2026-01-21T05:40:17.783Z","repository":{"id":197735853,"uuid":"699233282","full_name":"aminya/astro-plugins","owner":"aminya","description":"Various astro plugins such as astro-htmlnano to minify Astro files with HTMLNano and CSSNano","archived":false,"fork":false,"pushed_at":"2024-04-29T14:52:58.000Z","size":646,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-01T23:19:00.378Z","etag":null,"topics":["astro","astro-plugin","cssnano","html-minifier","htmlnano","minify","optimize","posthtml"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/astro-htmlnano","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aminya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-02T08:06:38.000Z","updated_at":"2024-05-04T03:26:36.290Z","dependencies_parsed_at":null,"dependency_job_id":"86069df6-32c5-48e6-9e37-c796c0cce032","html_url":"https://github.com/aminya/astro-plugins","commit_stats":null,"previous_names":["aminya/astro-plugins"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aminya%2Fastro-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aminya","download_url":"https://codeload.github.com/aminya/astro-plugins/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225729,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astro","astro-plugin","cssnano","html-minifier","htmlnano","minify","optimize","posthtml"],"created_at":"2024-08-01T15:01:54.876Z","updated_at":"2026-01-21T05:40:17.756Z","avatar_url":"https://github.com/aminya.png","language":"TypeScript","funding_links":["https://github.com/sponsors/aminya"],"categories":["Astro"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eastro-htmlnano\u003c/h1\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"#\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: Apache--2.0\" src=\"https://img.shields.io/badge/License-Apache--2.0-yellow.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Minify Astro files with HTMLNano and CSSNano\n\n## Install\n\n```sh\nnpm install --save astro-htmlnano\n```\n\n## Usage\n\n\u003c!-- INSERT GENERATED DOCS START --\u003e\n\n### `getAstroHTMLNano` (function)\n\nMinify Astro files with HTMLNano and CSSNano\n\n**Parameters:**\n\n- options (`HtmlnanoOptions`) - The HTMLNano options to use when transforming the HTML files\n- preset (`HtmlnanoPreset`) - The HTMLNano preset to use\n\n**returns:** (\\_context: APIContext\u003cRecord\u003cstring, any\u003e, Record\u003cstring, string\u003e\u003e, next: MiddlewareNext) =\u003e Promise\u003cResponse\u003e\n\nCreate `./src/middleware.ts` with the following content:\n\n```ts\nimport { getAstroHTMLNano } from \"astro-htmlnano\"\n\nexport const onRequest = getAstroHTMLNano()\n```\n\n\u003c!-- INSERT GENERATED DOCS END --\u003e\n\n\u003ch1 align=\"center\"\u003eastro-posthtml\u003c/h1\u003e\n\u003cp\u003e\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000\" /\u003e\n  \u003ca href=\"#\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License: Apache--2.0\" src=\"https://img.shields.io/badge/License-Apache--2.0-yellow.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e Transform Astro files with PostHTML\n\n## Install\n\n```sh\nnpm install --save astro-posthtml\n```\n\n## Usage\n\n\u003c!-- INSERT GENERATED DOCS START --\u003e\n\n### `getAstroPostHTML` (function)\n\nTransform Astro files with PostHTML\n\n**Parameters:**\n\n- plugins (`Plugin\u003cPostHTMLUseThis\u003e[]`) - The posthtml plugins to use when transforming the HTML files\n- options (`Options`) - The posthtml options\n\n**returns:** (\\_context: APIContext\u003cRecord\u003cstring, any\u003e, Record\u003cstring, string\u003e\u003e, next: MiddlewareNext) =\u003e Promise\u003cResponse\u003e\n\nCreate `./src/middleware.ts` with the following content:\n\n```ts\nimport { getAstroPostHTML } from \"astro-posthtml\"\nimport htmlnano from \"htmlnano\"\n\nexport const onRequest = process.env.NODE_ENV === \"production\" ? getAstroPostHTML([htmlnano()]) : undefined\n```\n\n## 🤝 Contributing\n\nYou can sponsor my work here:\n\nhttps://github.com/sponsors/aminya\n\nPull requests, issues and feature requests are welcome.\nSee the [Contributing guide](https://github.com/aminya/atro-plugins/blob/master/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminya%2Fastro-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faminya%2Fastro-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faminya%2Fastro-plugins/lists"}