{"id":21158247,"url":"https://github.com/simbo/metalsmith-better-excerpts","last_synced_at":"2025-07-09T12:33:54.397Z","repository":{"id":24896725,"uuid":"28313101","full_name":"simbo/metalsmith-better-excerpts","owner":"simbo","description":"A Metalsmith plugin to extract/generate an excerpt from file content or metadata with multiple options.","archived":false,"fork":false,"pushed_at":"2018-05-20T09:29:18.000Z","size":27,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T06:06:05.470Z","etag":null,"topics":[],"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/simbo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-21T21:04:27.000Z","updated_at":"2019-04-23T15:03:31.000Z","dependencies_parsed_at":"2022-08-20T14:40:26.046Z","dependency_job_id":null,"html_url":"https://github.com/simbo/metalsmith-better-excerpts","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fmetalsmith-better-excerpts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fmetalsmith-better-excerpts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fmetalsmith-better-excerpts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simbo%2Fmetalsmith-better-excerpts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simbo","download_url":"https://codeload.github.com/simbo/metalsmith-better-excerpts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225551710,"owners_count":17487281,"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":[],"created_at":"2024-11-20T12:19:01.235Z","updated_at":"2024-11-20T12:19:01.833Z","avatar_url":"https://github.com/simbo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"metalsmith-better-excerpts\n==========================\n\n  \u003e A [Metalsmith](https://github.com/segmentio/metalsmith) plugin to\n  \u003e extract/generate an excerpt from file content or metadata with multiple\n  \u003e options.\n\n[![npm Package Version](https://img.shields.io/npm/v/metalsmith-better-excerpts.svg?style=flat-square)](https://www.npmjs.com/package/metalsmith-better-excerpts)\n[![MIT License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://simbo.mit-license.org)\n[![Dependencies Status](https://img.shields.io/david/simbo/metalsmith-better-excerpts.svg?style=flat-square)](https://david-dm.org/simbo/metalsmith-better-excerpts)\n[![devDependencies Status](https://img.shields.io/david/dev/simbo/metalsmith-better-excerpts.svg?style=flat-square)](https://david-dm.org/simbo/metalsmith-better-excerpts#info=devDependencies)\n[![Travis Build Status](https://img.shields.io/travis/simbo/metalsmith-better-excerpts/master.svg?style=flat-square)](https://travis-ci.org/simbo/metalsmith-better-excerpts)\n\n\n## About\n\n***metalsmith-better-excerpts*** will generate an excerpt for each *file* object \neither from frontmatter/metadata, from content until the first `more` tag or \nfrom the first paragraph in content. So generated excerpt content can be \nadditionally parsed by \n[underscore.string](https://github.com/epeli/underscore.string)'s \n`stripTags` and `prune` functions, although `prune` can only be used together \nwith `stripTags`.\n\n\n## Installation\n\n``` sh\n$ npm install metalsmith-better-excerpts\n```\n\n\n## CLI Usage\n\nInstall via npm and then add the metalsmith-better-excerpts key to your\n_metalsmith.json_ with any options you want, like so:\n\n``` json\n{\n  \"plugins\": {\n    \"metalsmith-better-excerpts\": {\n      \"pruneLength\": 80\n    }\n  }\n}\n```\n\n\n## Javascript Usage\n\nPass options to the plugin and pass it to Metalsmith with the use method:\n\n``` javascript\nvar excerpts = require('metalsmith-better-excerpts');\n\nmetalsmith.use(excerpts({\n    pruneLength: 80\n}));\n```\n\n\n## Options\n\nAll options are optional.\n\nSet `pruneLength` to `0` to disable pruning.\n\n\n### Defaults\n\n``` javascript\nvar defaultOptions = {\n        moreRegExp: /\\s*\u003c!--\\s*more\\s*--\u003e/i,\n        stripTags: true,\n        pruneLength: 140,\n        pruneString: '…'\n    };\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fmetalsmith-better-excerpts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimbo%2Fmetalsmith-better-excerpts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimbo%2Fmetalsmith-better-excerpts/lists"}