{"id":13612546,"url":"https://github.com/mslinn/jekyll_nth","last_synced_at":"2025-11-20T05:04:19.072Z","repository":{"id":56878698,"uuid":"471467378","full_name":"mslinn/jekyll_nth","owner":"mslinn","description":"Liquid filter that returns item n of a Ruby array, origin 1.","archived":false,"fork":false,"pushed_at":"2023-11-11T21:37:35.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-14T15:51:12.595Z","etag":null,"topics":["array","jekyll","jekyll-filter","jekyll-plugin"],"latest_commit_sha":null,"homepage":"https://www.mslinn.com/jekyll_plugins/jekyll_nth.html","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/mslinn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-18T17:58:22.000Z","updated_at":"2024-01-14T12:46:59.000Z","dependencies_parsed_at":"2024-01-14T04:58:00.002Z","dependency_job_id":"ea212e6e-c0e1-45c5-949b-ed824a2108ee","html_url":"https://github.com/mslinn/jekyll_nth","commit_stats":{"total_commits":26,"total_committers":2,"mean_commits":13.0,"dds":"0.34615384615384615","last_synced_commit":"7b87cdb745d6339c671260350e84b6e02093929e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_nth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_nth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_nth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_nth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mslinn","download_url":"https://codeload.github.com/mslinn/jekyll_nth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240831380,"owners_count":19864718,"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":["array","jekyll","jekyll-filter","jekyll-plugin"],"created_at":"2024-08-01T20:00:31.413Z","updated_at":"2025-11-20T05:04:19.028Z","avatar_url":"https://github.com/mslinn.png","language":"Ruby","funding_links":[],"categories":["Coding Support for Plugins \u0026amp; Liquid Programming"],"sub_categories":[],"readme":"# `jekyll_nth` [![Gem Version](https://badge.fury.io/rb/jekyll_nth.svg)](https://badge.fury.io/rb/jekyll_nth)\n\n`jekyll_nth` provides two Jekyll filter plugin that manipulate arrays.\n\n* `nth` returns item `n` of the array, origin 0.\n* `tail` returns the remainder of the array after the first element.\n\n\n## Usage\n\n```html\n{{ [1, 2, 3, 4, 5] | nth: 2 }}  # returns 3\n{{ [1, 2, 3, 4, 5] | nth: -1 }} # returns 5\n{{ [1, 2, 3, 4, 5] | nth: 99 }} # throws exception\n```\n\n:warning: Important: the name of the filter must be followed by a colon (:). If you fail to do that an error will be generated and the Jekyll site building process will halt. The error message looks something like this: `Liquid Warning: Liquid syntax error (line 285): Expected end_of_string but found string in \"{{ [1, 2, 3, 4, 5] | nth: '2' }}\" in /some_directory/some_files.html Liquid Exception: Liquid error (line 285): wrong number of arguments (given 1, expected 2) in /some_directory/some_file.html Error: Liquid error (line 285): wrong number of arguments (given 1, expected 2)`\n\n```html\n{{ [1, 2, 3, 4, 5] | tail }}  # returns [2, 3, 4, 5]\n{{ [1] | tail }}              # returns []\n{{ [] | tail }}               # throws exception\n```\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'jekyll_nth'\n```\n\nAnd then execute:\n\n```shell\n$ bundle\n```\n\n\n## Additional Information\n\nMore information is available on\n[Mike Slinn\u0026rsquo;s website](https://www.mslinn.com/blog/2020/10/03/jekyll-plugins.html).\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\n\nYou can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\n\n### Build and Install Locally\n\nTo build and install this gem onto your local machine, run:\n\n```shell\n$ bundle exec rake install\njekyll_nth 1.0.0 built to pkg/jekyll_nth-0.1.0.gem.\njekyll_nth (1.0.0) installed.\n```\n\nExamine the newly built gem:\n\n```shell\n$ gem info jekyll_nth\n\n*** LOCAL GEMS ***\n\njekyll_nth (1.0.0)\n    Author: Mike Slinn\n    Homepage:\n    https://github.com/mslinn/jekyll_nth\n    License: MIT\n    Installed at: /home/mslinn/.gems\n\n    Generates Jekyll logger with colored output.\n```\n\n\n### Build and Push to RubyGems\n\nTo release a new version,\n\n1. Update the version number in `version.rb`.\n2. Commit all changes to git; if you don't the next step might fail with an unexplainable error message.\n3. Run the following:\n\n   ```shell\n   $ bundle exec rake release\n   ```\n\n   The above creates a git tag for the version, commits the created tag,\n   and pushes the new `.gem` file to [RubyGems.org](https://rubygems.org).\n\n\n## Contributing\n\n1. Fork the project\n2. Create a descriptively named feature branch\n3. Add your feature\n4. Submit a pull request\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslinn%2Fjekyll_nth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmslinn%2Fjekyll_nth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslinn%2Fjekyll_nth/lists"}