├── .github └── workflows │ ├── rubocop.yml │ └── ruby.yml ├── .gitignore ├── .rubocop-relaxed-2.5.yml ├── .rubocop.yml ├── .rubocop_todo.yml ├── .travis.yml ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── Rakefile ├── jekyll-liquify.gemspec ├── lib ├── jekyll-liquify.rb └── jekyll │ └── liquify_filter.rb ├── script ├── bootstrap ├── cibuild ├── console └── release └── spec ├── fixtures ├── _config.yml ├── _layouts │ └── some_default.html └── index.html ├── lib └── jekyll │ └── liquify_filter_spec.rb └── spec_helper.rb /.github/workflows/rubocop.yml: -------------------------------------------------------------------------------- 1 | name: Rubocop 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | strategy: 14 | matrix: 15 | ruby-version: ['3.4', '3.3'] 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | - name: Set up Ruby ${{ matrix.ruby-version }} 20 | uses: ruby/setup-ruby@v1 21 | with: 22 | bundler-cache: true 23 | ruby-version: ${{ matrix.ruby-version }} 24 | - name: Install dependencies 25 | run: bundle install -j 5 26 | - name: Run tests 27 | run: bundle exec rubocop 28 | 29 | -------------------------------------------------------------------------------- /.github/workflows/ruby.yml: -------------------------------------------------------------------------------- 1 | name: RSpec 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | 14 | strategy: 15 | matrix: 16 | ruby-version: ['3.4', '3.3', '3.2', '3.1'] 17 | 18 | steps: 19 | - uses: actions/checkout@v4 20 | - name: Set up Ruby ${{ matrix.ruby-version }} 21 | uses: ruby/setup-ruby@v1 22 | with: 23 | bundler-cache: true 24 | ruby-version: ${{ matrix.ruby-version }} 25 | - name: Install dependencies 26 | run: bundle install -j 5 27 | - name: Run RSpecs 28 | run: bundle exec rspec --format progress -p 3 29 | 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | .ruby-version 3 | *.gem 4 | spec/dest 5 | .bundle 6 | /coverage 7 | -------------------------------------------------------------------------------- /.rubocop-relaxed-2.5.yml: -------------------------------------------------------------------------------- 1 | # Relaxed.Ruby.Style 2 | ## Version 2.5 3 | 4 | Style/Alias: 5 | Enabled: false 6 | StyleGuide: https://relaxed.ruby.style/#stylealias 7 | 8 | Style/AsciiComments: 9 | Enabled: false 10 | StyleGuide: https://relaxed.ruby.style/#styleasciicomments 11 | 12 | Style/BeginBlock: 13 | Enabled: false 14 | StyleGuide: https://relaxed.ruby.style/#stylebeginblock 15 | 16 | Style/BlockDelimiters: 17 | Enabled: false 18 | StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters 19 | 20 | Style/CommentAnnotation: 21 | Enabled: false 22 | StyleGuide: https://relaxed.ruby.style/#stylecommentannotation 23 | 24 | Style/Documentation: 25 | Enabled: false 26 | StyleGuide: https://relaxed.ruby.style/#styledocumentation 27 | 28 | Layout/DotPosition: 29 | Enabled: false 30 | StyleGuide: https://relaxed.ruby.style/#layoutdotposition 31 | 32 | Style/DoubleNegation: 33 | Enabled: false 34 | StyleGuide: https://relaxed.ruby.style/#styledoublenegation 35 | 36 | Style/EndBlock: 37 | Enabled: false 38 | StyleGuide: https://relaxed.ruby.style/#styleendblock 39 | 40 | Style/FormatString: 41 | Enabled: false 42 | StyleGuide: https://relaxed.ruby.style/#styleformatstring 43 | 44 | Style/IfUnlessModifier: 45 | Enabled: false 46 | StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier 47 | 48 | Style/Lambda: 49 | Enabled: false 50 | StyleGuide: https://relaxed.ruby.style/#stylelambda 51 | 52 | Style/ModuleFunction: 53 | Enabled: false 54 | StyleGuide: https://relaxed.ruby.style/#stylemodulefunction 55 | 56 | Style/MultilineBlockChain: 57 | Enabled: false 58 | StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain 59 | 60 | Style/NegatedIf: 61 | Enabled: false 62 | StyleGuide: https://relaxed.ruby.style/#stylenegatedif 63 | 64 | Style/NegatedWhile: 65 | Enabled: false 66 | StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile 67 | 68 | Style/NumericPredicate: 69 | Enabled: false 70 | StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate 71 | 72 | Style/ParallelAssignment: 73 | Enabled: false 74 | StyleGuide: https://relaxed.ruby.style/#styleparallelassignment 75 | 76 | Style/PercentLiteralDelimiters: 77 | Enabled: false 78 | StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters 79 | 80 | Style/PerlBackrefs: 81 | Enabled: false 82 | StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs 83 | 84 | Style/Semicolon: 85 | Enabled: false 86 | StyleGuide: https://relaxed.ruby.style/#stylesemicolon 87 | 88 | Style/SignalException: 89 | Enabled: false 90 | StyleGuide: https://relaxed.ruby.style/#stylesignalexception 91 | 92 | Style/SingleLineBlockParams: 93 | Enabled: false 94 | StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams 95 | 96 | Style/SingleLineMethods: 97 | Enabled: false 98 | StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods 99 | 100 | Layout/SpaceBeforeBlockBraces: 101 | Enabled: false 102 | StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces 103 | 104 | Layout/SpaceInsideParens: 105 | Enabled: false 106 | StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens 107 | 108 | Style/SpecialGlobalVars: 109 | Enabled: false 110 | StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars 111 | 112 | Style/StringLiterals: 113 | Enabled: false 114 | StyleGuide: https://relaxed.ruby.style/#stylestringliterals 115 | 116 | Style/TrailingCommaInArguments: 117 | Enabled: false 118 | StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments 119 | 120 | Style/TrailingCommaInArrayLiteral: 121 | Enabled: false 122 | StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral 123 | 124 | Style/TrailingCommaInHashLiteral: 125 | Enabled: false 126 | StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral 127 | 128 | Style/SymbolArray: 129 | Enabled: false 130 | StyleGuide: http://relaxed.ruby.style/#stylesymbolarray 131 | 132 | Style/WhileUntilModifier: 133 | Enabled: false 134 | StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier 135 | 136 | Style/WordArray: 137 | Enabled: false 138 | StyleGuide: https://relaxed.ruby.style/#stylewordarray 139 | 140 | Lint/AmbiguousRegexpLiteral: 141 | Enabled: false 142 | StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral 143 | 144 | Lint/AssignmentInCondition: 145 | Enabled: false 146 | StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition 147 | 148 | Layout/LineLength: 149 | Enabled: false 150 | 151 | Metrics: 152 | Enabled: false 153 | 154 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - rubocop-rake 3 | - rubocop-rspec 4 | 5 | inherit_from: 6 | - .rubocop-relaxed-2.5.yml 7 | - .rubocop_todo.yml 8 | 9 | AllCops: 10 | NewCops: enable 11 | TargetRubyVersion: 3 12 | SuggestExtensions: true 13 | UseCache: true 14 | DefaultFormatter: progress 15 | DisplayStyleGuide: true 16 | DisplayCopNames: true 17 | Exclude: 18 | - "**/rubocop" 19 | - "**/vendor/bundle/**/*" 20 | Include: 21 | - '**/*.rb' 22 | - '**/*.gemfile' 23 | - '**/*.gemspec' 24 | - '**/*.rake' 25 | - '**/*.ru' 26 | - '**/Gemfile' 27 | - '**/Rakefile' 28 | 29 | Layout/HashAlignment: 30 | Enabled: true 31 | EnforcedColonStyle: table 32 | 33 | Style/Dir: 34 | Enabled: false 35 | 36 | RSpec/ContextWording: 37 | Enabled: true 38 | 39 | 40 | -------------------------------------------------------------------------------- /.rubocop_todo.yml: -------------------------------------------------------------------------------- 1 | # This configuration was generated by 2 | # `rubocop --auto-gen-config` 3 | # on 2025-01-13 10:34:52 UTC using RuboCop version 1.70.0. 4 | # The point is for the user to remove these configuration records 5 | # one by one as the offenses are removed from the code base. 6 | # Note that changes in the inspected code, or installation of new 7 | # versions of RuboCop, may require this file to be generated again. 8 | 9 | # Offense count: 1 10 | # Configuration parameters: Severity, Include. 11 | # Include: **/*.gemspec 12 | Gemspec/RequiredRubyVersion: 13 | Exclude: 14 | - 'jekyll-liquify.gemspec' 15 | 16 | # Offense count: 2 17 | # Configuration parameters: AllowedMethods. 18 | # AllowedMethods: enums 19 | Lint/ConstantDefinitionInBlock: 20 | Exclude: 21 | - 'spec/spec_helper.rb' 22 | 23 | # Offense count: 1 24 | # Configuration parameters: DebuggerMethods, DebuggerRequires. 25 | Lint/Debugger: 26 | Exclude: 27 | - 'script/console' 28 | 29 | # Offense count: 1 30 | # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. 31 | # CheckDefinitionPathHierarchyRoots: lib, spec, test, src 32 | # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS 33 | Naming/FileName: 34 | Exclude: 35 | - 'Rakefile.rb' 36 | - 'lib/jekyll-liquify.rb' 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.1 4 | - 2.0 5 | - 1.9.3 6 | script: "script/cibuild" 7 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | group :development, :test do 6 | gem 'debug', '>= 1.0.0' 7 | gem 'jekyll' 8 | gem 'rake' 9 | gem 'rspec' 10 | gem 'rspec-core' 11 | gem 'rspec-its' 12 | gem 'rubocop' 13 | gem 'rubocop-rake' 14 | gem 'rubocop-rspec' 15 | gem 'simplecov' 16 | end 17 | 18 | gemspec 19 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | jekyll-liquify (0.1.0) 5 | base64 6 | csv 7 | liquid 8 | logger 9 | redcarpet 10 | 11 | GEM 12 | remote: https://rubygems.org/ 13 | specs: 14 | addressable (2.8.7) 15 | public_suffix (>= 2.0.2, < 7.0) 16 | ast (2.4.2) 17 | base64 (0.2.0) 18 | bigdecimal (3.1.9) 19 | colorator (1.1.0) 20 | concurrent-ruby (1.3.5) 21 | csv (3.3.2) 22 | date (3.4.1) 23 | debug (1.10.0) 24 | irb (~> 1.10) 25 | reline (>= 0.3.8) 26 | diff-lcs (1.5.1) 27 | docile (1.4.1) 28 | em-websocket (0.5.3) 29 | eventmachine (>= 0.12.9) 30 | http_parser.rb (~> 0) 31 | eventmachine (1.2.7) 32 | ffi (1.17.1-arm64-darwin) 33 | ffi (1.17.1-x86_64-linux-gnu) 34 | forwardable-extended (2.6.0) 35 | google-protobuf (4.29.3-arm64-darwin) 36 | bigdecimal 37 | rake (>= 13) 38 | google-protobuf (4.29.3-x86_64-linux) 39 | bigdecimal 40 | rake (>= 13) 41 | http_parser.rb (0.8.0) 42 | i18n (1.14.6) 43 | concurrent-ruby (~> 1.0) 44 | io-console (0.8.0) 45 | irb (1.14.3) 46 | rdoc (>= 4.0.0) 47 | reline (>= 0.4.2) 48 | jekyll (4.3.4) 49 | addressable (~> 2.4) 50 | colorator (~> 1.0) 51 | em-websocket (~> 0.5) 52 | i18n (~> 1.0) 53 | jekyll-sass-converter (>= 2.0, < 4.0) 54 | jekyll-watch (~> 2.0) 55 | kramdown (~> 2.3, >= 2.3.1) 56 | kramdown-parser-gfm (~> 1.0) 57 | liquid (~> 4.0) 58 | mercenary (>= 0.3.6, < 0.5) 59 | pathutil (~> 0.9) 60 | rouge (>= 3.0, < 5.0) 61 | safe_yaml (~> 1.0) 62 | terminal-table (>= 1.8, < 4.0) 63 | webrick (~> 1.7) 64 | jekyll-sass-converter (3.0.0) 65 | sass-embedded (~> 1.54) 66 | jekyll-watch (2.2.1) 67 | listen (~> 3.0) 68 | json (2.9.1) 69 | kramdown (2.5.1) 70 | rexml (>= 3.3.9) 71 | kramdown-parser-gfm (1.1.0) 72 | kramdown (~> 2.0) 73 | language_server-protocol (3.17.0.3) 74 | liquid (4.0.4) 75 | listen (3.9.0) 76 | rb-fsevent (~> 0.10, >= 0.10.3) 77 | rb-inotify (~> 0.9, >= 0.9.10) 78 | logger (1.6.5) 79 | mercenary (0.4.0) 80 | parallel (1.26.3) 81 | parser (3.3.6.0) 82 | ast (~> 2.4.1) 83 | racc 84 | pathutil (0.16.2) 85 | forwardable-extended (~> 2.6) 86 | psych (5.2.2) 87 | date 88 | stringio 89 | public_suffix (6.0.1) 90 | racc (1.8.1) 91 | rainbow (3.1.1) 92 | rake (13.2.1) 93 | rb-fsevent (0.11.2) 94 | rb-inotify (0.11.1) 95 | ffi (~> 1.0) 96 | rdoc (6.10.0) 97 | psych (>= 4.0.0) 98 | redcarpet (3.6.0) 99 | regexp_parser (2.10.0) 100 | reline (0.6.0) 101 | io-console (~> 0.5) 102 | rexml (3.4.0) 103 | rouge (4.5.1) 104 | rspec (3.13.0) 105 | rspec-core (~> 3.13.0) 106 | rspec-expectations (~> 3.13.0) 107 | rspec-mocks (~> 3.13.0) 108 | rspec-core (3.13.2) 109 | rspec-support (~> 3.13.0) 110 | rspec-expectations (3.13.3) 111 | diff-lcs (>= 1.2.0, < 2.0) 112 | rspec-support (~> 3.13.0) 113 | rspec-its (2.0.0) 114 | rspec-core (>= 3.13.0) 115 | rspec-expectations (>= 3.13.0) 116 | rspec-mocks (3.13.2) 117 | diff-lcs (>= 1.2.0, < 2.0) 118 | rspec-support (~> 3.13.0) 119 | rspec-support (3.13.2) 120 | rubocop (1.70.0) 121 | json (~> 2.3) 122 | language_server-protocol (>= 3.17.0) 123 | parallel (~> 1.10) 124 | parser (>= 3.3.0.2) 125 | rainbow (>= 2.2.2, < 4.0) 126 | regexp_parser (>= 2.9.3, < 3.0) 127 | rubocop-ast (>= 1.36.2, < 2.0) 128 | ruby-progressbar (~> 1.7) 129 | unicode-display_width (>= 2.4.0, < 4.0) 130 | rubocop-ast (1.37.0) 131 | parser (>= 3.3.1.0) 132 | rubocop-rake (0.6.0) 133 | rubocop (~> 1.0) 134 | rubocop-rspec (3.3.0) 135 | rubocop (~> 1.61) 136 | ruby-progressbar (1.13.0) 137 | safe_yaml (1.0.5) 138 | sass-embedded (1.83.4-arm64-darwin) 139 | google-protobuf (~> 4.29) 140 | sass-embedded (1.83.4-x86_64-linux-gnu) 141 | google-protobuf (~> 4.29) 142 | simplecov (0.22.0) 143 | docile (~> 1.1) 144 | simplecov-html (~> 0.11) 145 | simplecov_json_formatter (~> 0.1) 146 | simplecov-html (0.13.1) 147 | simplecov_json_formatter (0.1.4) 148 | stringio (3.1.2) 149 | terminal-table (3.0.2) 150 | unicode-display_width (>= 1.1.1, < 3) 151 | unicode-display_width (2.6.0) 152 | webrick (1.9.1) 153 | 154 | PLATFORMS 155 | arm64-darwin 156 | x86_64-linux 157 | 158 | DEPENDENCIES 159 | debug (>= 1.0.0) 160 | jekyll 161 | jekyll-liquify! 162 | rake 163 | rspec 164 | rspec-core 165 | rspec-its 166 | rubocop 167 | rubocop-rake 168 | rubocop-rspec 169 | simplecov 170 | 171 | BUNDLED WITH 172 | 2.6.2 173 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This project includes a mix of the following: 2 | 3 | * Open source works that are not in the public domain 4 | * Open source work by the U.S. government that is in the public domain 5 | 6 | ## Parts of this project that are not in the public domain 7 | 8 | This site is based on the Draft U.S. Web Design Standards (WDS), which also includes works under the SIL Open Font License, MIT license, and public domain. Files from the WDS are in `_sass/_libs/wds/`, and the full license details for those assets are described in the [WDS license file](https://github.com/18F/web-design-standards/blob/staging/LICENSE.md). 9 | 10 | This site also includes a number of images that have various copyright statuses, including Creative Commons licenses and public domain. These images are in the `assets` directory, and license details are available on the posts and pages that display the images. 11 | 12 | ## The rest of this project is in the worldwide public domain 13 | 14 | As a work of the United States government, this project is in the public domain within the United States. 15 | 16 | Additionally, we waive copyright and related rights in the work worldwide through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/). 17 | 18 | ### CC0 1.0 Universal Summary 19 | 20 | This is a human-readable summary of the 21 | [Legal Code (read the full text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode). 22 | 23 | #### No copyright 24 | 25 | The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. 26 | 27 | You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission. 28 | 29 | #### Other information 30 | 31 | In no way are the patent or trademark rights of any person affected by CC0, nor are the rights that other persons may have in the work or in how the work is used, such as publicity or privacy rights. 32 | 33 | Unless expressly stated otherwise, the person who associated a work with this deed makes no warranties about the work, and disclaims liability for all uses of the work, to the fullest extent permitted by applicable law. When using or citing the work, you should not imply endorsement by the author or the affirmer. 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jekyll Liquify 2 | 3 | A Jekyll filter that can parse Liquid in front matter 4 | 5 | [](https://rubygems.org/gems/jekyll-liquify) 6 | 7 | [](https://github.com/gemfarmer/jekyll-liquify/actions/workflows/rubocop.yml) 8 | 9 | [](https://github.com/gemfarmer/jekyll-liquify/actions/workflows/ruby.yml) 10 | 11 | ## Usage 12 | 13 | 1. Add `gem 'jekyll-liquify'` to your site's Gemfile and run `bundle` 14 | 2. Add the following to your site's `_config.yml`: 15 | 16 | ```yml 17 | gems: 18 | - jekyll-liquify 19 | ``` 20 | 21 | To use in your project, add liquid tags to front matter and use the `liquify` filter to parse it: 22 | 23 | **example.md** 24 | 25 | ``` 26 | --- 27 | title: Welcome to {{ page.title_variable }} 28 | title_variable: example 29 | --- 30 | 31 | # Welcome to {{ title | liquify }}! 32 | 33 | 34 | >>