Jekyll Miscellaneous
A collection of opinionated plugins for Jekyll.
How to install
Install the gem:
gem install jekyll_miscellaneous
Or add it to your Gemfile. You can use bundle add jekyll_miscellaneous
.
Then use the plugin in your Jekyll's _config.yml
file.
plugins:
- jekyll_miscellaneous
How to use
This gem includes multiple Jekyll or Liquid plugins that you can use immediately without further configuration.
- Tags
- YouTube
- Filters
- Base64 Encode
- Base64 Decode
- Hash Color
- Regex Replace
- Clean URLs
- Truncate
- URI Encode
- Hooks
- External Links
- Mark
More to come.
YouTube
Given:
{% youtube dQw4w9WgXcQ %}
Will output:
<div class="youtube-container">
<iframe src="https://www.youtube-nocookie.com/embed/dQw4w9WgXcQ"></iframe>
</div>
Base64 Encode
Given:
{% 'Hello, World!' | base64_encode %}
Will output:
SGVsbG8sIFdvcmxkIQ==
Base64 Decode
Given:
{% 'SGVsbG8sIFdvcmxkIQ==' | base64_decode %}
Will output:
Hello, World!
Hash Color
Given:
{% 'Hello, World!' | hash_color %}
Will output:
hsl(349, 100%, 90%)
Regex Replace
Given:
{% 'Hello, World!' | regex_replace '$Hello', 'Goodbye' %}
Will output:
Goodbye, World!
Clean URLs
Given:
{% 'Hello, http://example.com World!' | clean_urls %}
Will output:
Hello, World!
Truncate
Given:
{% 'Hello, World!' | truncate 10 %}
{% 'Hello, World!' | truncate 10 ',' %}
{% 'Hello, World!' | truncate 10 ',' '!' %}
Will output:
Hello, ...
Hello...
Hello!
URI encode
Given:
{% 'Hello, World!' | uri_encode %}
Will output:
Hello%2C%20World%21
External links
With the configuration:
base_url: https://kinduff.com
Given:
<p>
Link to the
<a href="https://example.com">example</a>.
</p>
Will output:
<p>
Link to the
<a href="https://example.com" rel="external" target="_blank">example ⧉</a>.
</p>
More in the documentation.
Mark
Given:
Hello, ==World==!
Will output:
<p>Hello, <mark>World</mark>!</p>
Contributing
- Fork it (
https://github.com/kinduff/jekyll_miscellaneous/fork
). - Create your feature branch (
git checkout -b my-new-feature
). - Commit your changes (
git commit -am "Add some feature"
). - Push to the branch (
git push origin my-new-feature
). - Create new Pull Request.