{"id":16445753,"url":"https://github.com/mslinn/jekyll_begin_end","last_synced_at":"2026-05-18T05:46:24.362Z","repository":{"id":56878480,"uuid":"471408711","full_name":"mslinn/jekyll_begin_end","owner":"mslinn","description":"Defines Jekyll filters: append_suffix_if_does_not_start_with, begins_with, does_not_begin_with, does_not_end_with, and ends_with","archived":false,"fork":false,"pushed_at":"2025-09-29T18:42:11.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T21:51:56.953Z","etag":null,"topics":["jekyll","jekyll-filter","jekyll-filters"],"latest_commit_sha":null,"homepage":"https://www.mslinn.com/jekyll_plugins/jekyll_begin_end.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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-18T14:52:54.000Z","updated_at":"2025-09-29T18:42:14.000Z","dependencies_parsed_at":"2025-02-12T09:39:33.361Z","dependency_job_id":"ceabef5b-0866-4d20-9e3b-7a95129ffd7a","html_url":"https://github.com/mslinn/jekyll_begin_end","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"ea806cd63c79c18be60b8bda9b13749e39c6e36b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mslinn/jekyll_begin_end","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_begin_end","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_begin_end/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_begin_end/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_begin_end/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mslinn","download_url":"https://codeload.github.com/mslinn/jekyll_begin_end/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mslinn%2Fjekyll_begin_end/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33166885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: 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-filter","jekyll-filters"],"created_at":"2024-10-11T09:45:17.763Z","updated_at":"2026-05-18T05:46:24.333Z","avatar_url":"https://github.com/mslinn.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `jekyll_begin_end` [![Gem Version](https://badge.fury.io/rb/jekyll_begin_end.svg)](https://badge.fury.io/rb/jekyll_begin_end)\n\nThis Jekyll plugin defines the following filters:\n\n* `begins_with` — returns `true` if a string starts with the given substring.\n* `does_not_begin_with` — returns `false` if a string starts with the given substring.\n* `ends_with` — returns `true` if a string end with the given substring.\n* `does_not_end_with` — returns `false` if a string ends with the given substring.\n* `append_suffix_if_does_not_start_with` — appends a suffix to the given string if the string does not start with a given substring.\n\n\n## Installation\n\nAdd this line to your Jekyll project's `Gemfile`:\n\n```ruby\ngroup :jekyll_plugins do\n  gem 'jekyll_begin_end'\nend\n```\n\nAnd then execute:\n\n```shell\n$ bundle\n```\n\n\n## Syntax\n\n:warning: Important: the name of each of these filters must be followed by a colon (:).\nIf you fail to do that an error will be generated and the Jekyll site building process will halt.\nThe error message looks something like this:\n`Liquid Warning: Liquid syntax error (line 285): Expected end_of_string but found string in\n\"{{ lines | begins_with 'blah' | xml_escape }}\" in /some_directory/some_files.html Liquid Exception:\nLiquid error (line 285): wrong number of arguments (given 1, expected 2) in /some_directory/some_file.html\nError: Liquid error (line 285): wrong number of arguments (given 1, expected 2)`\n\n\n### `begins_with`\n\nFirst example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% assign isAbsolute = url | begins_with: 'http' %}\n```\n\nSecond example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% if url | begins_with: 'http' %}\n  \u003cp\u003eAbsolute\u003c/p\u003e\n{% else %}\n  \u003cp\u003eRelative\u003c/p\u003e\n{% endif %}\n```\n\n\n### `does_not_begin_with`\n\nFirst example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% assign isRelative = url | does_not_begin_with: 'http' %}\n```\n\nSecond example\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% if url | does_not_begin_with: 'http' %}\n  \u003cp\u003eRelative\u003c/p\u003e\n{% else %}\n  \u003cp\u003eAbsolute\u003c/p\u003e\n{% endif %}\n```\n\n\n### `ends_with`\n\nFirst example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% assign isDotCom = url | ends_with: '.com' %}\n```\n\nSecond example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% if url | ends_with: '.com' %}\n  \u003cp\u003e.com found\u003c/p\u003e\n{% else %}\n  \u003cp\u003eNot a .com\u003c/p\u003e\n{% endif %}\n```\n\n### `does_not_end_with`\n\nFirst example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% assign isNotDotCom = url | does_not_end_with: '.com' %}\n```\n\nSecond example:\n\n```html\n{% assign url = \"https:/asdf.com\" %}\n{% if url | does_not_end_with: '.com' %}\n  \u003cp\u003eNot a .com\u003c/p\u003e\n{% else %}\n  \u003cp\u003e.com found\u003c/p\u003e\n{% endif %}\n```\n\n\n### `append_suffix_if_does_not_start_with`\n\nThis filter was created to make asset reloading work better.\n\nGiven a portion of `_layouts/default.html` that looks like this:\n\n```html\n{% assign csses = page.css | default: layout.css %}\n{% assign nowMillis = site.time | date: '%s' %}\n{% assign suffix = '?v=' | append: nowMillis %}\n{% for css in csses %}\n  \u003clink rel=\"stylesheet\" href=\"{{ css | append_suffix_if_does_not_start_with: 'http', suffix }}\" type=\"text/css\"\u003e\n{% endfor %}\n```\n\nAnd given `index.html` with front matter that looks like this:\n\n```html\n---\ncss: [\n  https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css,\n  /order/order.css\n]\n---\n```\n\nThe following is generated. Note that the suffix s?v=1612879301 in only applied to the relative URL for `order.css`.\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.css\" type=\"text/css\"\u003e\n\u003clink rel=\"stylesheet\" href=\"/order/order.css?v=1612879301\" type=\"text/css\"\u003e\n```\n\n\n### Additional Information\n\nMore information is available about [my Jekyll plugins](https://www.mslinn.com/jekyll/3000-jekyll-plugins.html#begin_end).\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies.\n\nThen you can run `bin/console` for an interactive prompt that will allow you to experiment using `irb`.\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\n```\n\nExamine the newly built gem:\n\n```shell\n$ gem info jekyll_begin_end\n\n*** LOCAL GEMS ***\n\njekyll_begin_end (1.0.0)\n    Author: Mike Slinn\n    Homepage:\n    https://github.com/mslinn/jekyll_begin_end\n    License: MIT\n    Installed at: /home/mslinn/.gems\n\n    Generates Jekyll logger with colored output.\n```\n\n\n### Release\n\nTo release a new version,\n\n  1. Update the version number in `version.rb`.\n  2. Describe the changes in `CHANGELOG.md`.\n  3. Commit all changes to git; if you don't the next step might fail with an unexplainable error message.\n  4. 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\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/mslinn/jekyll_begin_end.\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_begin_end","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmslinn%2Fjekyll_begin_end","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmslinn%2Fjekyll_begin_end/lists"}