Sha256: 2b0235c0415c8ac219cf87d3f8f0f227c69665a828d61becf65a03c44090f57c

Contents?: true

Size: 1.37 KB

Versions: 35

Compression:

Stored size: 1.37 KB

Contents

# ------------------------------------------------------------------------------
# ~/_plugins/encodeBase64.rb
# Liquid filter for J1 Theme to Base64 encode
#
# Product/Info:
# http://jekyll.one
#
# Copyright (C) 2023 Juergen Adams
#
# J1 Theme is licensed under the MIT License.
# See: https://github.com/jekyll-one-org/j1-template/blob/main/LICENSE.md
# ------------------------------------------------------------------------------
#  NOTE:
#  CustomFilters cannot be used in SAFE mode (e.g not usable for
#  rendering pages with Jekyll on GitHub
#
#  USAGE:
#    {% capture cache_name %}
#
#      liquid code to generate HTML output goes here
#
#    {% endcapture %}
#    {{ cache_name | encode64 }}
#
# ------------------------------------------------------------------------------
# noinspection SpellCheckingInspection
# rubocop:disable Lint/UnneededDisable
# rubocop:disable Style/Documentation
# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/TrailingWhitespace
# rubocop:disable Layout/SpaceAroundOperators
# rubocop:disable Layout/ExtraSpacing
# rubocop:disable Metrics/AbcSize
# ------------------------------------------------------------------------------
require 'base64'

module Jekyll
  module EncodeBase64
    def encodeBase64(input)
      encoded = Base64.encode64(input)
      input = encoded
    end
  end
end

Liquid::Template.register_filter(Jekyll::EncodeBase64)

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
j1-template-2023.4.4 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.4.3 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.4.2 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.4.1 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.4.0 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.3.3 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.3.2 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.3.1 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.3.0 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.7 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.6 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.5 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.4 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.3 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.2 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.1 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.2.0 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.1.0 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.0.17 lib/starter_web/_plugins/filter/encodeBase64.rb
j1-template-2023.0.16 lib/starter_web/_plugins/filter/encodeBase64.rb