{"_id":"@dv0vd/vuepress-auto-description","_rev":"4-f459c93cdd415eaeaa2721ffdad38e68","name":"@dv0vd/vuepress-auto-description","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@dv0vd/vuepress-auto-description","version":"1.0.0","keywords":["vuepress","vuepress-plugin","seo","description","meta"],"author":{"url":"https://dv0vd.dev","name":"Viacheslav Davydov","email":"dv0vd@dv0vd.xyz"},"license":"MIT","_id":"@dv0vd/vuepress-auto-description@1.0.0","maintainers":[{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"}],"dist":{"shasum":"61bafeb2f065fcee804aee3dd2bd7f0ae0fad489","tarball":"https://registry.npmjs.org/@dv0vd/vuepress-auto-description/-/vuepress-auto-description-1.0.0.tgz","fileCount":4,"integrity":"sha512-LoVZasqHI2ar01ge+OHKjeXvGUJXQpEiZ1qNw70t51gaO9M3KricKKPsgxWW/xBzdpMHfGfsDLxWhCu/Rk4+Pw==","signatures":[{"sig":"MEUCIHr8J8aX9DTOYOB7DBHkTZlEMN3hPVdNJRu7Ey22DDYsAiEAzJUuQ9+9qyEVSHkE6m0xxeCbyIM2daa23wESDGOpUIM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6479},"main":"index.js","type":"module","_npmUser":{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"},"_npmVersion":"10.9.2","description":"VuePress 2 Meta Description Generator","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"peerDependencies":{"@vuepress/core":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vuepress-auto-description_1.0.0_1764086271901_0.7594107025776617","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@dv0vd/vuepress-auto-description","version":"1.0.1","keywords":["vuepress","vuepress-plugin","seo","description","meta"],"author":{"url":"https://dv0vd.dev","name":"Viacheslav Davydov","email":"dv0vd@dv0vd.xyz"},"license":"MIT","_id":"@dv0vd/vuepress-auto-description@1.0.1","maintainers":[{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"}],"dist":{"shasum":"92d4cc4e6b791cd2f48a6efe6a75b68889dbdbe3","tarball":"https://registry.npmjs.org/@dv0vd/vuepress-auto-description/-/vuepress-auto-description-1.0.1.tgz","fileCount":4,"integrity":"sha512-bm2wWWadHOmUxkXvdVVpLpQTneyFb/IRyBGOLJDeuC0gHcaQQVa2KikdifNtcvwjzY87J+UYi1UtMeOhH/fNqQ==","signatures":[{"sig":"MEYCIQDRHRTDgLMGvTXPIi+VJjCYAFe1s1bSG4W4TIsOzYIdHQIhAI3UpzXYPyCyS0dS67waDbAr5fbnXBkNxwQhKF6s90Rz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6481},"main":"index.js","type":"module","_npmUser":{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"},"_npmVersion":"10.9.2","description":"VuePress 2 Meta Description Generator","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"peerDependencies":{"@vuepress/core":"^2.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/vuepress-auto-description_1.0.1_1764086633165_0.4862277348214732","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@dv0vd/vuepress-auto-description","version":"1.0.2","keywords":["vuepress","vuepress-plugin","seo","description","meta"],"author":{"url":"https://dv0vd.dev","name":"Viacheslav Davydov","email":"dv0vd@dv0vd.xyz"},"license":"MIT","_id":"@dv0vd/vuepress-auto-description@1.0.2","maintainers":[{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"}],"dist":{"shasum":"b207a3eb197c1d3aac258516a3426400ca8985a0","tarball":"https://registry.npmjs.org/@dv0vd/vuepress-auto-description/-/vuepress-auto-description-1.0.2.tgz","fileCount":4,"integrity":"sha512-rSFjk2L9W6CPi3RtnIrXeZeco+j7VcvfLZCsfumaIt5AfjIot/iAuaMUeW4DiJVcG50bAOR0QDemH36BoW3Orw==","signatures":[{"sig":"MEUCIQCgz3DHWvc6QKS5ANg2qAcsnC6tC63A984AYOBNeraIqwIgdUZueRavolXRifKwb153JkaJvev/cJ/5Vi4MlxSkaBA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6488},"main":"index.js","type":"module","_npmUser":{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"},"_npmVersion":"10.9.2","description":"VuePress 2 Meta Description Generator","directories":{},"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"peerDependencies":{"@vuepress/core":"^2.0.0-0"},"_npmOperationalInternal":{"tmp":"tmp/vuepress-auto-description_1.0.2_1764086783580_0.19984126856261386","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@dv0vd/vuepress-auto-description","version":"1.0.3","description":"VuePress 2 Meta Description Generator","main":"index.js","type":"module","keywords":["vuepress","vuepress-plugin","seo","description","meta"],"author":{"name":"Viacheslav Davydov","email":"dv0vd@dv0vd.xyz","url":"https://dv0vd.dev"},"license":"MIT","peerDependencies":{"@vuepress/core":"^2.0.0-0"},"_id":"@dv0vd/vuepress-auto-description@1.0.3","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-VraRByYcA16pVHSChpVSgmlAGn0XQ+7xgeDIWrzuwlL9zxzrPQiQ0ttqOdLir/U7cmXV3pClJb7A3W1ZA3CX2A==","shasum":"77931e2d71a3294034c17fd9a2b525f5f6166692","tarball":"https://registry.npmjs.org/@dv0vd/vuepress-auto-description/-/vuepress-auto-description-1.0.3.tgz","fileCount":4,"unpackedSize":4214,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICVZYGaufU08gCD8UcAUAfElOozPJzaE1zm8Y+82nhoAAiA1Ky/xSuaDBt2jxrtFCflcKM4ZPKl4ThuSxKIWfI817Q=="}]},"_npmUser":{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"},"directories":{},"maintainers":[{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vuepress-auto-description_1.0.3_1764134999616_0.7077405109550032"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-25T15:57:51.823Z","modified":"2025-11-26T05:29:59.969Z","1.0.0":"2025-11-25T15:57:52.103Z","1.0.1":"2025-11-25T16:03:53.368Z","1.0.2":"2025-11-25T16:06:23.763Z","1.0.3":"2025-11-26T05:29:59.784Z"},"author":{"name":"Viacheslav Davydov","email":"dv0vd@dv0vd.xyz","url":"https://dv0vd.dev"},"license":"MIT","keywords":["vuepress","vuepress-plugin","seo","description","meta"],"description":"VuePress 2 Meta Description Generator","maintainers":[{"name":"dv0vd","email":"dv0vd@dv0vd.xyz"}],"readme":"# @dv0vd/vuepress-auto-description\n\nAutomatically generate meta description for VuePress 2 pages from your Markdown content.\n\n## Features\n\n- Auto-generate meta description from first paragraph(s)\n- Paragraph-safe trimming to a configurable maximum length\n\n## Installation\n\n```bash\nnpm install @dv0vd/vuepress-auto-description\n```\n\n## How It Works\n1. **Check existing description**: If `page.frontmatter.description` is already set, the plugin does nothing and preserves the existing description.\n2. **Extract paragraphs**: The plugin parses the rendered HTML (`page.contentRendered`) and extracts all `<p>` elements.\n3. **Plain text**: HTML tags are removed, and whitespace is normalized. Empty paragraphs are ignored.\n4. **Trim to max length**:\n    - The plugin does not cut text in the middle of a word.\n    - Paragraphs are added sequentially until the total length reaches `maxDescriptionLength`.\n    - Because whole paragraphs are added, the final length **may slightly exceed the limit** to avoid cutting words in half.\n5. **Save description**: The final text is assigned to `page.frontmatter.description`.\n\n## Usage\n```js\nimport autoDescriptionPlugin from '@dv0vd/vuepress-auto-description';\n\nexport default {\n  plugins: [\n    autoDescriptionPlugin(160),\n  ],\n};\n```\n\n## Options\n\n| Option                    | Type   | Default | Description                                                                                           |\n| ------------------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------- |\n| `maxDescriptionLength`    | number | 150     | Maximum number of characters for the description                                                    |\n","readmeFilename":"README.md"}