jekyll-contentblocks 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +110 -0
- data/.gitignore +1 -1
- data/Appraisals +46 -28
- data/Gemfile +15 -5
- data/README.md +113 -10
- data/gemfiles/jekyll_3.0.5.gemfile +15 -0
- data/gemfiles/jekyll_3.1.6.gemfile +15 -0
- data/gemfiles/jekyll_3.10.0.gemfile +16 -0
- data/gemfiles/jekyll_3.2.1.gemfile +15 -0
- data/gemfiles/jekyll_3.3.1.gemfile +15 -0
- data/gemfiles/jekyll_3.4.5.gemfile +15 -0
- data/gemfiles/jekyll_3.5.2.gemfile +15 -0
- data/gemfiles/jekyll_3.6.3.gemfile +15 -0
- data/gemfiles/jekyll_3.7.4.gemfile +15 -0
- data/gemfiles/jekyll_3.8.7.gemfile +15 -0
- data/gemfiles/jekyll_3.9.5.gemfile +16 -0
- data/gemfiles/jekyll_4.0.1.gemfile +15 -0
- data/gemfiles/jekyll_4.1.1.gemfile +15 -0
- data/gemfiles/jekyll_4.2.2.gemfile +15 -0
- data/gemfiles/jekyll_4.3.4.gemfile +15 -0
- data/gemfiles/jekyll_4.4.1.gemfile +15 -0
- data/jekyll-contentblocks.gemspec +7 -2
- data/lib/jekyll/content_blocks/content_block_tag.rb +34 -7
- data/lib/jekyll/content_blocks/pre_render_hook.rb +3 -5
- data/lib/jekyll/content_blocks/version.rb +1 -2
- data/lib/jekyll/tags/content_block.rb +2 -9
- data/lib/jekyll/tags/content_for.rb +18 -3
- data/lib/jekyll-contentblocks.rb +15 -31
- data/mise.toml +5 -0
- data/spec/jekyll_content_blocks_spec.rb +111 -60
- data/spec/spec_helper.rb +11 -12
- data/test/_layouts/default.html +14 -0
- data/test/_plugins/require.rb +1 -2
- data/test/emptyblock.md +8 -0
- data/test/page3.md +27 -0
- metadata +39 -28
- data/.ruby-version +0 -1
- data/gemfiles/jekyll_1.0.4.gemfile +0 -12
- data/gemfiles/jekyll_1.1.2.gemfile +0 -12
- data/gemfiles/jekyll_1.2.1.gemfile +0 -12
- data/gemfiles/jekyll_1.3.1.gemfile +0 -12
- data/gemfiles/jekyll_1.4.3.gemfile +0 -12
- data/gemfiles/jekyll_1.5.1.gemfile +0 -12
- data/gemfiles/jekyll_2.0.3.gemfile +0 -12
- data/gemfiles/jekyll_2.1.1.gemfile +0 -12
- data/gemfiles/jekyll_2.2.0.gemfile +0 -12
- data/gemfiles/jekyll_2.3.0.gemfile +0 -12
- data/gemfiles/jekyll_2.4.0.gemfile +0 -12
- data/gemfiles/jekyll_2.5.3.gemfile +0 -12
- data/gemfiles/jekyll_3.0.3.gemfile +0 -12
- data/gemfiles/jekyll_3.1.2.gemfile +0 -12
- data/lib/jekyll/content_blocks/convertible.rb +0 -27
- data/lib/jekyll/content_blocks/renderer.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9bf066a06d395aadfb1ca67328ee4bdb68bdd227799726da53acbbceafa81876
|
|
4
|
+
data.tar.gz: 585dc4dee4e35910d98f9fc756745e8608d79b7d3e52f73c9f893c3f5dd95044
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6640f56d91abeebc6f6c9c6ed74bfe0c250f921958fa7e0121fa2beb67d6947b64b69d719e202c4d7cd329640c9f1399dd3ae75e48937846b1b4e222b2d01dc4
|
|
7
|
+
data.tar.gz: c75c1b8e77f103916af0ff9f79b7ee25f45a20c232af2617971d0766835f1f4790c3ee457a73dc503f6c05adf4e10ccfc9839b35fb04b36f70a36cb4aec889ff
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
# One job per Ruby version, each with its own list of Jekyll versions.
|
|
9
|
+
# Ruby 2.7 (Jekyll's supported minimum) runs the whole range; Ruby 3.3/3.4/4.0
|
|
10
|
+
# run Jekyll 3.8+ only, since Jekyll 3.0–3.7 use APIs removed in Ruby 3
|
|
11
|
+
# (URI.escape, Fixnum, positional Hash args to File.read). The generated
|
|
12
|
+
# gemfiles carry no `ruby` pin, so each installs on whichever Ruby runs it.
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# Formatting gate. The test jobs below `needs:` this, so a rubyfmt failure
|
|
16
|
+
# skips the whole matrix instead of burning runners on it.
|
|
17
|
+
rubyfmt:
|
|
18
|
+
name: rubyfmt
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v5
|
|
22
|
+
# mise's github/ubi backends mislocate rubyfmt's oddly-nested release
|
|
23
|
+
# tarball on Linux, so install the standalone binary directly. The version
|
|
24
|
+
# is read from mise.toml, which stays the source of truth (and is what local
|
|
25
|
+
# dev uses via `mise install`). rubyfmt is self-contained — no Ruby needed.
|
|
26
|
+
- name: Install rubyfmt
|
|
27
|
+
run: |
|
|
28
|
+
version="$(grep -oE 'fables-tales/rubyfmt" = "[0-9.]+"' mise.toml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')"
|
|
29
|
+
echo "Installing rubyfmt $version"
|
|
30
|
+
curl -fsSL "https://github.com/fables-tales/rubyfmt/releases/download/v${version}/rubyfmt-v${version}-Linux-x86_64.tar.gz" \
|
|
31
|
+
| tar -xz -C "$RUNNER_TEMP"
|
|
32
|
+
echo "$RUNNER_TEMP/tmp/releases/v${version}-Linux" >> "$GITHUB_PATH"
|
|
33
|
+
- run: rubyfmt --check .
|
|
34
|
+
|
|
35
|
+
ruby-2-7:
|
|
36
|
+
name: Jekyll ${{ matrix.jekyll }} (Ruby 2.7)
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
needs: rubyfmt
|
|
39
|
+
strategy:
|
|
40
|
+
fail-fast: false
|
|
41
|
+
matrix:
|
|
42
|
+
jekyll: ['3.0.5', '3.1.6', '3.2.1', '3.3.1', '3.4.5', '3.5.2',
|
|
43
|
+
'3.6.3', '3.7.4', '3.8.7', '3.9.5', '3.10.0',
|
|
44
|
+
'4.0.1', '4.1.1', '4.2.2', '4.3.4', '4.4.1']
|
|
45
|
+
env:
|
|
46
|
+
BUNDLE_GEMFILE: gemfiles/jekyll_${{ matrix.jekyll }}.gemfile
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@v5
|
|
49
|
+
- uses: ruby/setup-ruby@v1
|
|
50
|
+
with:
|
|
51
|
+
ruby-version: '2.7'
|
|
52
|
+
bundler-cache: true
|
|
53
|
+
- run: bundle exec rspec
|
|
54
|
+
|
|
55
|
+
ruby-3-3:
|
|
56
|
+
name: Jekyll ${{ matrix.jekyll }} (Ruby 3.3)
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
needs: rubyfmt
|
|
59
|
+
strategy:
|
|
60
|
+
fail-fast: false
|
|
61
|
+
matrix:
|
|
62
|
+
# The Jekyll 3.8+ list is defined once here (&jekyll_3_8_plus) and reused
|
|
63
|
+
# by the Ruby 3.4 and 4.0 jobs below via the *jekyll_3_8_plus alias.
|
|
64
|
+
jekyll: &jekyll_3_8_plus ['3.8.7', '3.9.5', '3.10.0',
|
|
65
|
+
'4.0.1', '4.1.1', '4.2.2', '4.3.4', '4.4.1']
|
|
66
|
+
env:
|
|
67
|
+
BUNDLE_GEMFILE: gemfiles/jekyll_${{ matrix.jekyll }}.gemfile
|
|
68
|
+
steps:
|
|
69
|
+
- uses: actions/checkout@v5
|
|
70
|
+
- uses: ruby/setup-ruby@v1
|
|
71
|
+
with:
|
|
72
|
+
ruby-version: '3.3'
|
|
73
|
+
bundler-cache: true
|
|
74
|
+
- run: bundle exec rspec
|
|
75
|
+
|
|
76
|
+
ruby-3-4:
|
|
77
|
+
name: Jekyll ${{ matrix.jekyll }} (Ruby 3.4)
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
needs: rubyfmt
|
|
80
|
+
strategy:
|
|
81
|
+
fail-fast: false
|
|
82
|
+
matrix:
|
|
83
|
+
jekyll: *jekyll_3_8_plus
|
|
84
|
+
env:
|
|
85
|
+
BUNDLE_GEMFILE: gemfiles/jekyll_${{ matrix.jekyll }}.gemfile
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/checkout@v5
|
|
88
|
+
- uses: ruby/setup-ruby@v1
|
|
89
|
+
with:
|
|
90
|
+
ruby-version: '3.4'
|
|
91
|
+
bundler-cache: true
|
|
92
|
+
- run: bundle exec rspec
|
|
93
|
+
|
|
94
|
+
ruby-4-0:
|
|
95
|
+
name: Jekyll ${{ matrix.jekyll }} (Ruby 4.0)
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
needs: rubyfmt
|
|
98
|
+
strategy:
|
|
99
|
+
fail-fast: false
|
|
100
|
+
matrix:
|
|
101
|
+
jekyll: *jekyll_3_8_plus
|
|
102
|
+
env:
|
|
103
|
+
BUNDLE_GEMFILE: gemfiles/jekyll_${{ matrix.jekyll }}.gemfile
|
|
104
|
+
steps:
|
|
105
|
+
- uses: actions/checkout@v5
|
|
106
|
+
- uses: ruby/setup-ruby@v1
|
|
107
|
+
with:
|
|
108
|
+
ruby-version: '4.0'
|
|
109
|
+
bundler-cache: true
|
|
110
|
+
- run: bundle exec rspec
|
data/.gitignore
CHANGED
data/Appraisals
CHANGED
|
@@ -1,55 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
# Every version runs against Ruby 2.7 in CI (Jekyll's supported minimum).
|
|
2
|
+
# Jekyll 3.8+ (including 4.x) is additionally tested against Ruby 3.3, 3.4 and 4.0;
|
|
3
|
+
# Jekyll 3.0–3.7 can't run on Ruby 3 (they use APIs removed in it: URI.escape,
|
|
4
|
+
# Fixnum, and positional Hash args to File.read). See .github/workflows/ci.yml.
|
|
5
|
+
|
|
6
|
+
appraise "jekyll-3.0.5" do
|
|
7
|
+
gem "jekyll", "3.0.5"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
appraise "jekyll-3.1.6" do
|
|
11
|
+
gem "jekyll", "3.1.6"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
appraise "jekyll-3.2.1" do
|
|
15
|
+
gem "jekyll", "3.2.1"
|
|
3
16
|
end
|
|
4
17
|
|
|
5
|
-
appraise "jekyll-
|
|
6
|
-
gem "jekyll", "
|
|
18
|
+
appraise "jekyll-3.3.1" do
|
|
19
|
+
gem "jekyll", "3.3.1"
|
|
7
20
|
end
|
|
8
21
|
|
|
9
|
-
appraise "jekyll-
|
|
10
|
-
gem "jekyll", "
|
|
22
|
+
appraise "jekyll-3.4.5" do
|
|
23
|
+
gem "jekyll", "3.4.5"
|
|
11
24
|
end
|
|
12
25
|
|
|
13
|
-
appraise "jekyll-
|
|
14
|
-
gem "jekyll", "
|
|
26
|
+
appraise "jekyll-3.5.2" do
|
|
27
|
+
gem "jekyll", "3.5.2"
|
|
15
28
|
end
|
|
16
29
|
|
|
17
|
-
appraise "jekyll-
|
|
18
|
-
gem "jekyll", "
|
|
30
|
+
appraise "jekyll-3.6.3" do
|
|
31
|
+
gem "jekyll", "3.6.3"
|
|
19
32
|
end
|
|
20
33
|
|
|
21
|
-
appraise "jekyll-
|
|
22
|
-
gem "jekyll", "
|
|
34
|
+
appraise "jekyll-3.7.4" do
|
|
35
|
+
gem "jekyll", "3.7.4"
|
|
23
36
|
end
|
|
24
37
|
|
|
25
|
-
appraise "jekyll-
|
|
26
|
-
gem "jekyll", "
|
|
38
|
+
appraise "jekyll-3.8.7" do
|
|
39
|
+
gem "jekyll", "3.8.7"
|
|
27
40
|
end
|
|
28
41
|
|
|
29
|
-
appraise "jekyll-
|
|
30
|
-
gem "jekyll", "
|
|
42
|
+
appraise "jekyll-3.9.5" do
|
|
43
|
+
gem "jekyll", "3.9.5"
|
|
44
|
+
# Jekyll 3.9+ uses kramdown 2.x, which extracted the GFM parser into its own gem
|
|
45
|
+
gem "kramdown-parser-gfm"
|
|
31
46
|
end
|
|
32
47
|
|
|
33
|
-
appraise "jekyll-
|
|
34
|
-
gem "jekyll", "
|
|
48
|
+
appraise "jekyll-3.10.0" do
|
|
49
|
+
gem "jekyll", "3.10.0"
|
|
50
|
+
# Jekyll 3.9+ uses kramdown 2.x, which extracted the GFM parser into its own gem
|
|
51
|
+
gem "kramdown-parser-gfm"
|
|
35
52
|
end
|
|
36
53
|
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
# Jekyll 4 depends on kramdown-parser-gfm itself, so it isn't listed here.
|
|
55
|
+
appraise "jekyll-4.0.1" do
|
|
56
|
+
gem "jekyll", "4.0.1"
|
|
39
57
|
end
|
|
40
58
|
|
|
41
|
-
appraise "jekyll-
|
|
42
|
-
gem "jekyll", "
|
|
59
|
+
appraise "jekyll-4.1.1" do
|
|
60
|
+
gem "jekyll", "4.1.1"
|
|
43
61
|
end
|
|
44
62
|
|
|
45
|
-
appraise "jekyll-2.
|
|
46
|
-
gem "jekyll", "2.
|
|
63
|
+
appraise "jekyll-4.2.2" do
|
|
64
|
+
gem "jekyll", "4.2.2"
|
|
47
65
|
end
|
|
48
66
|
|
|
49
|
-
appraise "jekyll-3.
|
|
50
|
-
gem "jekyll", "3.
|
|
67
|
+
appraise "jekyll-4.3.4" do
|
|
68
|
+
gem "jekyll", "4.3.4"
|
|
51
69
|
end
|
|
52
70
|
|
|
53
|
-
appraise "jekyll-
|
|
54
|
-
gem "jekyll", "
|
|
71
|
+
appraise "jekyll-4.4.1" do
|
|
72
|
+
gem "jekyll", "4.4.1"
|
|
55
73
|
end
|
data/Gemfile
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
# No `ruby` pin here on purpose: Appraisal copies this Gemfile's directives into
|
|
4
|
+
# every generated gemfiles/*.gemfile, and those run across a Ruby matrix (all
|
|
5
|
+
# versions on 2.7, plus Jekyll 3.8+ on 3.3/3.4/4.0). See .github/workflows/ci.yml and Appraisals.
|
|
6
|
+
gem 'jekyll', '~> 3.8.0'
|
|
7
|
+
gem 'rexml'
|
|
8
|
+
gem 'appraisal', '~> 2.5.0'
|
|
5
9
|
|
|
6
10
|
gem 'pry'
|
|
7
|
-
gem '
|
|
8
|
-
gem '
|
|
9
|
-
|
|
11
|
+
gem 'rspec', '~> 3.13.0'
|
|
12
|
+
gem 'nokogiri'
|
|
13
|
+
|
|
14
|
+
# Declared here (not in the gemspec) so they are not forced on consumers of the
|
|
15
|
+
# gem. They silence "loaded from the standard library" warnings that Jekyll's own
|
|
16
|
+
# deps (safe_yaml, liquid) trigger on Ruby 3.3+, where these leave the default gems.
|
|
17
|
+
gem 'base64'
|
|
18
|
+
gem 'bigdecimal'
|
|
19
|
+
gem 'csv'
|
|
10
20
|
|
|
11
21
|
gemspec
|
data/README.md
CHANGED
|
@@ -1,10 +1,37 @@
|
|
|
1
1
|
# jekyll-contentblocks
|
|
2
2
|
|
|
3
|
+
[](https://github.com/rustygeldmacher/jekyll-contentblocks/actions/workflows/ci.yml)
|
|
4
|
+
|
|
3
5
|
Gives you a mechanism in Jekyll to pass content up from pages into their parent
|
|
4
6
|
layouts. It's kind of like having Rails' content_for available for Jekyll.
|
|
5
7
|
|
|
6
8
|
## Installation
|
|
7
9
|
|
|
10
|
+
jekyll-contentblocks supports Jekyll 3.0 and above. Jekyll 3.0–3.7 require
|
|
11
|
+
Ruby 2.7 (they use APIs removed in Ruby 3), while Jekyll 3.8 and above run on
|
|
12
|
+
Ruby 2.7 through 4.0. Jekyll versions below 3.0 are no longer supported.
|
|
13
|
+
|
|
14
|
+
The combinations exercised in CI (Ruby across the top, Jekyll down the side):
|
|
15
|
+
|
|
16
|
+
| Jekyll \ Ruby | 2.7.x | 3.3.x | 3.4.x | 4.0.x |
|
|
17
|
+
| --- | :---: | :---: | :---: | :---: |
|
|
18
|
+
| 3.0.x | ✅ | ❌ | ❌ | ❌ |
|
|
19
|
+
| 3.1.x | ✅ | ❌ | ❌ | ❌ |
|
|
20
|
+
| 3.2.x | ✅ | ❌ | ❌ | ❌ |
|
|
21
|
+
| 3.3.x | ✅ | ❌ | ❌ | ❌ |
|
|
22
|
+
| 3.4.x | ✅ | ❌ | ❌ | ❌ |
|
|
23
|
+
| 3.5.x | ✅ | ❌ | ❌ | ❌ |
|
|
24
|
+
| 3.6.x | ✅ | ❌ | ❌ | ❌ |
|
|
25
|
+
| 3.7.x | ✅ | ❌ | ❌ | ❌ |
|
|
26
|
+
| 3.8.x | ✅ | ✅ | ✅ | ✅ |
|
|
27
|
+
| 3.9.x | ✅ | ✅ | ✅ | ✅ |
|
|
28
|
+
| 3.10.x | ✅ | ✅ | ✅ | ✅ |
|
|
29
|
+
| 4.0.x | ✅ | ✅ | ✅ | ✅ |
|
|
30
|
+
| 4.1.x | ✅ | ✅ | ✅ | ✅ |
|
|
31
|
+
| 4.2.x | ✅ | ✅ | ✅ | ✅ |
|
|
32
|
+
| 4.3.x | ✅ | ✅ | ✅ | ✅ |
|
|
33
|
+
| 4.4.x | ✅ | ✅ | ✅ | ✅ |
|
|
34
|
+
|
|
8
35
|
### Bundler (recommended)
|
|
9
36
|
|
|
10
37
|
Add this line to your Jekyll project's `Gemfile`:
|
|
@@ -90,27 +117,88 @@ formatting applied.
|
|
|
90
117
|
|
|
91
118
|
### Checking if a block has content
|
|
92
119
|
|
|
93
|
-
We might want to check
|
|
94
|
-
|
|
120
|
+
We might want to check whether a block has content before using it in our
|
|
121
|
+
template. The simplest way is a plain Liquid `if` — each block name is exposed
|
|
122
|
+
under `contentblocks`:
|
|
123
|
+
|
|
124
|
+
```liquid
|
|
125
|
+
{% if contentblocks.sidebar %}
|
|
126
|
+
{% contentblock sidebar %}
|
|
127
|
+
{% else %}
|
|
128
|
+
<div>This is our default sidebar.</div>
|
|
129
|
+
{% endif %}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`contentblocks.<name>` is truthy whenever the block was defined on the page, and
|
|
133
|
+
`nil` otherwise. Unlike the tags below, it also composes with other conditions:
|
|
134
|
+
|
|
135
|
+
```liquid
|
|
136
|
+
{% if contentblocks.sidebar or page.force_sidebar %}
|
|
137
|
+
...
|
|
138
|
+
{% endif %}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The `ifhascontent` and `ifnothascontent` tags are also available:
|
|
95
142
|
|
|
96
143
|
```liquid
|
|
97
144
|
{% ifhascontent javascripts %}
|
|
98
|
-
<script type="text/javascript>
|
|
145
|
+
<script type="text/javascript">
|
|
99
146
|
{% contentblock javascripts %}
|
|
100
147
|
</script>
|
|
101
148
|
{% endifhascontent %}
|
|
102
149
|
```
|
|
103
150
|
|
|
104
|
-
|
|
151
|
+
The difference is subtle: these tags test for **non-empty** content, whereas
|
|
152
|
+
`{% if contentblocks.name %}` tests whether the block was *defined* at all. So a
|
|
153
|
+
block that a page defines but leaves empty counts as "no content" for
|
|
154
|
+
`ifhascontent`, yet is still present in `contentblocks`.
|
|
155
|
+
|
|
156
|
+
### Repeating a block and reading its front matter
|
|
157
|
+
|
|
158
|
+
You can use the same block name more than once on a page. Each block is
|
|
159
|
+
collected into an array available in the layout at `contentblocks.<name>`,
|
|
160
|
+
so you can loop over the individual blocks instead of rendering them as one
|
|
161
|
+
concatenated chunk.
|
|
162
|
+
|
|
163
|
+
Each block may also start with its own YAML front matter. The front matter is
|
|
164
|
+
parsed into a `data` hash, and the remaining Markdown becomes `content`
|
|
165
|
+
(converted just like a normal block). This lets an author write a few simple
|
|
166
|
+
Markdown blocks while the layout arranges them into something richer.
|
|
167
|
+
|
|
168
|
+
For example, a page with a list of testimonials:
|
|
169
|
+
|
|
170
|
+
```liquid
|
|
171
|
+
{% contentfor testimonial %}
|
|
172
|
+
---
|
|
173
|
+
author: Ada Lovelace
|
|
174
|
+
---
|
|
175
|
+
A **delightful** plugin.
|
|
176
|
+
{% endcontentfor %}
|
|
177
|
+
|
|
178
|
+
{% contentfor testimonial %}
|
|
179
|
+
---
|
|
180
|
+
author: Alan Turing
|
|
181
|
+
---
|
|
182
|
+
Saved us hours of work.
|
|
183
|
+
{% endcontentfor %}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The layout can then loop over them, reading each block's `content` and `data`:
|
|
105
187
|
|
|
106
188
|
```liquid
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
{
|
|
189
|
+
<ul class="testimonials">
|
|
190
|
+
{% for testimonial in contentblocks.testimonial %}
|
|
191
|
+
<li>
|
|
192
|
+
{{ testimonial.content }}
|
|
193
|
+
<cite>{{ testimonial.data.author }}</cite>
|
|
194
|
+
</li>
|
|
195
|
+
{% endfor %}
|
|
196
|
+
</ul>
|
|
112
197
|
```
|
|
113
198
|
|
|
199
|
+
The original `{% contentblock testimonial %}` tag still works too — it renders
|
|
200
|
+
all of the blocks together.
|
|
201
|
+
|
|
114
202
|
## Contributing
|
|
115
203
|
|
|
116
204
|
1. Fork it
|
|
@@ -127,5 +215,20 @@ of Jekyll. To do this, run the test suite:
|
|
|
127
215
|
```bash
|
|
128
216
|
> bundle
|
|
129
217
|
> bundle exec appraisal install
|
|
130
|
-
> bundle exec appraisal
|
|
218
|
+
> bundle exec appraisal rspec
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Formatting
|
|
222
|
+
|
|
223
|
+
Ruby code is formatted with [rubyfmt](https://github.com/fables-tales/rubyfmt),
|
|
224
|
+
which is installed (along with Ruby) via [mise](https://mise.jdx.dev) from the
|
|
225
|
+
versions pinned in `mise.toml`:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
> mise install # install Ruby + the pinned rubyfmt
|
|
229
|
+
> mise exec -- rubyfmt -i . # format in place
|
|
230
|
+
> mise exec -- rubyfmt --check . # check formatting (what CI runs)
|
|
131
231
|
```
|
|
232
|
+
|
|
233
|
+
CI runs `rubyfmt --check` as a gate before the test matrix, so unformatted
|
|
234
|
+
code fails the build early.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.0.5"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.1.6"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.10.0"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
gem "kramdown-parser-gfm"
|
|
15
|
+
|
|
16
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.2.1"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.3.1"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.4.5"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.5.2"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.6.3"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.7.4"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.8.7"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "3.9.5"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
gem "kramdown-parser-gfm"
|
|
15
|
+
|
|
16
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "4.0.1"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "4.1.1"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "4.2.2"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "jekyll", "4.3.4"
|
|
6
|
+
gem "rexml"
|
|
7
|
+
gem "appraisal", "~> 2.5.0"
|
|
8
|
+
gem "pry"
|
|
9
|
+
gem "rspec", "~> 3.13.0"
|
|
10
|
+
gem "nokogiri"
|
|
11
|
+
gem "base64"
|
|
12
|
+
gem "bigdecimal"
|
|
13
|
+
gem "csv"
|
|
14
|
+
|
|
15
|
+
gemspec path: "../"
|