{"_id":"@__mazerty__/rollup-plugin-pages","_rev":"6-9681e9f38d4434a7f1cb1f29decf082b","name":"@__mazerty__/rollup-plugin-pages","dist-tags":{"latest":"1.0.2"},"versions":{"0.0.1":{"name":"@__mazerty__/rollup-plugin-pages","version":"0.0.1","_id":"@__mazerty__/rollup-plugin-pages@0.0.1","maintainers":[{"name":"__mazerty__","email":"mazerty@gmail.com"}],"dist":{"shasum":"103d9c3b470d93f2db58024e7cbbad6c9e4abfe7","tarball":"https://registry.npmjs.org/@__mazerty__/rollup-plugin-pages/-/rollup-plugin-pages-0.0.1.tgz","fileCount":3,"integrity":"sha512-2kViTOEgscWhvKNL63ouBNEl3bvyKWVbQKI5gXQb4BUhkZ9an9ApKsQMBVQIw+bCo9/OShcjB1+B45Pt/0ZlUA==","signatures":[{"sig":"MEUCIGmTULIn4loDUUqlWVgflJqZEWq52VZVG2BD1Grph47yAiEAjHce0+1WU80elcDTm97zKbvj7yrBfNYLMIOf5simxLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":2113},"type":"module","volta":{"node":"18.18.2"},"gitHead":"78a9cac5ef34a128b6dffcfffbfe5eff9ebefee7","_npmUser":{"name":"__mazerty__","email":"mazerty@gmail.com"},"_npmVersion":"9.8.1","directories":{},"_nodeVersion":"18.18.2","dependencies":{"yaml":"^2.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin-pages_0.0.1_1700290465768_0.06327788145698698","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@__mazerty__/rollup-plugin-pages","version":"0.0.2","keywords":["rollup-plugin","vite-plugin","pages","markdown","frontmatter","blog"],"author":{"name":"Thomas JOUANNOT","email":"mazerty@gmail.com"},"license":"MIT","_id":"@__mazerty__/rollup-plugin-pages@0.0.2","maintainers":[{"name":"__mazerty__","email":"mazerty@gmail.com"}],"homepage":"https://gitlab.com/__mazerty__/rollup-plugin-pages#readme","bugs":{"url":"https://gitlab.com/__mazerty__/rollup-plugin-pages/issues"},"dist":{"shasum":"3c17974fde0312686214c948fdc6e6818e54c259","tarball":"https://registry.npmjs.org/@__mazerty__/rollup-plugin-pages/-/rollup-plugin-pages-0.0.2.tgz","fileCount":3,"integrity":"sha512-dGjbXc8Meu0XvCFfkjyD2HFiUVP1q0hsCa6EdiFWytabZLDyozE5G0DIw0+gN7OqqbZQjPbkUDaCgG17KnbRXA==","signatures":[{"sig":"MEQCIDwIUcsfzxUaNNmJELshQA+UDs2Ecul+d+Rkhv+nRfFQAiBvfKb6+sCXyOm4yeifYlY+sueQrlyWizaqthazpUcHDw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5426},"type":"module","volta":{"node":"18.18.2"},"gitHead":"1e65baa777078cda19bce484fe6b8d53f79cf3a9","scripts":{"test":"vitest"},"_npmUser":{"name":"__mazerty__","email":"mazerty@gmail.com"},"repository":{"url":"git+https://gitlab.com/__mazerty__/rollup-plugin-pages.git","type":"git"},"_npmVersion":"9.8.1","description":"Rollup/Vite plugin that can be used to extract metadata from a directory of markdown files with frontmatter (such as blog pages)","directories":{},"_nodeVersion":"18.18.2","dependencies":{"yaml":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^0.34.6"},"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin-pages_0.0.2_1700421027359_0.32256510985855424","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@__mazerty__/rollup-plugin-pages","version":"0.0.3","keywords":["rollup-plugin","vite-plugin","pages","markdown","frontmatter","blog"],"author":{"name":"Thomas JOUANNOT","email":"mazerty@gmail.com"},"license":"MIT","_id":"@__mazerty__/rollup-plugin-pages@0.0.3","maintainers":[{"name":"__mazerty__","email":"mazerty@gmail.com"}],"homepage":"https://gitlab.com/__mazerty__/rollup-plugin-pages#readme","bugs":{"url":"https://gitlab.com/__mazerty__/rollup-plugin-pages/issues"},"dist":{"shasum":"da329cbfdf20cf788a96718e28d877d50625ea6f","tarball":"https://registry.npmjs.org/@__mazerty__/rollup-plugin-pages/-/rollup-plugin-pages-0.0.3.tgz","fileCount":3,"integrity":"sha512-UiIXmn03hCbfuwb0dJlbh22CQNw7Kc28yKSJXqfYPJwphL/YI2xENJvUIHMLS8Flu4BqVL68fiAFIG2H9QULsg==","signatures":[{"sig":"MEUCIC3JBZ8HSX/eMsYkge648tPsejiP+E5HpioeeEg/MjwJAiEAhmzWIwfY3GyMm+rENxJD8b2gyv3gFotAawwI2RZ8yn8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5427},"type":"module","volta":{"node":"18.18.2"},"gitHead":"0826ab39e357c5fa7abaecc644197583b0220c21","scripts":{"test":"vitest"},"_npmUser":{"name":"__mazerty__","email":"mazerty@gmail.com"},"repository":{"url":"git+https://gitlab.com/__mazerty__/rollup-plugin-pages.git","type":"git"},"_npmVersion":"9.8.1","description":"Rollup/Vite plugin that can be used to extract metadata from a directory of markdown files with frontmatter (such as blog pages)","directories":{},"_nodeVersion":"18.18.2","dependencies":{"yaml":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^0.34.6"},"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin-pages_0.0.3_1700701305584_0.2593959128712211","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@__mazerty__/rollup-plugin-pages","version":"1.0.0","keywords":["rollup-plugin","vite-plugin","pages","markdown","frontmatter","blog"],"author":{"name":"Thomas JOUANNOT","email":"mazerty@gmail.com"},"license":"MIT","_id":"@__mazerty__/rollup-plugin-pages@1.0.0","maintainers":[{"name":"__mazerty__","email":"mazerty@gmail.com"}],"homepage":"https://gitlab.com/__mazerty__/rollup-plugin-pages#readme","bugs":{"url":"https://gitlab.com/__mazerty__/rollup-plugin-pages/issues"},"dist":{"shasum":"f56a47121a50c196cadf57c47b579fdded7507ed","tarball":"https://registry.npmjs.org/@__mazerty__/rollup-plugin-pages/-/rollup-plugin-pages-1.0.0.tgz","fileCount":4,"integrity":"sha512-tco4vtt1ufTVSyVr7Mvp0SW1oJBTvJBsvTTZcN+tcrY5kau2EhnBdQZlNWAXTMcgK4fE9ffgsI/x4vBK8iSrDA==","signatures":[{"sig":"MEYCIQDxKE03N+QYePaBK69aQr+DLhpAsJ2cnP4mYxKUYiaGfgIhAILdpnGuwybIearTC6U1/Q5eNlAO+hLM3gOJa8TCZMe5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10027},"type":"module","volta":{"node":"18.18.2"},"gitHead":"2efe5e671b2db3e88f9c353855b00cca1c5d66bc","scripts":{"test":"vitest"},"_npmUser":{"name":"__mazerty__","email":"mazerty@gmail.com"},"repository":{"url":"git+https://gitlab.com/__mazerty__/rollup-plugin-pages.git","type":"git"},"_npmVersion":"9.8.1","description":"Rollup/Vite plugin that can be used to extract metadata from a directory of markdown files with frontmatter (such as blog pages)","directories":{},"_nodeVersion":"18.18.2","dependencies":{"yaml":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin-pages_1.0.0_1702895413335_0.8221594738771794","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@__mazerty__/rollup-plugin-pages","version":"1.0.1","keywords":["rollup-plugin","vite-plugin","pages","markdown","frontmatter","blog"],"author":{"name":"Thomas JOUANNOT","email":"hello@mazerty.fr"},"license":"MIT","_id":"@__mazerty__/rollup-plugin-pages@1.0.1","maintainers":[{"name":"__mazerty__","email":"hello@mazerty.fr"}],"dist":{"shasum":"0e92d212ce6348b91a18f302dd5a221043e4d692","tarball":"https://registry.npmjs.org/@__mazerty__/rollup-plugin-pages/-/rollup-plugin-pages-1.0.1.tgz","fileCount":4,"integrity":"sha512-VLELrjaT+IOJ+1LNSou7R9r1p2xbCbSui0n8j3k/IMJRuS8qAdEDHI4qepyOpneTukv0/7mkuxZOnLETLeXrNA==","signatures":[{"sig":"MEUCIQDv6Gg0NK7dTsqil7+iUBjc8/O0IfC0dVGkLdrGpG+/RgIgMN/LHBzkVwPiZ2aXix25Gv2soBYwrzCfRBPEQG2XIxg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9921},"type":"module","gitHead":"00120438b1f3be18c5ac6c1d4cc02374a8413e6f","scripts":{"test":"vitest"},"_npmUser":{"name":"__mazerty__","email":"hello@mazerty.fr"},"repository":{"url":"git+https://codeberg.org/mazerty/rollup-plugin-pages.git","type":"git"},"_npmVersion":"10.9.7","description":"Rollup/Vite plugin that can be used to extract metadata from a directory of markdown files with frontmatter (such as blog pages)","directories":{},"_nodeVersion":"22.22.2","dependencies":{"yaml":"2.9.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"4.1.9"},"_npmOperationalInternal":{"tmp":"tmp/rollup-plugin-pages_1.0.1_1783181279199_0.434634346303876","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@__mazerty__/rollup-plugin-pages","description":"Rollup/Vite plugin that can be used to extract metadata from a directory of markdown files with frontmatter (such as blog pages)","version":"1.0.2","type":"module","scripts":{"test":"vitest"},"dependencies":{"yaml":"2.9.0"},"devDependencies":{"vitest":"4.1.9"},"author":{"name":"Thomas JOUANNOT","email":"hello@mazerty.fr"},"keywords":["rollup-plugin","vite-plugin","pages","markdown","frontmatter","blog"],"license":"MIT","homepage":"https://codeberg.org/mazerty/rollup-plugin-pages","repository":{"type":"git","url":"git+https://codeberg.org/mazerty/rollup-plugin-pages.git"},"publishConfig":{"access":"public"},"_id":"@__mazerty__/rollup-plugin-pages@1.0.2","gitHead":"8c1ec2ba8bc090eb4facd3f1e1601ff0691ce59e","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-HcwrNvUvtrnkWZF5/jAfX8fPV2DKm0EI2QYDmtHUxGUs4YkZBMFr+Ue7Ps6AQi1ekuNREfuc7eBx7SqXlePVcA==","shasum":"e3291dc3bba8d7d14454c6d615c6e820e8921ca3","tarball":"https://registry.npmjs.org/@__mazerty__/rollup-plugin-pages/-/rollup-plugin-pages-1.0.2.tgz","fileCount":4,"unpackedSize":10036,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHavj7Bj2NM3DJ1EtMz6y3TESBR4cqIIlGeSGv0+sp5GAiEA7nDHsCVFkfZh6WPmy+rxJOSua5ANcpGoYZ27Ykc4EZ4="}]},"_npmUser":{"name":"__mazerty__","email":"hello@mazerty.fr"},"directories":{},"maintainers":[{"name":"__mazerty__","email":"hello@mazerty.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rollup-plugin-pages_1.0.2_1783181922990_0.038556769440390104"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-18T06:54:25.624Z","modified":"2026-07-04T16:18:43.229Z","0.0.1":"2023-11-18T06:54:25.953Z","0.0.2":"2023-11-19T19:10:27.586Z","0.0.3":"2023-11-23T01:01:45.738Z","1.0.0":"2023-12-18T10:30:13.506Z","1.0.1":"2026-07-04T16:07:59.363Z","1.0.2":"2026-07-04T16:18:43.135Z"},"author":{"name":"Thomas JOUANNOT","email":"hello@mazerty.fr"},"license":"MIT","keywords":["rollup-plugin","vite-plugin","pages","markdown","frontmatter","blog"],"repository":{"type":"git","url":"git+https://codeberg.org/mazerty/rollup-plugin-pages.git"},"description":"Rollup/Vite plugin that can be used to extract metadata from a directory of markdown files with frontmatter (such as blog pages)","maintainers":[{"name":"__mazerty__","email":"hello@mazerty.fr"}],"readme":"# rollup-plugin-pages\n\nRollup/Vite plugin that can be used to extract metadata from a directory of Markdown files with _frontmatter_ (such as blog pages).  \nIt can then be imported like any other module in your existing application to populate a router or a summary page.\n\n## Demo\n\n[rollup-plugin-pages.mazerty.fr](https://rollup-plugin-pages.mazerty.fr) is a React application that has been built around this plugin and features a table of contents and a basic router.  \nThe source code is available on [Codeberg](https://codeberg.org/mazerty/rollup-plugin-pages-demo) and can be used to bootstrap your own application.\n\n## Installation\n\nYou can add `@__mazerty__/rollup-plugin-pages` in your `devDependencies` yourself, or you can let your favorite package manager do it for you.  \nFor example:\n\n```\nnpm install @__mazerty__/rollup-plugin-pages --save-dev\n```\n\n## Usage\n\nLet's say you have a project with a file structure that looks something like this:\n\n```\nsrc/\n  pages/\n    1970-01-01_lorem-ipsum.md\n    1970-01-02_dolor-sit-amet.md\ntests/\npackage.json\nrollup.config.js or vite.config.js\n```\n\nAnd let's say the frontmatter of your Markdown pages looks something like this:\n\n```yaml\n---\ntitle: Lorem Ipsum\ndescription: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n---\n```\n\nJust add the plugin in your Rollup/Vite configuration file:\n\n```javascript\nimport {defineConfig} from \"vite\"\nimport pages from \"@__mazerty__/rollup-plugin-pages\"\n\nexport default defineConfig({\n    plugins: [\n        pages(__dirname + \"/src/pages\")\n    ]\n})\n```\n\nAnd Rollup/Vite will build a [virtual module](https://vitejs.dev/guide/api-plugin#virtual-modules-convention) that you can import like any other module:\n\n```javascript\nimport pages from \"virtual:pages\"\n```\n\nThe code of the virtual module would look something like this:\n\n```javascript\nexport default [\n    {\n        \"import\": () => import(\"src/pages/1970-01-01_lorem-ipsum.md\"),\n        \"date\": \"1970-01-01\",\n        \"key\": \"lorem-ipsum\",\n        \"title\": \"Lorem Ipsum\",\n        \"description\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n    },\n    {\n        \"import\": () => import(\"src/pages/1970-01-02_dolor-sit-amet.md\"),\n        \"date\": \"1970-01-02\",\n        \"key\": \"dolor-sit-amet\",\n        \"title\": \"Dolor Sit Amet\",\n        \"description\": \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"\n    }\n]\n```\n\n* The `date` and `key` attributes are extracted from the filename (this is fully customizable through the `filenamePattern` parameter, see below).\n* The `title` and `description` attributes come from the frontmatter, which can be any valid [yaml mapping](https://yaml.org/spec/1.2.2/#mapping).\n* The `import` attribute is a function that allows you to [dynamically import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import) the page into your application\n  (see also [lazy loading](https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading) and [code splitting](https://developer.mozilla.org/en-US/docs/Glossary/Code_splitting)).\n\n> You'll still need a library such as [MDX](https://mdxjs.com) or [unplugin-vue-markdown](https://github.com/unplugin/unplugin-vue-markdown) to turn your Markdown files into components, but this is outside the scope of this plugin :)  \n> Check out the [demo](https://rollup-plugin-pages.mazerty.fr) to see how it can be done with MDX.\n\n## Parameters\n\nThere are actually 3 parameters that allow you to customize the behavior of the plugin:\n\n* `absolutePath` _(string)_: absolute path to the pages' directory.\n* `virtualModuleId` _(string, optional)_: name of the virtual module, defaults to `virtual:pages`.  \n  Has to be unique, allows for multiple use of the plugin in the same project (i.e. for different directories).\n* `filenamePattern` _(RegExp, optional)_: regular expression for the pages' filenames inside the directory, defaults to `/(?<date>.*)_(?<key>.*)\\./` ([regexr](https://regexr.com/7p8gb)).  \n  Only [named capturing groups](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Named_capturing_group) are considered valid, regular capturing groups will be ignored.\n","readmeFilename":"README.md","homepage":"https://codeberg.org/mazerty/rollup-plugin-pages"}