{"id":20603348,"url":"https://github.com/metalsmith/drafts","last_synced_at":"2025-04-06T22:07:31.653Z","repository":{"id":13839786,"uuid":"16536767","full_name":"metalsmith/drafts","owner":"metalsmith","description":"A metalsmith plugin to hide drafts.","archived":false,"fork":false,"pushed_at":"2024-11-01T14:35:34.000Z","size":1269,"stargazers_count":35,"open_issues_count":1,"forks_count":11,"subscribers_count":39,"default_branch":"main","last_synced_at":"2025-04-01T18:58:42.730Z","etag":null,"topics":["drafts","metalsmith","metalsmith-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metalsmith.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2014-02-05T06:06:30.000Z","updated_at":"2024-11-01T14:35:38.000Z","dependencies_parsed_at":"2024-06-18T21:21:16.305Z","dependency_job_id":"a7948e69-4d13-4f66-9c59-fc7ec01616cf","html_url":"https://github.com/metalsmith/drafts","commit_stats":{"total_commits":51,"total_committers":7,"mean_commits":7.285714285714286,"dds":0.3529411764705882,"last_synced_commit":"ed6ecf8fce3440b978e9a455113e8d6d77afd0af"},"previous_names":["segmentio/metalsmith-drafts"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalsmith%2Fdrafts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalsmith%2Fdrafts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalsmith%2Fdrafts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metalsmith%2Fdrafts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metalsmith","download_url":"https://codeload.github.com/metalsmith/drafts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["drafts","metalsmith","metalsmith-plugin"],"created_at":"2024-11-16T09:16:58.955Z","updated_at":"2025-04-06T22:07:31.627Z","avatar_url":"https://github.com/metalsmith.png","language":"JavaScript","readme":"# @metalsmith/drafts\n\nA metalsmith plugin to hide drafts. Metalsmith will not build a page that is marked as draft.\n\n[![metalsmith: core plugin][metalsmith-badge]][metalsmith-url]\n[![npm: version][npm-badge]][npm-url]\n[![ci: build][ci-badge]][ci-url]\n[![code coverage][codecov-badge]][codecov-url]\n[![license: MIT][license-badge]][license-url]\n\n## Installation\n\nNPM:\n\n```bash\nnpm install @metalsmith/drafts\n```\n\nYarn:\n\n```bash\nyarn add @metalsmith/drafts\n```\n\n## Usage\n\nPass the plugin with any options to `metalsmith.use`.\n\n```js\nimport drafts from '@metalsmith/drafts'\n\nmetalsmith.use(drafts()) // same as { include: false }\nmetalsmith.use(drafts(true)) // same as { include: true }\nmetalsmith.use(drafts({ default: false, include: false })) // same as default\n```\n\nAdd `draft: true` to your files' YAML front-matter to mark them as drafts:\n\n```yaml\n---\ntitle: My post\ndraft: true\n---\n```\n\nTo build pages that are marked as draft during development, you can use the Node environment and include the draft page in the build accordingly.\n\n```js\nconst inDevelopment = process.env.NODE_ENV === 'development'\n\nmetalsmith.use(drafts(inDevelopment))\n```\n\n### Default value for `draft`\n\nYou can instruct `@metalsmith/drafts` to mark files as `draft` by default if they don't have a `draft` property in their front-matter:\n\n```js\nimport drafts from '@metalsmith/drafts'\n\nmetalsmith.use(\n  drafts({\n    default: true\n  })\n)\n```\n\n### Debug\n\nTo enable debug logs, set the `DEBUG` environment variable to `@metalsmith/drafts*`:\n\n```js\nmetalsmith.env('DEBUG', '@metalsmith/drafts*')\n```\n\nAlternatively you can set `DEBUG` to `@metalsmith/*` to debug all Metalsmith core plugins.\n\n### CLI Usage\n\nTo use this plugin with the Metalsmith CLI, add `@metalsmith/drafts` to the `plugins` key in your `metalsmith.json` file:\n\n```json\n{\n  \"plugins\": [\n    {\n      \"@metalsmith/drafts\": {\n        \"default\": false\n      }\n    }\n  ]\n}\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-badge]: https://img.shields.io/npm/v/@metalsmith/drafts.svg\n[npm-url]: https://www.npmjs.com/package/@metalsmith/drafts\n[ci-badge]: https://github.com/metalsmith/drafts/actions/workflows/test.yml/badge.svg\n[ci-url]: https://github.com/metalsmith/drafts/actions/workflows/test.yml\n[metalsmith-badge]: https://img.shields.io/badge/metalsmith-core_plugin-green.svg?longCache=true\n[metalsmith-url]: http://metalsmith.io\n[codecov-badge]: https://img.shields.io/coveralls/github/metalsmith/drafts\n[codecov-url]: https://coveralls.io/github/metalsmith/drafts\n[license-badge]: https://img.shields.io/github/license/metalsmith/drafts\n[license-url]: LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetalsmith%2Fdrafts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetalsmith%2Fdrafts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetalsmith%2Fdrafts/lists"}