{"id":13612114,"url":"https://github.com/paulrobertlloyd/jekyll-figure","last_synced_at":"2025-04-30T12:35:07.688Z","repository":{"id":2302963,"uuid":"46190851","full_name":"paulrobertlloyd/jekyll-figure","owner":"paulrobertlloyd","description":"A liquid tag for Jekyll that generates \u003cfigure\u003e elements","archived":false,"fork":false,"pushed_at":"2024-06-24T09:59:15.000Z","size":20,"stargazers_count":52,"open_issues_count":6,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T13:21:54.983Z","etag":null,"topics":["jekyll-plugin"],"latest_commit_sha":null,"homepage":"","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/paulrobertlloyd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2015-11-14T20:27:20.000Z","updated_at":"2024-09-25T11:40:35.000Z","dependencies_parsed_at":"2022-08-06T12:15:09.883Z","dependency_job_id":"f5bc6468-8c7e-4576-b645-337d09232741","html_url":"https://github.com/paulrobertlloyd/jekyll-figure","commit_stats":{"total_commits":17,"total_committers":5,"mean_commits":3.4,"dds":0.2941176470588235,"last_synced_commit":"593b41e4f87c3de0fd49a371a7f63e2151e55721"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrobertlloyd%2Fjekyll-figure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrobertlloyd%2Fjekyll-figure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrobertlloyd%2Fjekyll-figure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulrobertlloyd%2Fjekyll-figure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulrobertlloyd","download_url":"https://codeload.github.com/paulrobertlloyd/jekyll-figure/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235426492,"owners_count":18988420,"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":["jekyll-plugin"],"created_at":"2024-08-01T20:00:22.689Z","updated_at":"2025-01-24T11:08:15.157Z","avatar_url":"https://github.com/paulrobertlloyd.png","language":"Ruby","funding_links":[],"categories":["Figures \u0026 Captions"],"sub_categories":[],"readme":"# jekyll-figure\n\nA liquid tag for Jekyll that generates `\u003cfigure\u003e` elements.\n\n[![Gem version](https://img.shields.io/gem/v/jekyll-figure.svg)](https://rubygems.org/gems/jekyll-figure)\n[![Build status](https://github.com/paulrobertlloyd/jekyll-figure/workflows/test/badge.svg)](https://github.com/paulrobertlloyd/jekyll-figure/actions)\n\n## Installation\n\n1. Add `gem 'jekyll-figure'` to your site’s Gemfile and run `bundle`\n2. Add the following to your site’s `_config.yml`:\n\n```yaml\nplugins:\n  - jekyll-figure\n```\n\nNote: If you are using a Jekyll version less than 3.5.0, use the `gems` key instead of `plugins`.\n\n## Usage\n\nThis plugin provides a liquid tag that enables you to generate a `\u003cfigure\u003e` element. It takes optional `caption` and `class` parameters.\n\n```liquid\n{% figure [caption:\"Caption (markdown)\"] [class:\"class1 class2\"] %}\nFigure content (markdown)\n{% endfigure %}\n```\n\n### Examples\n\nIn simplest usage:\n\n```liquid\n{% figure %}\nContent\n{% endfigure %}\n```\n\n```html\n\u003cfigure\u003e\n  \u003cp\u003eContent\u003c/p\u003e\n\u003c/figure\u003e\n```\n\nYou can provide a caption, for which any markdown will be rendered:\n\n```liquid\n{% figure caption:\"*Markdown* caption\" %}\nContent\n{% endfigure %}\n```\n\n```html\n\u003cfigure\u003e\n  \u003cp\u003eContent\u003c/p\u003e\n  \u003cfigcaption\u003e\u003cem\u003eMarkdown\u003c/em\u003e caption\u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\nYou can also provide a class name(s) for CSS styling:\n\n```liquid\n{% figure caption:\"A caption\" class:\"classname\" %}\nContent\n{% endfigure %}\n```\n\n```html\n\u003cfigure class=\"classname\"\u003e\n  \u003cp\u003eContent\u003c/p\u003e\n  \u003cfigcaption\u003eA caption\u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\nThe `caption` parameter also accepts liquid markup:\n\n```liquid\n{% figure caption:\"{{ page.title }}\" %}\nContent\n{% endfigure %}\n```\n\n```html\n\u003cfigure\u003e\n  \u003cp\u003eContent\u003c/p\u003e\n  \u003cfigcaption\u003eThe title of my page\u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\nYou can also add labels and reference them:\n\n```liquid\n{% figure caption:\"A caption.\" label:example %}\nAn example figure that can be referenced later.\n{% endfigure %}\n\nYou can see an example in {% figref example %}.\n```\n\n```html\n\u003cfigure id=\"example\"\u003e\n  \u003cp\u003eAn example figure that can be referenced later.\u003c/p\u003e\n  \u003cfigcaption\u003e\u003cem\u003eFigure 1:\u003c/em\u003e A caption.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cp\u003eYou can see an example in \u003ca href=\"#example\"\u003efigure 1\u003c/a\u003e\u003c/p\u003e\n```\n\nThe word ‘Figure’ in the figcaption is translated according to the `lang` you set in the yaml header of your post. If your language is not supported simple set `figure` to the yaml header of your post to the value you want to use instead of ‘Figure’.\n\n## Configuration\n\nAny markdown provided within the `{% figure %}` block is rendered using Jekyll’s Markdown parser, [Kramdown](https://kramdown.gettalong.org). However, this means images and other content will be wrapped within `\u003cp\u003e` tags, like so:\n\n```html\n\u003cfigure\u003e\n  \u003cp\u003e\u003cimg src=\"/path/to/image.jpg\" alt=\"Image\"\u003e\u003c/p\u003e\n\u003c/figure\u003e\n```\n\nTo disable this behaviour, in your Jekyll configuration set the `paragraphs` value for this plugin to `false`:\n\n```yaml\nplugins:\n  - jekyll-figure\n\njekyll-figure:\n  paragraphs: false\n```\n\nNote however that this will remove *all* paragraph tags, even those nested within other elements.\n\n## Testing\n\n1. `bundle install`\n2. `bundle exec rake spec`\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrobertlloyd%2Fjekyll-figure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulrobertlloyd%2Fjekyll-figure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulrobertlloyd%2Fjekyll-figure/lists"}