jekyll-highlight-cards 0.3.1
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 +7 -0
- data/.cursorignore +1 -0
- data/.github/workflows/ci.yaml +21 -0
- data/.github/workflows/release-please.yaml +69 -0
- data/.github/workflows/update-gemfile-lock.yaml +52 -0
- data/.gitignore +59 -0
- data/.release-please-manifest.json +3 -0
- data/.rspec +5 -0
- data/.rubocop.yml +64 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +54 -0
- data/CONTRIBUTING.md +219 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +196 -0
- data/LICENSE +661 -0
- data/README.md +228 -0
- data/_includes/highlight-cards/linkcard.html +13 -0
- data/_includes/highlight-cards/polaroid.html +22 -0
- data/_sass/_highlight-cards.scss +92 -0
- data/docs/linkcard-example.jpg +0 -0
- data/docs/polaroid-example.jpg +0 -0
- data/docs/polaroid-sidebyside-example.jpg +0 -0
- data/docs/polaroid-stacked-example.jpg +0 -0
- data/jekyll-highlight-cards.gemspec +47 -0
- data/lib/jekyll-highlight-cards/archive_helper.rb +151 -0
- data/lib/jekyll-highlight-cards/dimension_parser.rb +62 -0
- data/lib/jekyll-highlight-cards/expression_evaluator.rb +113 -0
- data/lib/jekyll-highlight-cards/image_sizing_hooks.rb +188 -0
- data/lib/jekyll-highlight-cards/linkcard_tag.rb +211 -0
- data/lib/jekyll-highlight-cards/polaroid_tag.rb +223 -0
- data/lib/jekyll-highlight-cards/template_renderer.rb +113 -0
- data/lib/jekyll-highlight-cards/version.rb +5 -0
- data/lib/jekyll-highlight-cards.rb +57 -0
- data/release-please-config.json +12 -0
- metadata +234 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c7cd9e66e3ef41ee1ac316caaac55c23904731e57913a8de95701fafc4a1aab7
|
|
4
|
+
data.tar.gz: 4dc6209363472413dbcde00f2d997e577997ec0eff43bec5c230aad2e3667409
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e33330d053557b592175187c7da9f2c1b8ce3ea8e29b3b1798b21fd07b5b4c074965a9e461ebd9a61ce600ab3917f509504021ac026ecbb84a2a8f3fdbc768e6
|
|
7
|
+
data.tar.gz: 5942858336904a92024164afd15d20ab1a0c0f6cb11301ad138e0af2b18fcedbd6fee608e1361d5531cb01bad93146cb1c5c1aff319d34b4c98f4c558430110f
|
data/.cursorignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!.cursor/rules/**/*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: "PR"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
name: "Test"
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v6
|
|
14
|
+
- name: Setup Ruby
|
|
15
|
+
uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
bundler-cache: true
|
|
18
|
+
- name: Install dependencies
|
|
19
|
+
run: bundle install
|
|
20
|
+
- name: Run tests
|
|
21
|
+
run: bundle exec rspec
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Release Please
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
issues: write
|
|
12
|
+
id-token: write # Required for OIDC trusted publishing
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
env:
|
|
19
|
+
GEM_NAME: jekyll-highlight-cards
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
release-please:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
outputs:
|
|
25
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
26
|
+
version: ${{ steps.release.outputs.version }}
|
|
27
|
+
steps:
|
|
28
|
+
- name: Generate GitHub App Token
|
|
29
|
+
id: generate-token
|
|
30
|
+
uses: actions/create-github-app-token@v2
|
|
31
|
+
with:
|
|
32
|
+
app-id: ${{ vars.HELPER_APP_ID }}
|
|
33
|
+
private-key: ${{ secrets.HELPER_APP_PRIVATE_KEY }}
|
|
34
|
+
|
|
35
|
+
- uses: googleapis/release-please-action@v4
|
|
36
|
+
id: release
|
|
37
|
+
with:
|
|
38
|
+
token: ${{ steps.generate-token.outputs.token }}
|
|
39
|
+
|
|
40
|
+
publish-gem:
|
|
41
|
+
needs: release-please
|
|
42
|
+
if: ${{ needs.release-please.outputs.release_created }}
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
environment: rubygems.org
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v6
|
|
47
|
+
|
|
48
|
+
- name: Set up Ruby
|
|
49
|
+
uses: ruby/setup-ruby@v1
|
|
50
|
+
with:
|
|
51
|
+
bundler-cache: true
|
|
52
|
+
|
|
53
|
+
- name: Run tests with coverage
|
|
54
|
+
run: bundle exec rspec
|
|
55
|
+
|
|
56
|
+
- name: Upload coverage to Codecov
|
|
57
|
+
uses: codecov/codecov-action@v5
|
|
58
|
+
with:
|
|
59
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
60
|
+
fail_ci_if_error: false
|
|
61
|
+
|
|
62
|
+
- name: Build gem
|
|
63
|
+
run: gem build ${{ env.GEM_NAME }}.gemspec
|
|
64
|
+
|
|
65
|
+
- name: Configure RubyGems credentials
|
|
66
|
+
uses: rubygems/configure-rubygems-credentials@v1.0.0
|
|
67
|
+
|
|
68
|
+
- name: Publish to RubyGems
|
|
69
|
+
run: gem push ${{ env.GEM_NAME }}-${{ needs.release-please.outputs.version }}.gem
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: "Release PR"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- 'lib/jekyll-highlight-cards/version.rb'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
update-gemfile-lock:
|
|
13
|
+
name: "Update Gemfile.lock"
|
|
14
|
+
# Only run on Release Please PRs
|
|
15
|
+
if: startsWith(github.head_ref, 'release-please--')
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Generate GitHub App Token
|
|
19
|
+
id: generate-token
|
|
20
|
+
uses: actions/create-github-app-token@v2
|
|
21
|
+
with:
|
|
22
|
+
app-id: ${{ vars.HELPER_APP_ID }}
|
|
23
|
+
private-key: ${{ secrets.HELPER_APP_PRIVATE_KEY }}
|
|
24
|
+
|
|
25
|
+
- uses: actions/checkout@v6
|
|
26
|
+
with:
|
|
27
|
+
ref: ${{ github.head_ref }}
|
|
28
|
+
token: ${{ steps.generate-token.outputs.token }}
|
|
29
|
+
|
|
30
|
+
- name: Set up Ruby
|
|
31
|
+
uses: ruby/setup-ruby@v1
|
|
32
|
+
with:
|
|
33
|
+
bundler-cache: false
|
|
34
|
+
|
|
35
|
+
- name: Update Gemfile.lock
|
|
36
|
+
run: bundle install
|
|
37
|
+
|
|
38
|
+
- name: Commit updated Gemfile.lock
|
|
39
|
+
uses: nick-fields/retry@v3
|
|
40
|
+
with:
|
|
41
|
+
timeout_minutes: 2
|
|
42
|
+
max_attempts: 3
|
|
43
|
+
retry_wait_seconds: 5
|
|
44
|
+
command: |
|
|
45
|
+
git config user.name "texarkanine-s-little-helper[bot]"
|
|
46
|
+
git config user.email "texarkanine-s-little-helper[bot]@users.noreply.github.com"
|
|
47
|
+
if ! git diff --quiet Gemfile.lock; then
|
|
48
|
+
git pull --rebase origin ${{ github.head_ref }}
|
|
49
|
+
git add Gemfile.lock
|
|
50
|
+
git commit -m "chore(deps): update Gemfile.lock for new version"
|
|
51
|
+
git push
|
|
52
|
+
fi
|
data/.gitignore
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
/.config
|
|
4
|
+
/coverage/
|
|
5
|
+
/InstalledFiles
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/spec/examples.txt
|
|
9
|
+
/test/tmp/
|
|
10
|
+
/test/version_tmp/
|
|
11
|
+
/tmp/
|
|
12
|
+
.rspec_status
|
|
13
|
+
|
|
14
|
+
# Used by dotenv library to load environment variables.
|
|
15
|
+
# .env
|
|
16
|
+
|
|
17
|
+
# Ignore Byebug command history file.
|
|
18
|
+
.byebug_history
|
|
19
|
+
|
|
20
|
+
## Specific to RubyMotion:
|
|
21
|
+
.dat*
|
|
22
|
+
.repl_history
|
|
23
|
+
build/
|
|
24
|
+
*.bridgesupport
|
|
25
|
+
build-iPhoneOS/
|
|
26
|
+
build-iPhoneSimulator/
|
|
27
|
+
|
|
28
|
+
## Specific to RubyMotion (use of CocoaPods):
|
|
29
|
+
#
|
|
30
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
|
31
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
|
32
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
33
|
+
#
|
|
34
|
+
# vendor/Pods/
|
|
35
|
+
|
|
36
|
+
## Documentation cache and generated files:
|
|
37
|
+
/.yardoc/
|
|
38
|
+
/_yardoc/
|
|
39
|
+
/doc/
|
|
40
|
+
/rdoc/
|
|
41
|
+
|
|
42
|
+
## Environment normalization:
|
|
43
|
+
/.bundle/
|
|
44
|
+
/vendor/bundle
|
|
45
|
+
/lib/bundler/man/
|
|
46
|
+
|
|
47
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
48
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
49
|
+
# Gemfile.lock
|
|
50
|
+
# .ruby-version
|
|
51
|
+
# .ruby-gemset
|
|
52
|
+
|
|
53
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
54
|
+
.rvmrc
|
|
55
|
+
|
|
56
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
|
57
|
+
# .rubocop-https?--*
|
|
58
|
+
|
|
59
|
+
planning/
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# RuboCop configuration for jekyll-highlight-cards
|
|
2
|
+
|
|
3
|
+
require:
|
|
4
|
+
- rubocop-rake
|
|
5
|
+
- rubocop-rspec
|
|
6
|
+
|
|
7
|
+
AllCops:
|
|
8
|
+
TargetRubyVersion: 3.1
|
|
9
|
+
NewCops: enable
|
|
10
|
+
Exclude:
|
|
11
|
+
- 'vendor/**/*'
|
|
12
|
+
- 'spec/fixtures/**/*'
|
|
13
|
+
- 'examples/**/*'
|
|
14
|
+
- 'planning/**/*'
|
|
15
|
+
|
|
16
|
+
# Style preferences
|
|
17
|
+
Style/StringLiterals:
|
|
18
|
+
Enabled: true
|
|
19
|
+
EnforcedStyle: double_quotes
|
|
20
|
+
|
|
21
|
+
Style/StringLiteralsInInterpolation:
|
|
22
|
+
Enabled: true
|
|
23
|
+
EnforcedStyle: double_quotes
|
|
24
|
+
|
|
25
|
+
Style/Documentation:
|
|
26
|
+
Enabled: false # Will enable after adding YARD documentation
|
|
27
|
+
|
|
28
|
+
Style/FrozenStringLiteralComment:
|
|
29
|
+
Enabled: true
|
|
30
|
+
EnforcedStyle: always
|
|
31
|
+
|
|
32
|
+
# Metrics - relaxed for initial development
|
|
33
|
+
Metrics/MethodLength:
|
|
34
|
+
Max: 25
|
|
35
|
+
Exclude:
|
|
36
|
+
- 'spec/**/*'
|
|
37
|
+
|
|
38
|
+
Metrics/BlockLength:
|
|
39
|
+
Exclude:
|
|
40
|
+
- 'spec/**/*'
|
|
41
|
+
- '*.gemspec'
|
|
42
|
+
|
|
43
|
+
Metrics/ClassLength:
|
|
44
|
+
Max: 200
|
|
45
|
+
|
|
46
|
+
Metrics/ModuleLength:
|
|
47
|
+
Max: 200
|
|
48
|
+
|
|
49
|
+
# Layout preferences
|
|
50
|
+
Layout/LineLength:
|
|
51
|
+
Max: 120
|
|
52
|
+
AllowedPatterns: ['^\s*#']
|
|
53
|
+
|
|
54
|
+
# RSpec-specific
|
|
55
|
+
RSpec/ExampleLength:
|
|
56
|
+
Max: 15
|
|
57
|
+
|
|
58
|
+
RSpec/MultipleExpectations:
|
|
59
|
+
Max: 5
|
|
60
|
+
|
|
61
|
+
RSpec/NestedGroups:
|
|
62
|
+
Max: 5
|
|
63
|
+
|
|
64
|
+
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.1.7
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.1](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.3.0...v0.3.1) (2025-12-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* CSS was not automatically loaded when plugin was added to a site ([#9](https://github.com/Texarkanine/jekyll-highlight-cards/issues/9)) ([2183771](https://github.com/Texarkanine/jekyll-highlight-cards/commit/21837712ea9d47d61495c082dfc6a1d99c7dcac2))
|
|
9
|
+
|
|
10
|
+
## [0.3.0](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.2.3...v0.3.0) (2025-12-08)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **polaroid:** Wrap Polaroids in a container to allow block or inline-block display ([#7](https://github.com/Texarkanine/jekyll-highlight-cards/issues/7)) ([9904795](https://github.com/Texarkanine/jekyll-highlight-cards/commit/990479582798b0741472e8555da09221c6cdd2e9))
|
|
16
|
+
|
|
17
|
+
## [0.2.3](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.2.2...v0.2.3) (2025-12-08)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **ci:** bot name ([f440e8e](https://github.com/Texarkanine/jekyll-highlight-cards/commit/f440e8e50f514e7905185849c12dd8dba0f579e4))
|
|
23
|
+
* **ci:** Bump Gemfile.lock in release-please PRs ([daa500f](https://github.com/Texarkanine/jekyll-highlight-cards/commit/daa500f0464504349c0e7daffc76a2d6ac8c3451))
|
|
24
|
+
* **ci:** Decorate commits properly when updating Gemfile.lock ([a2d17c4](https://github.com/Texarkanine/jekyll-highlight-cards/commit/a2d17c49e4857b548f2fea050581d671757e0afb))
|
|
25
|
+
* **ci:** Need to point rp at version-file ([17ad648](https://github.com/Texarkanine/jekyll-highlight-cards/commit/17ad648778f73ef27c0c0c122259276aed978197))
|
|
26
|
+
* **deps:** re-lock Gemfile? ([8988d60](https://github.com/Texarkanine/jekyll-highlight-cards/commit/8988d609a050d8b4f46007f7407df5c9c3be2b57))
|
|
27
|
+
|
|
28
|
+
## [0.2.2](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.2.1...v0.2.2) (2025-12-08)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **ci:** something up w/ trusted publishing, make deployment env explicit...? ([f391a7e](https://github.com/Texarkanine/jekyll-highlight-cards/commit/f391a7e341730f80b7bbf1db21212c1c9511c4a6))
|
|
34
|
+
|
|
35
|
+
## [0.2.1](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.2.0...v0.2.1) (2025-12-08)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* **ci:** tests run w/ rspec directly, not rake ([e14f8ed](https://github.com/Texarkanine/jekyll-highlight-cards/commit/e14f8edb4e41e165c516970eddbfa6adba3d5832))
|
|
41
|
+
|
|
42
|
+
## [0.2.0](https://github.com/Texarkanine/jekyll-highlight-cards/compare/v0.1.0...v0.2.0) (2025-12-08)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* Add RubyGems trusted publishing to release workflow ([#2](https://github.com/Texarkanine/jekyll-highlight-cards/issues/2)) ([905bd50](https://github.com/Texarkanine/jekyll-highlight-cards/commit/905bd50a11b788b3948b6ee2d995c8c1118060f1))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* **ci:** Add release-please-manifest.json ([30719ab](https://github.com/Texarkanine/jekyll-highlight-cards/commit/30719abdfb5964d55d26780ce9771c110d44f5cd))
|
|
53
|
+
* **ci:** leave all rp config to the JSON file ([47ca188](https://github.com/Texarkanine/jekyll-highlight-cards/commit/47ca1881c35e9946caa6e4deeee836f547c367f4))
|
|
54
|
+
* **ci:** separate Release-creation from gem publishing ([07114f9](https://github.com/Texarkanine/jekyll-highlight-cards/commit/07114f9e286f09c74812078b5b1f132257ab7b91))
|
data/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Contributing to jekyll-highlight-cards
|
|
2
|
+
|
|
3
|
+
## Development Setup
|
|
4
|
+
|
|
5
|
+
### Prerequisites
|
|
6
|
+
|
|
7
|
+
- Ruby 3.1 or higher
|
|
8
|
+
- Bundler
|
|
9
|
+
|
|
10
|
+
### Clone and Setup
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git clone https://github.com/texarkanine/jekyll-highlight-cards.git
|
|
14
|
+
cd jekyll-highlight-cards
|
|
15
|
+
bundle install
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Running Tests
|
|
19
|
+
|
|
20
|
+
Run the full test suite:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bundle exec rspec
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Run specific test file:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bundle exec rspec spec/linkcard_tag_spec.rb
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Run with documentation format:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bundle exec rspec --format documentation
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Code Quality
|
|
39
|
+
|
|
40
|
+
Check code style:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
bundle exec rubocop
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Auto-fix style issues:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bundle exec rubocop --autocorrect
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Building the Gem
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
gem build jekyll-highlight-cards.gemspec
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This creates `jekyll-highlight-cards-VERSION.gem`.
|
|
59
|
+
|
|
60
|
+
### Installing Locally
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
gem install ./jekyll-highlight-cards-*.gem
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or in a test Jekyll site's Gemfile:
|
|
67
|
+
|
|
68
|
+
```ruby
|
|
69
|
+
gem 'jekyll-highlight-cards', path: '/path/to/jekyll-highlight-cards'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Project Structure
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
jekyll-highlight-cards/
|
|
76
|
+
├── lib/
|
|
77
|
+
│ ├── jekyll-highlight-cards.rb # Main entry point
|
|
78
|
+
│ └── jekyll-highlight-cards/
|
|
79
|
+
│ ├── version.rb # Version constant
|
|
80
|
+
│ ├── archive_helper.rb # Archive integration
|
|
81
|
+
│ ├── dimension_parser.rb # Image sizing utilities
|
|
82
|
+
│ ├── expression_evaluator.rb # Liquid expression evaluation
|
|
83
|
+
│ ├── template_renderer.rb # Template rendering
|
|
84
|
+
│ ├── linkcard_tag.rb # Linkcard Liquid tag
|
|
85
|
+
│ ├── polaroid_tag.rb # Polaroid Liquid tag
|
|
86
|
+
│ └── image_sizing_hooks.rb # Markdown image sizing
|
|
87
|
+
├── _includes/highlight-cards/
|
|
88
|
+
│ ├── linkcard.html # Default linkcard template
|
|
89
|
+
│ └── polaroid.html # Default polaroid template
|
|
90
|
+
├── assets/css/
|
|
91
|
+
│ └── highlight-cards.scss # Default styles
|
|
92
|
+
├── spec/ # Test files
|
|
93
|
+
│ ├── spec_helper.rb
|
|
94
|
+
│ ├── *_spec.rb # Tests for each module
|
|
95
|
+
│ └── fixtures/ # Test fixtures
|
|
96
|
+
└── jekyll-highlight-cards.gemspec # Gem specification
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Development Workflow
|
|
100
|
+
|
|
101
|
+
### TDD Approach
|
|
102
|
+
|
|
103
|
+
This project follows Test-Driven Development:
|
|
104
|
+
|
|
105
|
+
1. **Write tests first** - Define expected behavior in specs
|
|
106
|
+
2. **Run tests** - Watch them fail (red)
|
|
107
|
+
3. **Write code** - Implement to make tests pass (green)
|
|
108
|
+
4. **Refactor** - Improve code while keeping tests green
|
|
109
|
+
5. **Verify** - Run full suite and Rubocop
|
|
110
|
+
|
|
111
|
+
### Adding Features
|
|
112
|
+
|
|
113
|
+
1. Create feature branch: `git checkout -b feature/my-feature`
|
|
114
|
+
2. Write tests in `spec/`
|
|
115
|
+
3. Implement feature in `lib/`
|
|
116
|
+
4. Run tests: `bundle exec rspec`
|
|
117
|
+
5. Check style: `bundle exec rubocop`
|
|
118
|
+
6. Commit with descriptive message
|
|
119
|
+
7. Push and create pull request
|
|
120
|
+
|
|
121
|
+
### Commit Messages
|
|
122
|
+
|
|
123
|
+
Use conventional commit format:
|
|
124
|
+
|
|
125
|
+
- `feat: Add new feature`
|
|
126
|
+
- `fix: Fix bug in XYZ`
|
|
127
|
+
- `docs: Update README`
|
|
128
|
+
- `test: Add tests for ABC`
|
|
129
|
+
- `refactor: Improve XYZ`
|
|
130
|
+
- `style: Fix Rubocop issues`
|
|
131
|
+
|
|
132
|
+
## Testing Guidelines
|
|
133
|
+
|
|
134
|
+
### Test Coverage
|
|
135
|
+
|
|
136
|
+
- Aim for >95% line coverage
|
|
137
|
+
- Cover happy paths and edge cases
|
|
138
|
+
- Test error handling
|
|
139
|
+
- Mock external dependencies (HTTP requests, file I/O)
|
|
140
|
+
|
|
141
|
+
### Test Structure
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
RSpec.describe MyModule do
|
|
145
|
+
describe ".method_name" do
|
|
146
|
+
context "with valid input" do
|
|
147
|
+
it "returns expected result" do
|
|
148
|
+
# test code
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
context "with invalid input" do
|
|
153
|
+
it "raises appropriate error" do
|
|
154
|
+
# test code
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Running Specific Tests
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Run single test file
|
|
165
|
+
bundle exec rspec spec/linkcard_tag_spec.rb
|
|
166
|
+
|
|
167
|
+
# Run single test (by line number)
|
|
168
|
+
bundle exec rspec spec/linkcard_tag_spec.rb:42
|
|
169
|
+
|
|
170
|
+
# Run tests matching pattern
|
|
171
|
+
bundle exec rspec spec/linkcard_tag_spec.rb -e "renders with title"
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Code Style
|
|
175
|
+
|
|
176
|
+
### Ruby Style Guide
|
|
177
|
+
|
|
178
|
+
Follow standard Ruby conventions:
|
|
179
|
+
|
|
180
|
+
- 2 space indentation
|
|
181
|
+
- Snake_case for methods and variables
|
|
182
|
+
- CamelCase for classes and modules
|
|
183
|
+
- SCREAMING_SNAKE_CASE for constants
|
|
184
|
+
- Maximum 120 characters per line
|
|
185
|
+
|
|
186
|
+
### Module Organization
|
|
187
|
+
|
|
188
|
+
- One class/module per file
|
|
189
|
+
- File names match class names (snake_case)
|
|
190
|
+
- Public methods documented with YARD comments
|
|
191
|
+
- Private methods below `private` keyword
|
|
192
|
+
|
|
193
|
+
## Troubleshooting
|
|
194
|
+
|
|
195
|
+
### Tests failing after changes
|
|
196
|
+
|
|
197
|
+
1. Run full suite: `bundle exec rspec`
|
|
198
|
+
2. Check specific failing test
|
|
199
|
+
3. Review recent changes
|
|
200
|
+
4. Verify test fixtures are correct
|
|
201
|
+
|
|
202
|
+
### Rubocop errors
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
bundle exec rubocop --autocorrect
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
If auto-correct doesn't work, manually fix reported issues.
|
|
209
|
+
|
|
210
|
+
### Gem won't build
|
|
211
|
+
|
|
212
|
+
1. Check `jekyll-highlight-cards.gemspec` for errors
|
|
213
|
+
2. Verify all required files exist
|
|
214
|
+
3. Check Ruby version compatibility
|
|
215
|
+
|
|
216
|
+
## Questions?
|
|
217
|
+
|
|
218
|
+
Open an issue on GitHub for questions, bug reports, or feature requests.
|
|
219
|
+
|