{"id":15207563,"url":"https://github.com/straticjs/stratic-truncate-indexes","last_synced_at":"2026-03-12T14:12:31.922Z","repository":{"id":57371913,"uuid":"107574027","full_name":"straticjs/stratic-truncate-indexes","owner":"straticjs","description":"Truncate indexes to a specific number of posts","archived":false,"fork":false,"pushed_at":"2018-12-17T06:25:26.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T04:04:50.168Z","etag":null,"topics":["gulp","gulp-plugin","hacktoberfest","javascript","vinyl"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/straticjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-19T16:51:29.000Z","updated_at":"2021-10-07T16:59:55.000Z","dependencies_parsed_at":"2022-09-15T17:01:26.239Z","dependency_job_id":null,"html_url":"https://github.com/straticjs/stratic-truncate-indexes","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-truncate-indexes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-truncate-indexes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-truncate-indexes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straticjs%2Fstratic-truncate-indexes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/straticjs","download_url":"https://codeload.github.com/straticjs/stratic-truncate-indexes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242250926,"owners_count":20096897,"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":["gulp","gulp-plugin","hacktoberfest","javascript","vinyl"],"created_at":"2024-09-28T07:00:35.429Z","updated_at":"2026-03-12T14:12:26.893Z","avatar_url":"https://github.com/straticjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\t# `stratic-truncate-indexes`\n\n[Gulp][1] plugin to truncate [Stratic][2] indexes to a specific number of posts\n\nThis is particularly useful in combination with [`stratic-indexes-to-rss`][].\n\n## Installation\n\n    npm install stratic-truncate-indexes\n\n## Usage\n\nAll you need to do is pipe Stratic indexes to this module and BAM! It'll truncate them to a certain number of posts - 15 by default.\n\nYou may also pass a number to the module to override the number of posts to truncate to. The complete example below shows this.\n\n## Examples\n\nMinimal `gulpfile.js` for this module to work:\n\n```js\nvar gulp = require('gulp');\nvar frontmatter = require('gulp-gray-matter');\nvar straticDateInPath = require('stratic-date-in-path');\nvar addsrc = require('gulp-add-src');\nvar straticPostsToIndex = require('stratic-posts-to-index');\nvar straticTruncateIndexes = require('stratic-truncate-indexes');\n\ngulp.task('rss', function() {\n    gulp.src('*.md')\n        .pipe(frontmatter())\n        .pipe(straticDateInPath())\n        .pipe(addsrc('src/blog/index.jade'))\n        .pipe(straticPostsToIndex('index.jade'))\n        .pipe(straticTruncateIndexes());\n});\n```\n\nComplete example `gulpfile.js`:\n\n```js\nvar gulp = require('gulp');\nvar frontmatter = require('gulp-gray-matter');\nvar remark = require('gulp-remark');\nvar remarkHtml = require('remark-html');\nvar straticDateInPath = require('stratic-date-in-path');\nvar addsrc = require('gulp-add-src');\nvar straticPostsToIndex = require('stratic-posts-to-index');\nvar straticTruncateIndexes = require('stratic-truncate-indexes');\nvar straticIndexesToRss = require('stratic-indexes-to-rss');\nvar rename = require('gulp-rename');\n\ngulp.task('rss', function() {\n    gulp.src('*.md')\n        .pipe(frontmatter())\n        .pipe(remark().use(remarkHtml))\n        .pipe(straticDateInPath())\n        .pipe(addsrc('src/blog/index.jade'))\n        .pipe(straticPostsToIndex('index.jade'))\n        .pipe(straticTruncateIndexes(10)) // Override the default number of posts to truncate to\n        .pipe(straticIndexesToRss({title: 'Blag!'}, 'https://example.com/blog/'))\n        .pipe(rename({ extname: '.rss' }))\n        .pipe(gulp.dest('dist/blog'));\n});\n```\n\n## License\n\nLGPL 3.0+\n\n## Author\n\nAJ Jordan \u003calex@strugee.net\u003e\n\n [1]: http://gulpjs.com/\n [2]: https://github.com/straticjs/generator-stratic\n [`stratic-indexes-to-rss`]: https://github.com/straticjs/stratic-indexes-to-rss\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraticjs%2Fstratic-truncate-indexes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstraticjs%2Fstratic-truncate-indexes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraticjs%2Fstratic-truncate-indexes/lists"}