jekyll-documents 0.7.4 → 0.7.6
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 +4 -4
- data/CHANGELOG.md +68 -2
- data/README.md +35 -4
- data/_includes/document_download_attributes.html +0 -0
- data/_includes/document_metadata_extra.html +0 -0
- data/_layouts/document.html +2 -2
- data/jekyll-documents.gemspec +5 -1
- data/lib/jekyll/documents/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81bf5267fbf1af10ac172d0b7b0962ffefa222fadd47c7b6dbd1df100ff4ffa4
|
|
4
|
+
data.tar.gz: dc4c65b4b050e7a64883dc17183cfa02b65c69ccb668d6c56fbc213517f8e599
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b06f57c4a2923181bb8d7612f77935177de32797ee2d7aff40442d13162d629875884a0fb4e9c647415ba60799574f1f92129a19541180c082222af65efed049
|
|
7
|
+
data.tar.gz: a3fa9c436896180548d9e7ced68ce624a195bdf79ca31951323590876b3b04f13939c7ad437f08f02f080b5644ac68d66e4ac560de0b7a9a7fdcf51e7d982992
|
data/CHANGELOG.md
CHANGED
|
@@ -2,12 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.7.6] - 2026-09-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Optional document metadata and download-link attribute include hooks in the generated layout
|
|
10
|
+
- README recipe for provider-neutral template customization and optional GoatCounter click events
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bump dev dependencies: simplecov 1.3.1, @playwright/test 1.63.0, markdownlint-cli2 0.23.3 (plus transitive activesupport 8.1.4, regexp_parser 2.13.1, sass-embedded 1.105.0)
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Browser fixture build now invokes `bundle exec jekyll` and surfaces build output on failure — the previous bare `jekyll` invocation silently swallowed a sass-embedded version conflict
|
|
19
|
+
|
|
20
|
+
## [0.7.5] - 2026-09-21
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Git hooks now live in `bin/hooks/` as tracked files — `bin/install-hooks.sh` sets `core.hooksPath` so git runs them directly, eliminating drift between committed and installed hooks
|
|
25
|
+
- `.ruby-version` is now the single source for the supported Ruby floor — the gemspec derives `required_ruby_version` from it instead of keeping a separate literal
|
|
26
|
+
- Bump `plaintext` to `~> 0.4`
|
|
27
|
+
- Sync `example/` lockfile with the root bundle (jekyll-documents 0.7.4, bigdecimal 4.1.3, google-protobuf 4.36.2, sass-embedded 1.104.1)
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- `.devin/wiki.json` steering notes updated to `Ruby >= 3.4` and the stale RSpec example count removed (matched the gemspec requirement and current gates)
|
|
32
|
+
- Added `rake version:check_consistency` (wired into `version:pre_release`) — fails the release if `Ruby >= X.Y` literals in tracked docs or `.rubocop.yml`'s `TargetRubyVersion` don't match the `.ruby-version` floor
|
|
33
|
+
|
|
5
34
|
## [0.7.4] - 2026-09-18
|
|
6
35
|
|
|
7
36
|
### Added
|
|
37
|
+
|
|
8
38
|
- Added Codecov coverage reporting: CI uploads Cobertura XML (via `simplecov-cobertura`) after the Ruby quality suite, with `codecov.yml` status checks (98% project / 90% patch targets)
|
|
9
39
|
|
|
10
40
|
### Changed
|
|
41
|
+
|
|
11
42
|
- Auto-update `Gemfile.lock` on `rake version:bump` via `bundle lock` (use `SKIP_LOCK=1` to skip)
|
|
12
43
|
- Further reduced `latest_documents.rb` `render` complexity by extracting `resolve_count` and `select_documents`
|
|
13
44
|
- Extracted shared `TagHelpers` module (markup parsing, document collection access, path normalization, HTML escaping) used by `doc_link`, `doc_category`, `document_icon`, and `latest_documents` tags — removes SonarCloud-flagged duplication
|
|
@@ -17,12 +48,14 @@
|
|
|
17
48
|
## [0.7.3] - 2026-09-10
|
|
18
49
|
|
|
19
50
|
### Added
|
|
51
|
+
|
|
20
52
|
- Added Semgrep CE security scanning with a custom ReDoS detection rule for pre-commit and CI
|
|
21
53
|
- Added CodeFactor code quality analysis badge and integration
|
|
22
54
|
- Added SEMGREP_APP_TOKEN integration for Cloud dashboard sync from CI
|
|
23
55
|
- Added `rake version:pre_release` task for pre-release security gate with FORCE=1 override
|
|
24
56
|
|
|
25
57
|
### Changed
|
|
58
|
+
|
|
26
59
|
- Updated CI to Node.js 26 and current Node 24-based GitHub Actions runtimes
|
|
27
60
|
- Pinned all GitHub Actions to commit SHAs to prevent supply-chain attacks
|
|
28
61
|
- Added cooldown period to Dependabot configuration
|
|
@@ -36,16 +69,19 @@
|
|
|
36
69
|
- `options_parser.rb`: Extracted `read_value` from `parse_options`
|
|
37
70
|
|
|
38
71
|
### Fixed
|
|
72
|
+
|
|
39
73
|
- Replaced dangerous subshell in system spec with Open3.capture2
|
|
40
74
|
|
|
41
75
|
## [0.7.2] - 2026-09-09
|
|
42
76
|
|
|
43
77
|
### Fixed
|
|
78
|
+
|
|
44
79
|
- Replaced polynomial-time Liquid tag option regexes with a shared linear-time parser
|
|
45
80
|
|
|
46
81
|
## [0.7.1] - 2026-09-09
|
|
47
82
|
|
|
48
83
|
### Changed
|
|
84
|
+
|
|
49
85
|
- Development dependencies now live in `Gemfile`; the gemspec declares runtime dependencies only
|
|
50
86
|
- Removed redundant transitive dependency pins and made `Gemfile` read the exact Ruby version from `.ruby-version`
|
|
51
87
|
- Refreshed compatible locked dependency versions and tracked `Gemfile.lock` for reproducible CI development environments
|
|
@@ -54,18 +90,21 @@
|
|
|
54
90
|
## [0.7.0] - 2026-09-05
|
|
55
91
|
|
|
56
92
|
### Added
|
|
93
|
+
|
|
57
94
|
- Added stable `source_path`, `category_path`, and `category_slug` document metadata and JSON index fields
|
|
58
95
|
- Added exact `path:` resolution for document and category tags plus explicit category aggregation
|
|
59
96
|
- Added path/date permalink placeholders and full-path-first category mappings
|
|
60
97
|
- Added configurable `warn` or `strict` handling for unresolved and ambiguous tag references
|
|
61
98
|
|
|
62
99
|
### Fixed
|
|
100
|
+
|
|
63
101
|
- Ambiguous tags no longer silently select the first match
|
|
64
102
|
- Duplicate generated permalinks now abort the build and identify every conflicting source file
|
|
65
103
|
|
|
66
104
|
## [0.6.1] - 2026-09-03
|
|
67
105
|
|
|
68
106
|
### Changed
|
|
107
|
+
|
|
69
108
|
- Text extraction cache keys now include the source digest, extraction configuration, Plaintext version, and cache schema version so configuration or extractor changes invalidate stale results
|
|
70
109
|
- Extracted document content now retains searchable metadata for title, category, file type, and date
|
|
71
110
|
- Text cache cleanup now preserves shared digest files and removes orphaned files safely
|
|
@@ -76,30 +115,35 @@
|
|
|
76
115
|
- Removed redundant package metadata and duplicate development dependency declarations
|
|
77
116
|
|
|
78
117
|
### Fixed
|
|
118
|
+
|
|
79
119
|
- Replaced use of the private ActiveSupport deprecation API with the public `ActiveSupport.deprecator` API
|
|
80
120
|
- Empty extraction results now fall back to metadata-only searchable content
|
|
81
121
|
- Manifest loading now validates entries, logs filesystem read failures, and resets dirty state after successful saves
|
|
82
122
|
- Updated stale CI, development, cache-cleanup, and package-lock documentation
|
|
83
123
|
|
|
84
124
|
### Tests
|
|
125
|
+
|
|
85
126
|
- Added real PDF extraction coverage and stronger cache-hit/persistence assertions
|
|
86
127
|
- Added tests for cache configuration invalidation, UTF-8 byte truncation, shared cache references, orphan cleanup, and conditional cache exclusion
|
|
87
128
|
|
|
88
129
|
## [0.6.0] - 2026-08-27
|
|
89
130
|
|
|
90
131
|
### Added
|
|
132
|
+
|
|
91
133
|
- Auto-inject `file_type`, `icon_url`, and `icon_set` into jekyll-client-search's `passthrough_fields` config when `documents` is in the search collections — zero extra config needed for icons in search results
|
|
92
134
|
- Documented field renaming in jekyll-client-search for integration with other search conventions
|
|
93
135
|
- Framework-agnostic CSS file (`assets/css/documents.css`) with icon scaling utility classes (`icon-x1` through `icon-x9`: 16px to 512px) — no dependency on Bulma, Bootstrap, or Tailwind
|
|
94
136
|
- Icons default to `1em` (line-height) so they scale with surrounding text
|
|
95
137
|
|
|
96
138
|
### Changed
|
|
139
|
+
|
|
97
140
|
- Renamed icon CSS class from `file-icon` to `document-file-icon` to avoid collision with Bulma's `.file-icon` (which uses `display: flex` and breaks inline SVG icons onto a separate line)
|
|
98
141
|
- Inline `1em` sizing added to JS-rendered and folder icons as a fallback when the CSS file is not included
|
|
99
142
|
|
|
100
143
|
## [0.5.0] - 2026-08-27
|
|
101
144
|
|
|
102
145
|
### Added
|
|
146
|
+
|
|
103
147
|
- Text extraction from PDF, DOCX, XLSX, PPTX, ODT, ODS, and ODP files via the optional `plaintext` gem, enabling full-text search of document contents through `jekyll-client-search`
|
|
104
148
|
- `extract_text` configuration option to enable text extraction (disabled by default)
|
|
105
149
|
- `text_max_bytes` configuration option to control extracted text truncation (default 500KB)
|
|
@@ -110,6 +154,7 @@
|
|
|
110
154
|
- `plaintext` as a development dependency for testing extraction
|
|
111
155
|
|
|
112
156
|
### Changed
|
|
157
|
+
|
|
113
158
|
- Minimum Ruby version raised from 3.3 to 3.4 (tested on Ruby 3.4.10)
|
|
114
159
|
- RuboCop target version updated from 3.3 to 3.4
|
|
115
160
|
- Updated development dependencies: `rubocop` ~> 1.90, `rubocop-performance` ~> 1.27, `simplecov` ~> 1.1, `rake` ~> 13.4
|
|
@@ -120,18 +165,19 @@
|
|
|
120
165
|
- Suppressed ActiveSupport deprecation warnings from the `plaintext` gem (`String#mb_chars`, deprecated in Rails 8.2)
|
|
121
166
|
|
|
122
167
|
### Fixed
|
|
168
|
+
|
|
123
169
|
- `CHANGELOG.md` file permissions corrected to be world-readable (was `600`, now `644`)
|
|
124
170
|
|
|
125
171
|
## [0.4.0] - 2026-08-26
|
|
126
172
|
|
|
127
173
|
### Added
|
|
174
|
+
|
|
128
175
|
- `categories` array baked into each document's data (in addition to the existing singular `category`) for compatibility with search plugins like `jekyll-client-search` that expect the plural Jekyll convention
|
|
129
176
|
- Searchable content string (title, category, file type, date) set as document content so client-side search engines can index uploaded documents
|
|
130
177
|
|
|
131
178
|
### Changed
|
|
132
|
-
- Refactored `Generator#generate` by extracting `bake_document_data` and `searchable_content` helper methods to keep method length within RuboCop limits
|
|
133
179
|
|
|
134
|
-
|
|
180
|
+
- Refactored `Generator#generate` by extracting `bake_document_data` and `searchable_content` helper methods to keep method length within RuboCop limits
|
|
135
181
|
- Simplified release workflow to tag-push trigger (`push: tags: v*`) — no manual `gh release create` needed
|
|
136
182
|
- Switched to RubyGems trusted publishing (`rubygems/release-gem@v1` with OIDC)
|
|
137
183
|
- Centralized version in `version.rb` as single source of truth — removed `version` field from `package.json` (was drifted to 0.3.1)
|
|
@@ -147,6 +193,7 @@
|
|
|
147
193
|
## [0.3.3] - 2026-08-12
|
|
148
194
|
|
|
149
195
|
### Added
|
|
196
|
+
|
|
150
197
|
- `{% doc_link "title" %}` Liquid tag for linking to documents by partial title or slug match (case-insensitive); renders file icon, title, and human-readable file size; supports `text:"custom label"`, `icon:false`, and `size:false` options
|
|
151
198
|
- `{% doc_category "name" %}` Liquid tag for linking to category pages or listing documents by category; supports `text:"label"`, `list:true`, and `limit:N` options
|
|
152
199
|
- `file_size` attribute baked into each document's data at generation time
|
|
@@ -156,20 +203,24 @@
|
|
|
156
203
|
## [0.3.2] - 2026-08-12
|
|
157
204
|
|
|
158
205
|
### Added
|
|
206
|
+
|
|
159
207
|
- Auto-registration of gem-packaged `_layouts` and `_includes` via a `:site, :after_init` hook so Jekyll discovers the `document` layout and all includes without the gem being declared as a theme; user-provided files always take precedence
|
|
160
208
|
- 7 RSpec examples for `LayoutRegistrar` covering copy, override, idempotency, and hook registration
|
|
161
209
|
|
|
162
210
|
### Fixed
|
|
211
|
+
|
|
163
212
|
- Corrected publish workflow Ruby version from 3.2 to 3.3 to match the gemspec `required_ruby_version` so the gem builds and publishes to RubyGems successfully
|
|
164
213
|
|
|
165
214
|
## [0.3.1] - 2026-08-03
|
|
166
215
|
|
|
167
216
|
### Added
|
|
217
|
+
|
|
168
218
|
- Added the context-aware `{% document_icon page %}` Liquid tag for simple icon rendering
|
|
169
219
|
- Added installed-gem system coverage for all supported document types and icon themes
|
|
170
220
|
- Added Playwright browser coverage for search interaction, links, icons, baseurl, and network errors
|
|
171
221
|
|
|
172
222
|
### Changed
|
|
223
|
+
|
|
173
224
|
- Minimum Ruby version raised from `>= 3.2` to `>= 3.3`
|
|
174
225
|
- Updated RuboCop target Ruby version to 3.3
|
|
175
226
|
- Updated compatible development gems, including RuboCop, Reek, RSpec, and Playwright tooling
|
|
@@ -177,6 +228,7 @@
|
|
|
177
228
|
- Added package-content checks to verify the built gem contains runtime templates, icons, JavaScript, and Liquid tags
|
|
178
229
|
|
|
179
230
|
### Fixed
|
|
231
|
+
|
|
180
232
|
- Corrected non-color icon mappings to reference packaged SVG assets
|
|
181
233
|
- Registered packaged icons and search JavaScript for copying during Jekyll builds
|
|
182
234
|
- Made document search respect the configured index path and site base URL
|
|
@@ -187,6 +239,7 @@
|
|
|
187
239
|
- Made Reek failures fail the quality task consistently
|
|
188
240
|
|
|
189
241
|
### Verification
|
|
242
|
+
|
|
190
243
|
- 186 Ruby/system examples passing with 100% Ruby line coverage
|
|
191
244
|
- 3 Playwright browser tests passing
|
|
192
245
|
- 0 RuboCop offenses, 0 Reek warnings, and 0 Bundler Audit vulnerabilities
|
|
@@ -194,6 +247,7 @@
|
|
|
194
247
|
## [0.3.0] - 2026-07-23
|
|
195
248
|
|
|
196
249
|
### Added
|
|
250
|
+
|
|
197
251
|
- **Baked icon data**: Generator now bakes `icon_url` and `icon_set` into each document's data at build time, eliminating the need for Liquid context in filters
|
|
198
252
|
- **`FileTypeIcons.icon_for` class method**: Allows icon URL resolution without a Liquid context (used by generator)
|
|
199
253
|
- **Search JavaScript wired up**: `_includes/documents_search.html` now loads Lunr.js and `documents-search.js` for out-of-the-box client-side search
|
|
@@ -203,6 +257,7 @@
|
|
|
203
257
|
- **System test for full build pipeline**: End-to-end test covering generator → JSON index → tag rendering
|
|
204
258
|
|
|
205
259
|
### Changed
|
|
260
|
+
|
|
206
261
|
- **Minimum Ruby version**: Bumped from `>= 2.7` to `>= 3.2` (zeitwerk 2.7+ — a Jekyll dependency — requires Ruby >= 3.2)
|
|
207
262
|
- **RuboCop `TargetRubyVersion`**: Updated from `2.7` to `3.2` to match gemspec
|
|
208
263
|
- **Templates use baked icon data**: `latest_documents.html`, `documents_list.html`, `document.html` now use `{{ doc.icon_url }}` instead of the broken `file_type_icon_tag` filter
|
|
@@ -217,6 +272,7 @@
|
|
|
217
272
|
- **Reek**: 0 warnings (7 files inspected)
|
|
218
273
|
|
|
219
274
|
### Fixed
|
|
275
|
+
|
|
220
276
|
- **Icon set config ignored in templates** (High): `file_type_icon_tag` filter never received Liquid context, causing `icon_set` config to be silently ignored — always fell back to `"color"`. Fixed by baking icon URLs into document data at generation time
|
|
221
277
|
- **`rel_path` slicing** (Low): Replaced fragile `path[(site.source.length + 1)..]` with `String#delete_prefix` for robustness
|
|
222
278
|
- **`Date.parse` in `parse_filename`** (Low): Replaced with `Date.new(year, month, day)` using integer-converted regex captures for clarity
|
|
@@ -227,6 +283,7 @@
|
|
|
227
283
|
## [0.2.0] - 2026-03-12
|
|
228
284
|
|
|
229
285
|
### Added
|
|
286
|
+
|
|
230
287
|
- **Comprehensive code quality tools** (RuboCop, Reek, Bundler Audit, SimpleCov)
|
|
231
288
|
- **98.99% test coverage** with integration tests for Liquid tags
|
|
232
289
|
- **Enhanced release automation** with 10 safety checks and validations
|
|
@@ -240,6 +297,7 @@
|
|
|
240
297
|
- **Post-release verification** with helpful links
|
|
241
298
|
|
|
242
299
|
### Changed
|
|
300
|
+
|
|
243
301
|
- **Consolidated documentation** (README.Development.md combines all dev docs)
|
|
244
302
|
- **Simplified README.md** with KISS approach
|
|
245
303
|
- **Improved Rake tasks** with better organization and help system
|
|
@@ -247,12 +305,14 @@
|
|
|
247
305
|
- **Better error handling** in release scripts
|
|
248
306
|
|
|
249
307
|
### Fixed
|
|
308
|
+
|
|
250
309
|
- **Liquid tag testing** through integration tests (resolves 98% coverage)
|
|
251
310
|
- **Keyword argument compatibility** in filters
|
|
252
311
|
- **Release script safety** with comprehensive validation
|
|
253
312
|
- **Documentation consistency** across all markdown files
|
|
254
313
|
|
|
255
314
|
### Development
|
|
315
|
+
|
|
256
316
|
- **Quality metrics**: 98.99% coverage • 0 vulnerabilities • 3 RuboCop offenses
|
|
257
317
|
- **Release workflow**: Fully automated with rollback capability
|
|
258
318
|
- **Testing**: 79 examples, 0 failures, integration tests for all features
|
|
@@ -260,11 +320,13 @@
|
|
|
260
320
|
## [0.1.2] - 2026-03-09
|
|
261
321
|
|
|
262
322
|
### Added
|
|
323
|
+
|
|
263
324
|
- **Release automation scripts**
|
|
264
325
|
|
|
265
326
|
## [0.1.1] - 2026-03-09
|
|
266
327
|
|
|
267
328
|
### Added
|
|
329
|
+
|
|
268
330
|
- **4 icon sets**: color, lines, minimal, ultra-minimal (configurable)
|
|
269
331
|
- File type icons for 20+ formats (PDF, DOCX, XLSX, etc.)
|
|
270
332
|
- Folder icons for category lists
|
|
@@ -277,6 +339,7 @@
|
|
|
277
339
|
- `icon_set` configuration option
|
|
278
340
|
|
|
279
341
|
### Fixed
|
|
342
|
+
|
|
280
343
|
- Icon URLs (now using actual svgrepo.com icons)
|
|
281
344
|
- XSS vulnerabilities (HTML escaping)
|
|
282
345
|
- Date format standardized to ISO (YYYY-MM-DD)
|
|
@@ -284,17 +347,20 @@
|
|
|
284
347
|
- JavaScript search null safety
|
|
285
348
|
|
|
286
349
|
### Changed
|
|
350
|
+
|
|
287
351
|
- Icons now included in gem (no external dependencies)
|
|
288
352
|
- JSON index includes file_type and extension
|
|
289
353
|
- Search results display icons dynamically
|
|
290
354
|
- Improved documentation and examples
|
|
291
355
|
|
|
292
356
|
### Attribution
|
|
357
|
+
|
|
293
358
|
- Icons from [SVG Repo](https://www.svgrepo.com)
|
|
294
359
|
|
|
295
360
|
## [0.1.0] - 2026-03-09
|
|
296
361
|
|
|
297
362
|
### Initial Release
|
|
363
|
+
|
|
298
364
|
- Auto-collection from `assets/documents/`
|
|
299
365
|
- Filename parsing: `YYYY-MM-DD_Title.ext`
|
|
300
366
|
- Category from folder structure
|
data/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# jekyll-documents
|
|
2
|
+
|
|
2
3
|
[](https://github.com/gundestrup/jekyll-documents)
|
|
3
4
|
[](https://github.com/gundestrup/jekyll-documents/actions/workflows/test.yml)
|
|
4
5
|
[](https://codecov.io/gh/gundestrup/jekyll-documents)
|
|
@@ -34,7 +35,7 @@ documents:
|
|
|
34
35
|
icon_set: "color" # color, lines, minimal, ultra-minimal
|
|
35
36
|
```
|
|
36
37
|
|
|
37
|
-
```
|
|
38
|
+
```text
|
|
38
39
|
# Add files
|
|
39
40
|
assets/documents/reports/2026-03-01_Annual_Report.pdf
|
|
40
41
|
assets/documents/minutes/2026-02-15_Board_Meeting.docx
|
|
@@ -51,7 +52,7 @@ assets/documents/minutes/2026-02-15_Board_Meeting.docx
|
|
|
51
52
|
|
|
52
53
|
**Format**: `YYYY-MM-DD_Title.ext`
|
|
53
54
|
|
|
54
|
-
```
|
|
55
|
+
```text
|
|
55
56
|
assets/documents/reports/2026-03-01_Annual_Report.pdf
|
|
56
57
|
```
|
|
57
58
|
|
|
@@ -115,6 +116,36 @@ Link mode renders an `<a>` tag to the category page. List mode renders a `<ul>`
|
|
|
115
116
|
Use `path:` for an exact, case-sensitive category path, `limit:N` to cap the list, and
|
|
116
117
|
`aggregate:true list:true` to explicitly combine repeated short category names.
|
|
117
118
|
|
|
119
|
+
## Document template customization
|
|
120
|
+
|
|
121
|
+
The document layout provides two optional include hooks. Both are empty by default, and the
|
|
122
|
+
`LayoutRegistrar` copies them only when the site does not already provide a file with that name:
|
|
123
|
+
|
|
124
|
+
- `_includes/document_metadata_extra.html` renders inside the document metadata paragraph, after the
|
|
125
|
+
date and category.
|
|
126
|
+
- `_includes/document_download_attributes.html` renders inside the opening tag of the document
|
|
127
|
+
download link. It should output zero or more valid HTML attributes, including any leading spaces.
|
|
128
|
+
|
|
129
|
+
For example, a site can put a downloads label or count display in the metadata include, and add
|
|
130
|
+
analytics attributes to the download link without copying the full document layout. These hooks are
|
|
131
|
+
provider-neutral; the site owns their content and any associated JavaScript.
|
|
132
|
+
|
|
133
|
+
### Optional GoatCounter click events
|
|
134
|
+
|
|
135
|
+
If the site loads GoatCounter's `count.js`, it can record clicks on the document-page download link
|
|
136
|
+
using the attributes include. Use a stable, unique event name for each document:
|
|
137
|
+
|
|
138
|
+
```liquid
|
|
139
|
+
data-goatcounter-click="download-{{ page.source_path | url_encode | escape }}"
|
|
140
|
+
data-goatcounter-no-session="1"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`data-goatcounter-no-session="1"` counts repeat clicks by the same visitor. GoatCounter counts a
|
|
144
|
+
click attempt, not a confirmed file transfer. This hook covers the download link on the document
|
|
145
|
+
page only; direct file links in site-authored listings or posts need the same event attributes of
|
|
146
|
+
their own. The gem does not load GoatCounter, fetch event totals, or combine historical baselines.
|
|
147
|
+
Those remain optional site-level analytics behavior.
|
|
148
|
+
|
|
118
149
|
## Configuration
|
|
119
150
|
|
|
120
151
|
```yaml
|
|
@@ -299,7 +330,7 @@ documents:
|
|
|
299
330
|
|
|
300
331
|
Add the cache directory to `.gitignore`:
|
|
301
332
|
|
|
302
|
-
```
|
|
333
|
+
```text
|
|
303
334
|
.cache/jekyll-documents/
|
|
304
335
|
```
|
|
305
336
|
|
|
@@ -309,7 +340,7 @@ The `plaintext` gem uses the `rubyzip` Ruby gem for Office formats (no CLI
|
|
|
309
340
|
tools needed). PDF extraction shells out to a system command:
|
|
310
341
|
|
|
311
342
|
| Format | Tool |
|
|
312
|
-
|
|
343
|
+
| -------- | ------ |
|
|
313
344
|
| PDF | `pdftotext` (poppler-utils) |
|
|
314
345
|
| DOCX/PPTX/XLSX | rubyzip (Ruby gem, no CLI needed) |
|
|
315
346
|
| ODT/ODS/ODP | rubyzip (Ruby gem, no CLI needed) |
|
|
File without changes
|
|
File without changes
|
data/_layouts/document.html
CHANGED
|
@@ -7,12 +7,12 @@ layout: default
|
|
|
7
7
|
<h1>{{ page.title }}</h1>
|
|
8
8
|
<p class="document-meta">
|
|
9
9
|
<strong>Date:</strong> {{ page.date | date: "%Y-%m-%d" }}<br>
|
|
10
|
-
<strong>Category:</strong> {{ page.category }}
|
|
10
|
+
<strong>Category:</strong> {{ page.category }}{% include document_metadata_extra.html %}
|
|
11
11
|
</p>
|
|
12
12
|
</header>
|
|
13
13
|
|
|
14
14
|
<p>
|
|
15
|
-
<a href="{{ page.file_url | relative_url }}" class="document-download">
|
|
15
|
+
<a href="{{ page.file_url | relative_url }}" class="document-download"{% include document_download_attributes.html %}>
|
|
16
16
|
{% document_icon page %}
|
|
17
17
|
Download ({{ page.extension | remove: "." | upcase }})
|
|
18
18
|
</a>
|
data/jekyll-documents.gemspec
CHANGED
|
@@ -24,7 +24,11 @@ Gem::Specification.new do |spec|
|
|
|
24
24
|
"rubygems_mfa_required" => "true"
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
# Floor derived from .ruby-version's major.minor — single source for the
|
|
28
|
+
# supported minimum. If the floor ever needs to lag the dev version
|
|
29
|
+
# (e.g. support 3.3 while developing on 3.4), revert to a literal here.
|
|
30
|
+
spec.required_ruby_version =
|
|
31
|
+
">= #{File.read(File.expand_path('.ruby-version', __dir__)).strip[/\d+\.\d+/]}"
|
|
28
32
|
|
|
29
33
|
spec.files = Dir.glob("{lib,assets,_includes,_layouts}/**/*") +
|
|
30
34
|
["README.md", "CHANGELOG.md", "LICENSE", "jekyll-documents.gemspec"]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-documents
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Svend Gundestrup
|
|
@@ -42,6 +42,8 @@ files:
|
|
|
42
42
|
- LICENSE
|
|
43
43
|
- README.md
|
|
44
44
|
- _includes/category_list.html
|
|
45
|
+
- _includes/document_download_attributes.html
|
|
46
|
+
- _includes/document_metadata_extra.html
|
|
45
47
|
- _includes/documents_list.html
|
|
46
48
|
- _includes/documents_search.html
|
|
47
49
|
- _includes/latest_documents.html
|