{"id":16551210,"url":"https://github.com/michaelcurrin/jekyll-keys-filter","last_synced_at":"2025-10-28T18:31:30.569Z","repository":{"id":93178747,"uuid":"251557423","full_name":"MichaelCurrin/jekyll-keys-filter","owner":"MichaelCurrin","description":"A light copy-and-paste Jekyll plugin to get keys from a hash","archived":false,"fork":false,"pushed_at":"2021-05-11T14:42:12.000Z","size":25,"stargazers_count":4,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T17:11:13.250Z","etag":null,"topics":["jekyll","jekyll-plugin","ruby","static-site"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaelCurrin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-31T09:28:43.000Z","updated_at":"2023-05-17T09:37:36.000Z","dependencies_parsed_at":"2023-04-11T11:00:51.608Z","dependency_job_id":null,"html_url":"https://github.com/MichaelCurrin/jekyll-keys-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fjekyll-keys-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fjekyll-keys-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fjekyll-keys-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fjekyll-keys-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelCurrin","download_url":"https://codeload.github.com/MichaelCurrin/jekyll-keys-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238700298,"owners_count":19515900,"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","ruby","static-site"],"created_at":"2024-10-11T19:36:38.560Z","updated_at":"2025-10-28T18:31:30.078Z","avatar_url":"https://github.com/MichaelCurrin.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jekyll Keys Filter\n\u003e A light copy-and-paste Jekyll plugin to get keys from a hash\n\n[![Made with Ruby](https://img.shields.io/badge/Made_with-Ruby-blue?logo=ruby)](https://ruby-lang.org)\n[![ISC license](https://img.shields.io/badge/License-ISC-blue.svg)](#license)\n\nThis a great example of using Ruby code in just a single script to create a simple Jekyll plugin. \n\nHow to use gem like this:\n\n- Package as a Ruby gem, with a gemspec file.\n    - Publish to RubyGems for installation using `gem` or `bundle` commands. \n    - Provide instructions for installing your gem using a GitHub URL instead, using the same install commands.\n- Copy the Ruby script directly to your Jekyll plugins directory - `_plugins`. Then use in your Jekyll code, or run with:\n    ```sh\n    $ bundle exec ruby _plugins/script.rb\n   ```\n\nNote that regardless of which flow you use, custom gems outside of the standard are considered unsafe and unsupported on GitHub Pages.\n\n\n## Sample usage\n\nJekyll templating example using a hash variable.\n\n```liquid\n{% assign my_hash =  {'foo': 'bar', 'baz': 'buzz'} %}\n\n{{ my_hash | keys | join: ', ' }}\n```\n\nRendered content:\n\n```\nfoo, baz\n```\n\n\n## Installation\n\nIn your Jekyll project, create a file as `_plugins/keys-filter.rb`.\n\nCopy the contents of [keys-filter.rb](/keys-filter.rb) to it.\n\nThat plugin uses standard Ruby functionality of getting keys from a hash - it makes that available as a Jekyll filter called `keys`, as below.\n\n\n## Usage\n\n```liquid\n{{ my_hash | keys }}\n```\n\nThe value will be the keys as an array of strings.\n\n```json\n[ \"foo\", \"bar\", \"bazz\" ]\n```\n\n\n## Resources\n\n- [Jekyll filter](https://jekyllrb.com/docs/liquid/filters/) docs.\n- [Jekyll plugin](https://jekyllrb.com/docs/plugins/) docs, including how to write your own.\n\n\n## License\n\nReleased under [ISC](/LICENSE).\n\nCopyright for [keys-filter.rb](/keys-filter.rb) is held by [@dalenys](https://github.com/dalenys). The early commits here are by [@nemenemsrouge](https://github.com/nemenemsrouge). \n\nAll other copyright is held by [@MichaelCurrin](https://github.com/MichaelCurrin).\n\nI forked this project so I could keep a copy of the plugin and improve its docs. The original repo was taken off of GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelcurrin%2Fjekyll-keys-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelcurrin%2Fjekyll-keys-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelcurrin%2Fjekyll-keys-filter/lists"}