{"id":15672646,"url":"https://github.com/kevindew/jekyll-srcset-tag","last_synced_at":"2025-05-06T22:08:15.602Z","repository":{"id":56878848,"uuid":"45806635","full_name":"kevindew/jekyll-srcset-tag","owner":"kevindew","description":"Bring srcset images into your Jekyll project","archived":false,"fork":false,"pushed_at":"2019-08-06T22:11:57.000Z","size":18,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T22:08:03.424Z","etag":null,"topics":[],"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/kevindew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-09T00:53:37.000Z","updated_at":"2019-08-06T22:11:58.000Z","dependencies_parsed_at":"2022-08-20T11:40:28.049Z","dependency_job_id":null,"html_url":"https://github.com/kevindew/jekyll-srcset-tag","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevindew%2Fjekyll-srcset-tag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevindew%2Fjekyll-srcset-tag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevindew%2Fjekyll-srcset-tag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevindew%2Fjekyll-srcset-tag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevindew","download_url":"https://codeload.github.com/kevindew/jekyll-srcset-tag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252776581,"owners_count":21802468,"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":[],"created_at":"2024-10-03T15:29:25.585Z","updated_at":"2025-05-06T22:08:15.580Z","avatar_url":"https://github.com/kevindew.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jekyll Srcset Tag\n\nThis gem allows you to use the [srcset](https://responsiveimages.org/) variety of responsive images in your Jekyll project.\nIt takes a path to a fullsize image and will generate resized images at the sizes and ppi's specified in your jekyll output.\n\nIt's still early days on this, seems to work in a quick build, but we're getting started putting it through something more substantial that should help improve it.\n\nIt borrows heavily from the work done in [Jekyll Picture Tag](https://github.com/robwierzbowski/jekyll-picture-tag) by Rob Wierzbowski - It's origins lie in a [messy hacked version](https://gist.github.com/kevindew/99a955b3f9e06c0a3f2f) of that plugin. This differs by supporting srcset and a few other tweaks that resolved some of the problems I was having with it.\n\n## Installation\n\n### Bundler\n\n#### Already Have a Gemfile?\n\nAdd the following to your `Gemfile`\n\n    gem 'jekyll-srcset-tag', '~\u003e 0.1'\n\nThen run\n\n    $ bundle install\n\n#### No Gemfile?\n\nCreate a plugin to load bundler gems in your `_plugins` directory\n\n    # _plugins/bundler.rb\n    require \"rubygems\"\n    require \"bundler/setup\"\n    Bundler.require(:default)\n\nCreate a `Gemfile`\n\n    # Gemfile\n    source 'https://rubygems.org'\n    gem 'jekyll-srcset-tag', '~\u003e 0.1'\n\nThen run\n\n    $ bundle install\n\n### System Gem\n\nInstall the gem\n\n    gem install 'jekyll-srcset-tag'\n\nCreate a plugin for it\n\n    # _plugins/jekyll_srcset_tag.rb\n    require \"rubygems\"\n    require \"jekyll-srcset-tag\"\n\n## Usage\n\n### Set up your config\n\nBy default this plugin expects to find your source images in _assets/images/fullsize and will output them in an\nimages/generated directory.\n\nYou can tweak this in your config\n\n    # _config.yml\n    srcset:\n        source: _assets/images/fullsize\n        output: images/resized\n\nYou should add an entry to keep_files, otherwise on incremental builds jekyll will delete the files\n\n    # _config.yml\n    keep_files: ['images/generated']\n\n### Put it in your liquid templates\n\nExample syntax:\n\n    {% srcset movies/terminator.jpg ppi:1,2 alt='Terminator' %}\n        {% srcset_source media:'(min-width: 400px)' size:'512px' width:512 %}\n        {% srcset_source width:320 %}\n    {% endsrcset %}\n\nThis will generate the following HTML\n\n    \u003cimg src=\"/images/generated/movies/terminator.jpg-5c03014/320x256.jpg\" srcset=\"/images/generated/movies/terminator.jpg-5c03014/1024x819.jpg 1024w, /images/generated/movies/terminator.jpg-5c03014/512x410.jpg 512w, /images/generated/movies/terminator.jpg-5c03014/640x512.jpg 640w, /images/generated/movies/terminator.jpg-5c03014/320x256.jpg 320w\" sizes=\"(min-width: 400px) 512px, 100vw\" alt='Terminator' /\u003e\n\nAnd the following images\n\n    .jekyll/images/generated/movies/terminator.jpg-5c03014/320x256.jpg\n    .jekyll/images/generated/movies/terminator.jpg-5c03014/512x410.jpg\n    .jekyll/images/generated/movies/terminator.jpg-5c03014/640x512.jpg\n    .jekyll/images/generated/movies/terminator.jpg-5c03014/1024x819.jpg\n\nThe syntax for `srcset` is `{% srcset path/to/your/image.jpg [ppi:x,y,z] [html attributes] %}{% endsrcset %}`\n\nThe syntax for `srcset_source` is `{% srcset_source [media:string] [size:string] [width:int] [height:int] %}`\n\nYou can optionally add `fallback:true` as an option to srcset_source to specify which image path will be output in the src attribute and thus rendered on older browsers.\n\n## Contribute\n\nPlease do in anyway you like - I bet making this doc better would be a good place to start. Pull requests welcome.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevindew%2Fjekyll-srcset-tag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevindew%2Fjekyll-srcset-tag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevindew%2Fjekyll-srcset-tag/lists"}