{"id":13612522,"url":"https://github.com/mslinn/jekyll_all_collections","last_synced_at":"2026-02-17T16:35:48.285Z","repository":{"id":62559507,"uuid":"485776132","full_name":"mslinn/jekyll_all_collections","owner":"mslinn","description":"Provides normalized collections and extra functionality for Jekyll websites.","archived":false,"fork":false,"pushed_at":"2025-03-03T19:53:50.000Z","size":622,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T21:51:50.848Z","etag":null,"topics":["jekyll","jekyll-plugin"],"latest_commit_sha":null,"homepage":"https://www.mslinn.com/jekyll_plugins/jekyll_all_collections.html","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-04-26T12:27:31.000Z","updated_at":"2025-03-03T19:53:54.000Z","dependencies_parsed_at":"2023-11-21T15:46:46.032Z","dependency_job_id":"5f288148-adc1-49b4-aaea-655f67295848","html_url":"https://github.com/mslinn/jekyll_all_collections","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.15000000000000002","last_synced_commit":"0412440db60ff7ae23b1aee28fd12a12b3576393"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/mslinn/jekyll_all_collections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_all_collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_all_collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_all_collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_all_collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mslinn","download_url":"https://codeload.github.com/mslinn/jekyll_all_collections/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_all_collections/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29549798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["jekyll","jekyll-plugin"],"created_at":"2024-08-01T20:00:31.139Z","updated_at":"2026-02-17T16:35:43.276Z","avatar_url":"https://github.com/mslinn.png","language":"Shell","funding_links":[],"categories":["Coding Support for Plugins \u0026amp; Liquid Programming"],"sub_categories":[],"readme":"# `jekyll_all_collections` [![Gem Version](https://badge.fury.io/rb/jekyll_all_collections.svg)](https://badge.fury.io/rb/jekyll_all_collections)\n\n\n`Jekyll_all_collections` is a Jekyll plugin that includes a generator,\ntriggered by a high-priority hook, and a block tag called `all_collections`.\n\n\n## Generator\n\nThe generator adds four new attributes to\n[`site`](https://jekyllrb.com/docs/variables/#site-variables):\n`all_collections`, `all_documents`, `everything`, and `sorted_lru_files`.\n\nThese three attributes can be referenced as `site.everything`, `site.all_collections`\nand `site.all_documents`.\n\n* `all_collections` includes all documents in all collections.\n\n* `all_documents` includes `all_collections` plus all standalone pages.\n\n* `everything` includes `all_documents` plus all static files.\n\n* `sorted_lru_files` is used by a new binary search lookup for matching page suffixes.\n  Currently only `jekyll_href` and `jekyll_draft` use this feature.\n\n\n### Collection Management\n\nJekyll provides inconsistent attributes for\n[`site.pages`](https://jekyllrb.com/docs/pages/),\n[`site.posts`](https://jekyllrb.com/docs/posts/) and\n[`site.static_files`](https://jekyllrb.com/docs/static-files/).\n\n\n* While the `url` attributes of items in `site.posts` and `site.pages` start with a slash (/),\n  `site.static_files` items do not have a `url` attribute.\n* Static files have a `relative_path` attribute, which starts with a slash (/),\n  but although that attribute is also provided in `site.posts` and `site.pages`,\n  those values do not start with a slash.\n* Paths ending with a slash (`/`) imply that a file called `index.html` should be fetched.\n* HTML redirect files created by the\n  [`jekyll-redirect-from`](https://github.com/jekyll/jekyll-redirect-from) Jekyll plugin,\n  which are included in `site.static_files`, should be ignored.\n\nThese inconsistencies mean that combining the standard three collections of files\nprovided as `site` attributes will create a new collection that is difficult\nto process consistently:\n\n```ruby\n# This pseudocode creates `oops`, which is problematic to process consistently\noops = site.all_collections + site.pages + site.static_files\n```\n\n`oops`, above, is difficult to process because of inconsistencies in the provided attributes\nand how the attributes are constructed.\n\n\n### Solving The Problem\n\nThe generator normalizes these inconsistencies by utilizing the `APage` class\nand filtering out HTML redirect files.\n\nThe `all_collections` collection contains `APage` representations of `site.collections`.\n\nThe `all_documents` collection contains `APage` representations of `site.pages`.\n\nThe `everything` collection contains `APage` representations of:\n\n```text\n# Pseudocode\nsite.collections + site.pages + site.static_files - HTML_redirect_files\n```\n\n\n## The APage Class\n\nThe `site.all_collections`, `site.all_documents` and `site.everything` attributes\nconsist of arrays of [`APage`](lib/hooks/a_page.rb) instances.\n\nThe `APage` class has the following attributes:\n`content` (HTML or Markdown), `data` (array), `date` (Ruby Date), `description`, `destination`,\n`draft` (Boolean), `ext`, `href`, `label`, `last_modified` or `last_modified_at` (Ruby Date),\n`layout`, `origin`, `path`, `relative_path`, `tags`, `title`, `type`, and `url`.\n\n* `href` always starts with a slash.\n  This value is consistent with `a href` values in website HTML.\n  Paths ending with a slash (`/`) have `index.html` appended so the path specifies an actual file.\n\n* `origin` indicates the original source of the item.\n  Possible values are `collection`, `individual_page` and `static_file`.\n  Knowing the origin of each item allows code to process each type of item appropriately.\n\n\n## Block Tag\n\nThe `all_collections` block tag creates a formatted listing of Jekyll files.\nThe ordering is configurable; by default, the listing is sorted by `date`, newest to oldest.\nThe `all_collections` tag has a `data_source` parameter that specifies which new property to report on\n(`all_collections`, `all_documents`, or `everything`).\n\n\n## Installation\n\n### Installing In A Jekyll Website\n\n1. Add the CSS found in\n   [`demo/assets/css/jekyll_all_collections.css`](demo/assets/css/jekyll_all_collections.css)\n   to your Jekyll layout(s).\n\n2. Add the following to your Jekyll website's `Gemfile`, within the `jekyll_plugins` group:\n\n   ```ruby\n   group :jekyll_plugins do\n     gem 'jekyll_all_collections', '\u003e= 0.3.8'\n     gem 'jekyll_draft', '\u003e=2.1.0'\n   end\n   ```\n\n3. Type:\n\n   ```shell\n   $ bundle\n   ```\n\n\n### Installing As a Gem Dependency\n\n1. Add the following to your gem\u0026rsquo;s `.gemspec`:\n\n   ```ruby\n   spec.add_dependency 'jekyll_all_collections', '\u003e= 0.3.8'\n   spec.add_dependency 'jekyll_draft', '\u003e=2.1.0'\n   ```\n\n2. Type:\n\n   ```shell\n   $ bundle\n   ```\n\n\n## Demo\n\nThe [`demo`](./demo) directory contains a demonstration website, which uses the plugin.\nTo run, type:\n\n```console\n$ bin/setup\n$ demo/_bin/debug -r\n```\n\nNow point your web browser to http://localhost:4444\n\n\n## Requirements\n\nAll the pages in the Jekyll website must have an implicit date\n(for example, all posts are assigned this property by Jekyll),\nor an explicit `date` set in front matter, like this:\n\n```html\n---\ndate: 2022-01-01\n---\n```\n\nIf a front matter variable called `last_modified` or `last_modified_at` exists,\nits value will be converted to a Ruby `Date`:\n\n```html\n---\nlast_modified: 2023-01-01\n---\n```\n\nOr:\n\n```html\n---\nlast_modified_at: 2023-01-01\n---\n```\n\nOtherwise, if `last_modified` or `last_modified_at` is not present in the front matter for a page,\nthe `date` value will be used last modified date value.\n\n\n## Usage\n\n### New `Site` Attributes\n\nNo explicit initialization or setup is required.\nJekyll plugins can access the value of\n`site.all_collections`, `site.all_documents` and `site.everything`;\nhowever, Liquid code in Jekyll pages and documents cannot.\n\n\n### Excluding Files\n\nThere are two ways to exclude files from the new `site` attributes.\n\n1) The [`exclude` entry in `_config.yml`](https://jekyllrb.com/docs/configuration/options#global-configuration)\n   can be used as it normally would.\n\n2) Adding the following entry to a page\u0026rsquo;s front matter causes that page to be excluded\n  from the collection created by this plugin:\n\n   ```html\n   ---\n   exclude_from_all: true\n   ---\n   ```\n\n\n### Plugin Usage\n\nJekyll generators and tags receive an enhanced version of the `site` Jekyll variable.\n\n\n#### From a Custom Plugin\n\nIn the following example of how to use the `all_collections` plugin in a custom plugin,\nthe `do_something_with` function processes all `Jekyll::Page`s, `Jekyll:Document`s, and static files.\n\n```ruby\n@site.everything.each do |apage|\n  do_something_with apage\nend\n```\n\n\n#### Using the Block Tag\n\nThe general form of the Jekyll tag, including all options, is:\n\n```html\n{% all_collections\n  date_column='date|last_modified'\n  heading='All Posts'\n  id='asdf'\n  sort_by='SORT_KEYS'\n%}\n```\n\n\n##### `date_column` Attribute\n\nOne of two date columns can be displayed in the generated HTML:\neither `date` (when the article was originally written),\nor `last_modified`.\nThe default value for the `date_column` attribute is `date`.\n\n\n##### `heading` Attribute\n\nIf no `heading` attribute is specified, a heading will automatically be generated, which contains the `sort_by` values,\nfor example:\n\n```html\n{% all_collections id='abcdef' sort_by=\"last_modified\" %}\n```\n\nThe above generates a heading like:\n\n```html\n\u003ch2 id=\"abcdef\"\u003eAll Posts Sorted By last_modified\u003c/h2\u003e\n```\n\nTo suppress both a `h2` heading (and the enclosed `id`) from being generated,\nspecify an empty string for the value of `heading`:\n\n```html\n{% all_collections heading='' %}\n```\n\n\n##### `id` Attribute\n\nIf your Jekyll layout employs [`jekyll-toc`](https://github.com/allejo/jekyll-toc), then `id` attributes are important.\nThe `jekyll-toc` include checks for `id` attributes in `h2` ... `h6` tags, and if found,\nand if the attribute value is enclosed in double quotes\n(`id=\"my_id\"`, not single quotes like `id='my_id'`),\nthen the heading is included in the table of contents.\n\nTo suppress an `id` from being generated,\nand thereby preventing the heading from appearing in the automatically generated table of contents from `jekyll-toc`,\nspecify an empty string for the value of `id`, like this:\n\n```html\n{% all_collections id='' %}\n```\n\n\n##### `SORT_KEYS` Values\n\n`SORT_KEYS` specifies how to sort the collection.\nValues can include one or more of the following attributes:\n`date`, `destination`, `draft`, `label`, `last_modified`, `last_modified_at`, `path`, `relative_path`,\n`title`, `type`, and `url`.\nAscending sorts are the default; however, a descending sort can be achieved by prepending `-` before an attribute.\n\nTo specify more than one sort key, provide a comma-delimited string of values.\nIncluded spaces are ignored.\nFor example, specify the primary sort key as `draft`,\nthe secondary sort key as `last_modified`,\nand the tertiary key as `label`:\n\n```html\n{% all_collections\n  date_column='last_modified'\n  heading='All Posts'\n  id='asdf'\n  sort_by='draft, last_modified, label'\n%}\n```\n\n\n#### Liquid Usage Examples\n\nHere is a short Jekyll page, including front matter,\ndemonstrating this plugin being invoked with all default attribute values:\n\n```html\n---\ndescription: \"\n  Dump of all collections, sorted by date originally written, newest to oldest.\n  The heading text will be \u003ccode\u003eAll Posts Sorted By -date\u003c/code\u003e\n\"\nlayout: default\ntitle: Testing, 1, 2, 3\n---\n{% all_collections %}\n```\n\nFollowing are examples of how to specify the sort parameters.\n\n**Explicitly express the default sort**\u003cbr\u003e\n(sort by the date originally written, newest to oldest):\n\n```html\n{% all_collections sort_by=\"-date\" %}\n```\n\nSort by date, from oldest to newest:\n\n```html\n{% all_collections sort_by=\"date\" %}\n```\n\n**Sort by the date last modified, oldest to newest:**\n\n```html\n{% all_collections sort_by=\"last_modified\" %}\n```\n\n**Sort by the date last modified, newest to oldest:**\n\n```html\n{% all_collections sort_by=\"-last_modified\" %}\n```\n\n**Several attributes can be specified as sort criteria**\u003cbr\u003e\nby passing them as a comma-delimited string.\nIncluded spaces are ignored:\n\n```html\n{% all_collections sort_by=\"-last_modified, -date\" %}\n{% all_collections sort_by=\"-last_modified, title\" %}\n{% all_collections sort_by=\"-last_modified, -date, title\" %}\n```\n\n**The following two examples produce the same output:**\n\n```html\n{% all_collections sort_by=\"-last_modified,-date\" %}\n{% all_collections sort_by=\"-last_modified, -date\" %}\n```\n\n\n## Debugging\n\nYou can control the verbosity of log output by adding the following to `_config.yml` in your Jekyll project:\n\n```yaml\nplugin_loggers:\n  AllCollectionsTag::AllCollectionsTag: warn\n```\n\n1. First set breakpoints in the Ruby code that interests you.\n\n2. You have several options for initiating a debug session:\n\n   1. Use the **Debug Demo** Visual Studio Code launch configuration.\n\n   2. Type the `demo/_bin/debug` command, without the `-r` options shown above.\n\n      ```console\n      ... lots of output as bundle update runs...\n      Bundle updated!\n\n      INFO PluginMetaLogger: Loaded AllCollectionsHooks v0.2.0 :site, :pre_render, :normal hook plugin.\n      INFO PluginMetaLogger: Loaded DraftFilter plugin.\n      INFO PluginMetaLogger: Loaded all_collections v0.2.0 tag plugin.\n      Configuration file: /mnt/_/work/jekyll/my_plugins/jekyll_all_collections/demo/_config.yml\n                Cleaner: Removing /mnt/_/work/jekyll/my_plugins/jekyll_all_collections/demo/_site...\n                Cleaner: Removing /mnt/_/work/jekyll/my_plugins/jekyll_all_collections/demo/.jekyll-metadata...\n                Cleaner: Removing /mnt/_/work/jekyll/my_plugins/jekyll_all_collections/demo/.jekyll-cache...\n                Cleaner: Nothing to do for .sass-cache.\n      Fast Debugger (ruby-debug-ide 0.7.3, debase 0.2.5.beta2, file filtering is supported) listens on 0.0.0.0:1234\n      ```\n\n   3. Run `bin/attach` and pass the directory name of a Jekyll website that has a suitable script called `_bin/debug`.\n      The `demo` subdirectory fits this description.\n\n      ```console\n      $ bin/attach demo\n      Successfully uninstalled jekyll_all_collections-0.1.2\n      jekyll_all_collections 0.1.2 built to pkg/jekyll_all_collections-0.1.2.gem.\n      jekyll_all_collections (0.1.2) installed.\n      Fast Debugger (ruby-debug-ide 0.7.3, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234\n      ```\n\n\n3. Attach to the debugger process if required.\n  This git repo includes two [Visual Studio Code launch configurations](./.vscode/launch.json) for this purpose labeled\n  **Attach rdbg** and **Attach with ruby_lsp**.\n\n4. Point your web browser to http://localhost:4444\n\nIf a debugging session terminates abruptly and leaves ports tied up,\nrun the `demo/_bin/release_port` script.\n\n\n## Additional Information\n\nMore information is available on Mike Slinn's website about\n[Jekyll plugins](https://mslinn.com/jekyll_plugins/jekyll_all_collections.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_all_collections 0.3.8 built to pkg/jekyll_all_collections-0.3.8.gem.\njekyll_all_collections (0.3.8) installed.\n```\n\nExamine the newly built gem:\n\n```shell\n$ gem info jekyll_all_collections\n\n*** LOCAL GEMS ***\n\njekyll_all_collections (0.3.8)\n    Author: Mike Slinn\n    Homepage:\n    https://www.mslinn.com/jekyll_plugins/jekyll_all_collections.html\n    License: MIT\n    Installed at (0.3.8): /home/mslinn/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0\n\n    Provides normalized collections and extra functionality for Jekyll websites.\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. Add an entry in `CHANGELOG.md` describing the changes since the last release.\n3. Commit all changes to git; if you don't the next step might fail with a confusing error message.\n4. 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_all_collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmslinn%2Fjekyll_all_collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslinn%2Fjekyll_all_collections/lists"}