{"id":14979285,"url":"https://github.com/23maverick23/jekyll-humanize","last_synced_at":"2025-10-28T16:31:39.859Z","repository":{"id":13639704,"uuid":"16333099","full_name":"23maverick23/jekyll-humanize","owner":"23maverick23","description":"This is a port of the Django app `humanize` which adds a \"human touch\" to data.","archived":false,"fork":false,"pushed_at":"2014-10-09T19:45:43.000Z","size":200,"stargazers_count":36,"open_issues_count":1,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-29T02:42:11.154Z","etag":null,"topics":["jekyll","jekyll-plugin","jekyll-site","jekyll-template","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/23maverick23.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}},"created_at":"2014-01-29T02:21:21.000Z","updated_at":"2024-03-15T01:51:29.000Z","dependencies_parsed_at":"2022-09-06T02:31:06.233Z","dependency_job_id":null,"html_url":"https://github.com/23maverick23/jekyll-humanize","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23maverick23%2Fjekyll-humanize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23maverick23%2Fjekyll-humanize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23maverick23%2Fjekyll-humanize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/23maverick23%2Fjekyll-humanize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/23maverick23","download_url":"https://codeload.github.com/23maverick23/jekyll-humanize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859164,"owners_count":16556037,"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":["jekyll","jekyll-plugin","jekyll-site","jekyll-template","ruby"],"created_at":"2024-09-24T13:59:45.170Z","updated_at":"2025-10-28T16:31:34.062Z","avatar_url":"https://github.com/23maverick23.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jekyll-humanize\n\nThis began as a port of the Django app `humanize` which adds a \"human touch\" to data. Each method represents a Fluid type filter that can be used in your Jekyll site templates. Given that Jekyll produces static sites, some of the original methods do not make logical sense to port (e.g. naturaltime).\n\n## Installation\n\nSimply download the `humanize.rb` file and place it in the `_plugins` directory of your Jekyll site.\n\n## Usage\n\nEach of the methods in the file presents an available Fluid type filter to be used in Jekyll templates.\n\nThere is one **optional** setting that can be overridden in your `_config.yml` file. The setting should follow the format below and should be a valid `strftime` date string. Documentation on `strftime` can be found at [www.ruby-doc.com][2].\n\n```yaml\nhumanize:\n    date_format: \"%m/%d/%Y\"\n```\n\n### ordinal(_value_, _flag=\"super\"_)\n\nConverts an integer to its ordinal as a string. 1 is '1st', 2 is '2nd', 3 is '3rd', etc. Works for any integer. An optional flag can be added which puts the ordinal suffix in `\u003csup\u003e\u003c/sup\u003e` tags.\n\n```ruby\n{{ somenum }} \u003e\u003e\u003e 3\n{{ somenum | ordinal }} \u003e\u003e\u003e '3rd'\n{{ somenum | ordinal: \"super\" }} \u003e\u003e\u003e '3\u003csup\u003erd\u003c/sup\u003e'\n```\n\n### intcomma(_value_, _delimiter=\",\"_)\n\nConverts an integer to a string containing commas every three digits. For example, 3000 becomes '3,000' and 45000 becomes '45,000'. Optionally supports a delimiter override for commas (if you wanted to use periods for European numerical separators).\n\n```ruby\n{{ post.content | number_of_words }} \u003e\u003e\u003e 12345\n{{ post.content | number_of_words | intcomma }} \u003e\u003e\u003e '12,345'\n{{ post.content | number_of_words | intcomma: '.' }} \u003e\u003e\u003e '12.345'\n```\n\n### intword(_value_)\n\nConverts a large integer to a friendly text representation. Works best for numbers over 1 million. For example, 1000000 becomes '1.0 million'. 1200000 becomes '1.2 million' and 1200000000 becomes '1.2 billion'.\n\n```ruby\n{{ largenum }} \u003e\u003e\u003e 1200000\n{{ largenum | intword }} \u003e\u003e\u003e '1.2 million'\n```\n\n### apnumber(_value_)\n\nFor numbers 0-9, returns the number spelled out. Otherwise, returns the number. This follows the Associated Press style.\n\n```ruby\n{{ num }} \u003e\u003e\u003e 6\n{{ num | apnumber }} \u003e\u003e\u003e 'six'\n```\n\n### naturalday(_date_)\n\nFor date values that are within a 9 day stretch from present day, this will attempt to return the string representation in the format of today, tomorrow, yesterday, \"in # days\" or \"# days ago\". Otherwise, returns a string formatted according to the `date_format` setting in your `_config.yml` file using strftime format. If not defined, it will default to `%m/%d/%Y`.\n\n```ruby\n# TODAY == '01/26/2014'\n{{ post.updated }} \u003e\u003e\u003e 01/25/2014\n{{ post.updated | naturalday }} \u003e\u003e\u003e 'yesterday'\n{{ post.date }} \u003e\u003e\u003e 01/19/2014\n{{ post.date | naturalday }} \u003e\u003e\u003e 'seven days ago'\n```\n\n### filesize(_bytes_)\n\nFor filesize values in bytes, returns the number rounded to 3 decimal places with the correct suffix.\n\n```ruby\n{{ bytes }} \u003e\u003e\u003e 123456789\n{{ bytes | filesize }} \u003e\u003e\u003e 117.738 MB\n```\n\n## License\n\n[LICENSE](LICENSE)\n\n#### Django Humanize\n\nCopyright (c) Django Software Foundation and individual contributors.\nAll rights reserved.\n\nSource code for the original Django app can be viewed at [https://github.com/django/django][1].\n\n#### JS-humanize\n\nFilesize format forked from javascript to ruby from [https://github.com/milanvrekic/JS-humanize][3]\n\n## Changelog\n\n[CHANGELOG](CHANGELOG.md)\n\nIssues\n------\n\n[![Issue Stats](http://issuestats.com/github/23maverick23/jekyll-humanize/badge/issue?style=flat)](http://issuestats.com/github/23maverick23/jekyll-humanize)\n\nYou can log issues from the menu at right, or by [clicking here](https://github.com/23maverick23/jekyll-humanize/issues). Curious about responsiveness? Check out our [Issue Stats](http://issuestats.com/github/23maverick23/jekyll-humanize)!\n\nContribute\n----------\n\n[![Issue Stats](http://issuestats.com/github/23maverick23/jekyll-humanize/badge/pr?style=flat)](http://issuestats.com/github/23maverick23/jekyll-humanize)\n\n1. [Fork](https://github.com/23maverick23/jekyll-humanize/fork) this repo.\n2. Create a branch `git checkout -b my_feature`\n3. Commit your changes `git commit -am \"Added Feature\"`\n4. Push to the branch `git push origin my_feature`\n5. Open a [Pull Request](https://github.com/23maverick23/jekyll-humanize/pulls)\n\n[1]: https://github.com/django/django\n[2]: http://www.ruby-doc.org/core-2.1.0/Time.html#method-i-strftime\n[3]: https://github.com/milanvrekic/JS-humanize\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F23maverick23%2Fjekyll-humanize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F23maverick23%2Fjekyll-humanize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F23maverick23%2Fjekyll-humanize/lists"}