Skip to content

A collection of opinionated plugins for Jekyll.

License

Notifications You must be signed in to change notification settings

kinduff/jekyll_miscellaneous

Repository files navigation

Jekyll Miscellaneous

Gem Version codecov

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.

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

  1. Fork it (https://github.com/kinduff/jekyll_miscellaneous/fork).
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am "Add some feature").
  4. Push to the branch (git push origin my-new-feature).
  5. Create new Pull Request.

About

A collection of opinionated plugins for Jekyll.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages