{"id":21675930,"url":"https://github.com/helpscout/jekyll-jolt","last_synced_at":"2026-03-13T14:31:04.722Z","repository":{"id":56878650,"uuid":"93220467","full_name":"helpscout/jekyll-jolt","owner":"helpscout","description":"Jolt ⚡️: Jekyll library for creating custom template blocks","archived":false,"fork":false,"pushed_at":"2017-08-09T14:57:09.000Z","size":63,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-20T08:08:37.718Z","etag":null,"topics":["blocks","jekyll","open-source","template-engine","templates"],"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/helpscout.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":"2017-06-03T03:20:15.000Z","updated_at":"2024-04-18T23:34:55.000Z","dependencies_parsed_at":"2022-08-20T11:40:36.355Z","dependency_job_id":null,"html_url":"https://github.com/helpscout/jekyll-jolt","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/helpscout/jekyll-jolt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fjekyll-jolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fjekyll-jolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fjekyll-jolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fjekyll-jolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helpscout","download_url":"https://codeload.github.com/helpscout/jekyll-jolt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helpscout%2Fjekyll-jolt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30468270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["blocks","jekyll","open-source","template-engine","templates"],"created_at":"2024-11-25T14:11:34.994Z","updated_at":"2026-03-13T14:31:04.702Z","avatar_url":"https://github.com/helpscout.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jolt ⚡️ [![Build Status](https://travis-ci.org/helpscout/jekyll-jolt.svg?branch=master)](https://travis-ci.org/helpscout/jekyll-jolt) [![Gem Version](https://badge.fury.io/rb/jekyll-jolt.svg)](https://badge.fury.io/rb/jekyll-jolt)\n\nJekyll library for creating custom template blocks (with YAML front matter support)\n\nFun fact: Jolt is an acronym for (Jekyll Optimized Liquid Templates)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'jekyll-jolt'\n```\n\nAnd then execute:\n```\nbundle\n```\n\nOr install it yourself as:\n```\ngem install jekyll-jolt\n```\n\n\n\n---\n\n\n\n## Documentation\n\nTemplates (`{% template %}`) work similarly to Jekyll's `{% include %}` tag. It references an existing `.html` file for markup. However, the biggest difference (and most awesome feature) between `{% template %}` vs. `{% include %}` is that templates allow for content to be used inside the block.\n\n### Setting up the template directory\n\nThe first thing you have to do to allow for template blocks to work is to create a new directory called `_templates` within your Jekyll site's source directory:\n\n```\nmy-jekyll-site/\n├── _data/\n├── _includes/\n├── _plugins/\n├── _posts/\n├── _templates/ \u003c-- Right here!\n└── index.md\n```\n\nOnce you have your directory created, add template files as regular `.html` files (just like you would `_includes/` files).\n\n\n### Creating a template file\n\nLet's create a template file called `awesome.html`, which will be added to `_templates`.\n(Full path is `_templates/awesome.html`)\n\n```markdown\n\u003cdiv class=\"awesome\"\u003e\n  {{ template.content }}\n\u003c/div\u003e\n```\n\nYou can write whatever markup you would like inside a template file. The most important thing is to include a `{{ template.content }}` tag. This destinates where your content will be rendered.\n\n\n### Using a template block\n\nAfter creating our `awesome.html` template, we can use it in any of our Jekyll pages (or posts… heck even in `_include` files).\n\nFor this example, let's add it to our `index.md` file:\n\n```markdown\n# Hello\n{% template awesome.html %}\nI am content!\n{% endtemplate %}\n```\n\nYour template content needs to begin with `{% template %}` and end with `{% endtemplate %}`. Be sure to include the path/name of the template file you wish to use.\n\nThe final rendered `.html` will look like this:\n\n```html\n\u003ch1 id=\"hello\"\u003eHello\u003c/h1\u003e\n\u003cdiv class=\"awesome\"\u003e \u003cp\u003eI am content!\u003c/p\u003e \u003c/div\u003e\n```\n\n\n## Rendering template content as HTML\n\nBy default, templates parse and render content as **markdown**. To force templates to render content as HTML, all the `parse: \"html\"` attribute to your `{% template %}` tag.\n\n```markdown\n{% template awesome.html parse: \"html\" %}\n# Title\nI am content! As HTML!\n{% endtemplate %}\n```\n\nThe final rendered `.html` will look like this:\n\n```html\n\u003cdiv class=\"awesome\"\u003e # Title I am content! As HTML! \u003c/div\u003e\n```\n\n\n\n## Using YAML front matter\n\nYou can add YAML front matter to both your template files, just like Jekyll pages and posts.\n\n```\n---\ntitle: Awesome title\n---\n\u003cdiv class=\"awesome\"\u003e\n  \u003ch1\u003e{{ template.title\u003c/h1\u003e\n\n  {{ template.content }}\n\u003c/div\u003e\n```\n\nFront matter can also be defined in your `{% template %}` block. Any front matter data defined here will override the data defined in your original template.\n\n```\n{% template awesome.html %}\n---\ntitle: Best title\n---\nI am content!\n{% endtemplate %}\n```\n\n```html\n\u003cdiv class=\"awesome\"\u003e\n  \u003ch1\u003eBest title\u003c/h1\u003e\n  \u003cp\u003eI am content!\u003c/p\u003e\n\u003c/div\u003e\n```\n\n\n## Using templates within templates\n\nYo dawg. I heard you liked templates! The template block supports nesting 👏\n\n```markdown\n{% template outer.html %}\n  {% template inner.html %}\n    Hi!\n  {% endtemplate %}\n{% endtemplate %}\n```\n\n\n---\n\n\nMore documentation coming soon!\n\n\n---\n\n\n## Note\n\nI am **not** a Ruby developer. (My background is mostly with Javascript). I wrote this plugin based on experimentation and combing through [Jekyll's](https://github.com/jekyll/jekyll) and [Liquid's](https://github.com/Shopify/liquid) source code + documentation. I'm sure there's probably code in there somewhere that's offensive to Ruby devs.\n\nWe've been using `{% template %}` for many months now on the [Help Scout website](https://www.helpscout.net/), and it's been working great! We haven't noticed any slowdowns in build times (and we use **a lot** of templates).\n\n\n---\n\n\n## Thanks ❤️\nMany thanks to [@alisdair](https://github.com/alisdair) for his help with code review/testing + [@hownowstephen](https://github.com/hownowstephen) for his help with Ruby things.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpscout%2Fjekyll-jolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelpscout%2Fjekyll-jolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelpscout%2Fjekyll-jolt/lists"}