{"id":20206533,"url":"https://github.com/useflyyer/flyyer-ruby-liquid","last_synced_at":"2026-05-13T23:36:46.067Z","repository":{"id":56846703,"uuid":"289768159","full_name":"useflyyer/flyyer-ruby-liquid","owner":"useflyyer","description":"Liquid helpers to create https://flyyer.io URLs | Generate social share images with web technologies","archived":false,"fork":false,"pushed_at":"2020-12-19T13:47:42.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-03T00:42:02.488Z","etag":null,"topics":["flyyer","gem","image-generator","liquid","open-graph","ruby","seo","shopify","twitter-cards"],"latest_commit_sha":null,"homepage":"https://flayyer.com","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/useflyyer.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":"2020-08-23T21:19:06.000Z","updated_at":"2023-10-27T20:58:30.000Z","dependencies_parsed_at":"2022-09-09T00:52:45.993Z","dependency_job_id":null,"html_url":"https://github.com/useflyyer/flyyer-ruby-liquid","commit_stats":null,"previous_names":["flayyer/flayyer-ruby-liquid"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/useflyyer/flyyer-ruby-liquid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-ruby-liquid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-ruby-liquid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-ruby-liquid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-ruby-liquid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/useflyyer","download_url":"https://codeload.github.com/useflyyer/flyyer-ruby-liquid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/useflyyer%2Fflyyer-ruby-liquid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33004602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"ssl_error","status_checked_at":"2026-05-13T13:14:51.610Z","response_time":115,"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":["flyyer","gem","image-generator","liquid","open-graph","ruby","seo","shopify","twitter-cards"],"created_at":"2024-11-14T05:24:40.268Z","updated_at":"2026-05-13T23:36:46.045Z","avatar_url":"https://github.com/useflyyer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flayyer-ruby-liquid (flayyer_liquid)\n\nThis gem is agnostic to any Ruby framework and is meant to be used alongside [shopify/liquid](https://github.com/Shopify/liquid).\n\nTo create a FLAYYER template please refer to: [flayyer.com](https://flayyer.com?ref=flayyer-ruby-liquid)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'flayyer'\ngem 'flayyer_liquid'\n```\n\nAnd then execute:\n\n```sh\nbundle install\n```\n\nOr install it yourself as:\n\n```sh\ngem install flayyer flayyer_liquid\n```\n\n## Usage\n\nAfter installing the gem you need to register our custom tag to render Flayyer urls. You can do this on any file you are setting up liquid or any config files that executes when starting up the application.\n\n```ruby\nrequire 'flayyer_liquid'\n\nLiquid::Template.register_tag('flayyer', FlayyerLiquid::FlayyerTag)\n```\n\nJust for reference, the programmatic usage is:\n\n```ruby\n# Register tag\nLiquid::Template.register_tag('flayyer', FlayyerLiquid::FlayyerTag)\n\n# Set defaults\ntemplate = Liquid::Template.parse(\"{% flayyer tenant: 'tenant', deck: 'my-deck', template: 'post' %}\")\n\n# Set variables and also you can override defaults by prefixing liquid variables with `flayyer_`\nurl = template.render('flayyer_variables' =\u003e { title: 'Hello world!' })\nurl = template.render({ 'flayyer_variables' =\u003e { title: 'Hello world!' }, 'flayyer_template' =\u003e 'gallery', 'flayyer_extension' =\u003e 'png' })\n```\n\nFor convenience, adicional variables passed to `{% flayyer ... %}` tag will be treated as Flayyer variables. This is useful if your Flayyer template has a title variable, here is an example:\n\n```ruby\ntemplate = Liquid::Template.parse(\n  \"{% flayyer tenant: 't', deck: 'd', template: 'post', title: 'My Post' %}\"\n)\n```\n\nThis works with Liquid variables:\n\n```ruby\ntemplate = Liquid::Template.parse(\n  \"{% flayyer tenant: 't', deck: 'd', template: 'post', title: '{{ post.title }}' %}\"\n)\nurl = template.render('post' =\u003e { title: 'My Post' })\n```\n\n### Use quotes around Liquid variables\n\nPrevent this common mistake:\n\n```ruby\n# This is wrong ❌\n{% flayyer title: {{ post.title }} %}\n```\n\n```ruby\n# This is correct ✅\n{% flayyer title: '{{ post.title }}' %}\n```\n\n**IMPORTANT: variables must be serializable.**\n\n## Liquid templates\n\nHere is an example:\n\n```html\n\u003chead\u003e\n  \u003cmeta\n    property=\"og:image\"\n    content=\"{% flayyer tenant: 't', deck: 'd', template: 'product', title: '{{ product.title }}', description: '{{ product.description }}' %}\"\n  \u003e\n\u003c/head\u003e\n```\n\n## Shopify Integration\n\n\u003e Based on https://shopify.github.io/liquid-code-examples/example/open-graph-tags\n\nFeel free to change images sizes from the filter [`img_url`](https://shopify.dev/docs/themes/liquid/reference/filters/url-filters) depending of how your Flayyer templates renders each type of preview.\n\n```html\n{%- assign og_title = page_title -%}\n{%- assign og_url = canonical_url -%}\n{%- assign og_type = 'website' -%}\n{%- assign og_description = page_description | default: shop.description | default: shop.name -%}\n\n{%- if settings.share_image -%}\n  {%- capture og_image_tags -%}\n    \u003c--! FLAYYER integration starts --\u003e\n    {%- assign original_image = settings.share_image | img_url: '1200x630' -%}\n    \u003cmeta\n      property=\"og:image\"\n      content=\"{% flayyer tenant: 'tenant', deck: 'deck', template: 'main', title: '{{ og_title }}', image: '{{ original_image }}' %}\"\n    \u003e\n    \u003c--! FLAYYER integration ends --\u003e\n  {%- endcapture -%}\n{%- endif -%}\n\n{%- case template.name -%}\n  {%- when 'product' -%}\n    {%- assign og_title = product.title | strip_html -%}\n    {%- assign og_type = 'product' -%}\n\n    {%- if product.images.size \u003e 0 -%}\n      {%- capture og_image_tags -%}\n        {%- for image in product.images limit:3 -%}\n          \u003c--! FLAYYER integration starts --\u003e\n          {%- assign original_image = image.src | product_img_url: '800x800' -%}\n          \u003cmeta\n            property=\"og:image\"\n            content=\"{% flayyer tenant: 'tenant', deck: 'deck', template: 'main', title: '{{ og_title }}', image: '{{ original_image }}' %}\"\n          \u003e\n          \u003c--! FLAYYER integration ends --\u003e\n        {%- endfor -%}\n      {%- endcapture -%}\n    {%- endif -%}\n\n  {%- when 'article' -%}\n    {%- assign og_title = article.title | strip_html -%}\n    {%- assign og_type = 'article' -%}\n    {%- assign og_description = article.excerpt_or_content | strip_html -%}\n\n    {%- if article.image -%}\n      {%- capture og_image_tags -%}\n        \u003c--! FLAYYER integration starts --\u003e\n        {%- assign original_image = article.src | product_img_url: '800x800' -%}\n        \u003cmeta\n          property=\"og:image\"\n          content=\"{% flayyer tenant: 'tenant', deck: 'deck', template: 'main', title: '{{ og_title }}', description: '{{ og_description }}', image: '{{ original_image }}' %}\"\n        \u003e\n        \u003c--! FLAYYER integration ends --\u003e\n      {%- endcapture -%}\n    {%- endif -%}\n\n  {%- when 'collection' -%}\n    {%- assign og_title = collection.title | strip_html -%}\n    {%- assign og_type = 'product.group' -%}\n\n    {%- if collection.image -%}\n      {%- capture og_image_tags -%}\n        \u003c--! FLAYYER integration starts --\u003e\n        {%- assign original_image = collection.src | product_img_url: '800x800' -%}\n        \u003cmeta\n          property=\"og:image\"\n          content=\"{% flayyer tenant: 'tenant', deck: 'deck', template: 'main', title: '{{ og_title }}', image: '{{ original_image }}' %}\"\n        \u003e\n        \u003c--! FLAYYER integration ends --\u003e\n      {%- endcapture -%}\n    {%- endif -%}\n\n  {%- when 'password' -%}\n    {%- assign og_title = shop.name -%}\n    {%- assign og_url = shop.url -%}\n    {%- assign og_description = shop.description | default: shop.name -%}\n\n{%- endcase -%}\n\n\u003cmeta property=\"og:site_name\" content=\"{{ shop.name }}\"\u003e\n\u003cmeta property=\"og:url\" content=\"{{ og_url }}\"\u003e\n\u003cmeta property=\"og:title\" content=\"{{ og_title }}\"\u003e\n\u003cmeta property=\"og:type\" content=\"{{ og_type }}\"\u003e\n\u003cmeta property=\"og:description\" content=\"{{ og_description }}\"\u003e\n\n{%- if template.name == 'product' -%}\n  \u003cmeta property=\"og:price:amount\" content=\"{{ product.price | money_without_currency | strip_html }}\"\u003e\n  \u003cmeta property=\"og:price:currency\" content=\"{{ shop.currency }}\"\u003e\n{%- endif -%}\n\n{{ og_image_tags }}\n\n{%- unless settings.social_twitter_link == blank -%}\n  \u003cmeta name=\"twitter:site\" content=\"{{ settings.social_twitter_link | split: 'twitter.com/' | last | prepend: '@' }}\"\u003e\n{%- endunless -%}\n\n\u003cmeta name=\"twitter:card\" content=\"summary_large_image\"\u003e\n\u003cmeta name=\"twitter:title\" content=\"{{ og_title }}\"\u003e\n\u003cmeta name=\"twitter:description\" content=\"{{ og_description }}\"\u003e\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/flayyer/flayyer-ruby-liquid.\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%2Fuseflyyer%2Fflyyer-ruby-liquid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuseflyyer%2Fflyyer-ruby-liquid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseflyyer%2Fflyyer-ruby-liquid/lists"}