{"id":37235282,"url":"https://github.com/ryanshrum/hacksaw","last_synced_at":"2026-01-15T04:01:23.485Z","repository":{"id":62538676,"uuid":"68063686","full_name":"ryanshrum/hacksaw","owner":"ryanshrum","description":"A simple text truncation plugin for Craft CMS.","archived":true,"fork":false,"pushed_at":"2018-04-17T14:28:03.000Z","size":8,"stargazers_count":32,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-27T16:28:44.481Z","etag":null,"topics":["craftcms","craftcms-plugin","hacksaw","php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/ryanshrum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-13T01:46:45.000Z","updated_at":"2025-02-20T20:54:50.000Z","dependencies_parsed_at":"2022-11-02T16:15:31.800Z","dependency_job_id":null,"html_url":"https://github.com/ryanshrum/hacksaw","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ryanshrum/hacksaw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanshrum%2Fhacksaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanshrum%2Fhacksaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanshrum%2Fhacksaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanshrum%2Fhacksaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanshrum","download_url":"https://codeload.github.com/ryanshrum/hacksaw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanshrum%2Fhacksaw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["craftcms","craftcms-plugin","hacksaw","php"],"created_at":"2026-01-15T04:01:22.822Z","updated_at":"2026-01-15T04:01:23.459Z","avatar_url":"https://github.com/ryanshrum.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Notice (4/17/2018):\nUnfortunately, due to not working with Craft anymore and a lack of time, I haven\u0026rsquo;t been able to get Hacksaw updated for [Craft 3](https://craftcms.com/news/craft-3). I would recommend NY Studio's [Tyopgrify](https://github.com/nystudio107/craft-typogrify) or Top Shelf Craft\u0026rsquo;s [Wordsmith](https://wordsmith.docs.topshelfcraft.com/) (which includes native backwards compatibility for Hacksaw).\n\nAdditionally, if you would like to takeover as the maintainer of Hacksaw, please let me know and I will handover the reins.\n\n---\n\n# Hacksaw for Craft CMS\n\nA simple text truncation plugin for [Craft CMS](https://craftcms.com/) that takes your content and hacks it down to more manageable sizes.\n\n## Installation\n\nTo install Hacksaw, follow these steps:\n\n1. Download \u0026 unzip the file and place the `hacksaw` directory into your `craft/plugins` directory\u003cbr\u003e**-OR-**\u003cbr\u003e Do a `git clone https://github.com/ryanshrum/hacksaw.git` directly into your `craft/plugins` folder.  You can then update it with `git pull` \u003cbr\u003e**-OR-**\u003cbr\u003e Install with Composer via `composer require ryanshrum/hacksaw`\n1. Install plugin in the Craft Control Panel under Settings \u003e Plugins\n1. The plugin folder should be named `hacksaw` for Craft to see it.  GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads.\n\n## Usage\n\nHacksaw is a Twig filter that accepts the following parameters:\n\n| Parameter     | Type      | Default   | Description                                                                                                       |\n| ------------- | :-------: | :-------: | ----------------------------------------------------------------------------------------------------------------- |\n| hack          | string    | `'p'`       | What you want to hack on (`'characters'`, `'words'` or `'paragraphs'` - can also use first letter as short hand `'c'`, `'w'` or `'p'`)   |\n| limit         | int       | `1`         | Starting point for chars limit (used with chars param)                                                            |\n| allow         | string    | `null`    | Sometimes there are HTML tags in your content that you don' removed, pass them here                               |\n| append        | string    | `null`    | String to append to the end of the excerpt                                                                        |\n\n_**Note:** Cutoff has been deprecated from Hackasw._\n\n## Examples\n\nHacking by paragraphs is default, so if you wanted to limit your text to 5 paragraphs, you would only need to set the limit parameter:\n\n```\n{{ entry.richTextField|hacksaw(limit='5') }}\n```\n\nIf you wanted to limit to 50 characters or words, you'd use both the hack and limit parameter:\n\n```\n{{ entry.richTextField|hacksaw(hack='characters', limit='50') }}\n```\n\n```\n{{ entry.richTextField|hacksaw(hack='words', limit='50') }}\n```\n\nHacksaw will strip all HTML from your excerpt by default. If you would like to keep some basic HTML you can use the `allow` parameter to keep specific HTML tags. For example, let's say you want to keep `\u003ca\u003e` and `\u003cb\u003e` tags:\n\n_**Note:** `\u003cp\u003e`'s are automatically allowed when hacking by paragraph._\n\n```\n{{ entry.richTextField|hacksaw(limit='10', allow='\u003ca\u003e\u003cb\u003e') }}\n```\n\n**Note:** If you are including HTML in the append parameter, the elements must be present in the `allow` parameter. If you are including a Craft variable in any parameter, it must be added using the Twig concatenation operator, `~`. Example of both:\n\n```\n{{ entry.richTextField|hacksaw(hack='w', limit='100', allow='\u003ca\u003e', append='\u003ca href=\"' ~ entry.url ~ '\"\u003eContinue...\u003c/a\u003e') }}\n```\n\nBrought to you by [Ryan Shrum](http://ryanshrum.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanshrum%2Fhacksaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanshrum%2Fhacksaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanshrum%2Fhacksaw/lists"}