jekyll-documents 0.7.5 → 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 +58 -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/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
|
@@ -1,23 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [Unreleased]
|
|
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
|
+
|
|
3
20
|
## [0.7.5] - 2026-09-21
|
|
4
21
|
|
|
5
22
|
### Changed
|
|
23
|
+
|
|
6
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
|
|
7
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
|
|
8
26
|
- Bump `plaintext` to `~> 0.4`
|
|
9
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)
|
|
10
28
|
|
|
11
29
|
### Fixed
|
|
30
|
+
|
|
12
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)
|
|
13
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
|
|
14
33
|
|
|
15
34
|
## [0.7.4] - 2026-09-18
|
|
16
35
|
|
|
17
36
|
### Added
|
|
37
|
+
|
|
18
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)
|
|
19
39
|
|
|
20
40
|
### Changed
|
|
41
|
+
|
|
21
42
|
- Auto-update `Gemfile.lock` on `rake version:bump` via `bundle lock` (use `SKIP_LOCK=1` to skip)
|
|
22
43
|
- Further reduced `latest_documents.rb` `render` complexity by extracting `resolve_count` and `select_documents`
|
|
23
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
|
|
@@ -27,12 +48,14 @@
|
|
|
27
48
|
## [0.7.3] - 2026-09-10
|
|
28
49
|
|
|
29
50
|
### Added
|
|
51
|
+
|
|
30
52
|
- Added Semgrep CE security scanning with a custom ReDoS detection rule for pre-commit and CI
|
|
31
53
|
- Added CodeFactor code quality analysis badge and integration
|
|
32
54
|
- Added SEMGREP_APP_TOKEN integration for Cloud dashboard sync from CI
|
|
33
55
|
- Added `rake version:pre_release` task for pre-release security gate with FORCE=1 override
|
|
34
56
|
|
|
35
57
|
### Changed
|
|
58
|
+
|
|
36
59
|
- Updated CI to Node.js 26 and current Node 24-based GitHub Actions runtimes
|
|
37
60
|
- Pinned all GitHub Actions to commit SHAs to prevent supply-chain attacks
|
|
38
61
|
- Added cooldown period to Dependabot configuration
|
|
@@ -46,16 +69,19 @@
|
|
|
46
69
|
- `options_parser.rb`: Extracted `read_value` from `parse_options`
|
|
47
70
|
|
|
48
71
|
### Fixed
|
|
72
|
+
|
|
49
73
|
- Replaced dangerous subshell in system spec with Open3.capture2
|
|
50
74
|
|
|
51
75
|
## [0.7.2] - 2026-09-09
|
|
52
76
|
|
|
53
77
|
### Fixed
|
|
78
|
+
|
|
54
79
|
- Replaced polynomial-time Liquid tag option regexes with a shared linear-time parser
|
|
55
80
|
|
|
56
81
|
## [0.7.1] - 2026-09-09
|
|
57
82
|
|
|
58
83
|
### Changed
|
|
84
|
+
|
|
59
85
|
- Development dependencies now live in `Gemfile`; the gemspec declares runtime dependencies only
|
|
60
86
|
- Removed redundant transitive dependency pins and made `Gemfile` read the exact Ruby version from `.ruby-version`
|
|
61
87
|
- Refreshed compatible locked dependency versions and tracked `Gemfile.lock` for reproducible CI development environments
|
|
@@ -64,18 +90,21 @@
|
|
|
64
90
|
## [0.7.0] - 2026-09-05
|
|
65
91
|
|
|
66
92
|
### Added
|
|
93
|
+
|
|
67
94
|
- Added stable `source_path`, `category_path`, and `category_slug` document metadata and JSON index fields
|
|
68
95
|
- Added exact `path:` resolution for document and category tags plus explicit category aggregation
|
|
69
96
|
- Added path/date permalink placeholders and full-path-first category mappings
|
|
70
97
|
- Added configurable `warn` or `strict` handling for unresolved and ambiguous tag references
|
|
71
98
|
|
|
72
99
|
### Fixed
|
|
100
|
+
|
|
73
101
|
- Ambiguous tags no longer silently select the first match
|
|
74
102
|
- Duplicate generated permalinks now abort the build and identify every conflicting source file
|
|
75
103
|
|
|
76
104
|
## [0.6.1] - 2026-09-03
|
|
77
105
|
|
|
78
106
|
### Changed
|
|
107
|
+
|
|
79
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
|
|
80
109
|
- Extracted document content now retains searchable metadata for title, category, file type, and date
|
|
81
110
|
- Text cache cleanup now preserves shared digest files and removes orphaned files safely
|
|
@@ -86,30 +115,35 @@
|
|
|
86
115
|
- Removed redundant package metadata and duplicate development dependency declarations
|
|
87
116
|
|
|
88
117
|
### Fixed
|
|
118
|
+
|
|
89
119
|
- Replaced use of the private ActiveSupport deprecation API with the public `ActiveSupport.deprecator` API
|
|
90
120
|
- Empty extraction results now fall back to metadata-only searchable content
|
|
91
121
|
- Manifest loading now validates entries, logs filesystem read failures, and resets dirty state after successful saves
|
|
92
122
|
- Updated stale CI, development, cache-cleanup, and package-lock documentation
|
|
93
123
|
|
|
94
124
|
### Tests
|
|
125
|
+
|
|
95
126
|
- Added real PDF extraction coverage and stronger cache-hit/persistence assertions
|
|
96
127
|
- Added tests for cache configuration invalidation, UTF-8 byte truncation, shared cache references, orphan cleanup, and conditional cache exclusion
|
|
97
128
|
|
|
98
129
|
## [0.6.0] - 2026-08-27
|
|
99
130
|
|
|
100
131
|
### Added
|
|
132
|
+
|
|
101
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
|
|
102
134
|
- Documented field renaming in jekyll-client-search for integration with other search conventions
|
|
103
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
|
|
104
136
|
- Icons default to `1em` (line-height) so they scale with surrounding text
|
|
105
137
|
|
|
106
138
|
### Changed
|
|
139
|
+
|
|
107
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)
|
|
108
141
|
- Inline `1em` sizing added to JS-rendered and folder icons as a fallback when the CSS file is not included
|
|
109
142
|
|
|
110
143
|
## [0.5.0] - 2026-08-27
|
|
111
144
|
|
|
112
145
|
### Added
|
|
146
|
+
|
|
113
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`
|
|
114
148
|
- `extract_text` configuration option to enable text extraction (disabled by default)
|
|
115
149
|
- `text_max_bytes` configuration option to control extracted text truncation (default 500KB)
|
|
@@ -120,6 +154,7 @@
|
|
|
120
154
|
- `plaintext` as a development dependency for testing extraction
|
|
121
155
|
|
|
122
156
|
### Changed
|
|
157
|
+
|
|
123
158
|
- Minimum Ruby version raised from 3.3 to 3.4 (tested on Ruby 3.4.10)
|
|
124
159
|
- RuboCop target version updated from 3.3 to 3.4
|
|
125
160
|
- Updated development dependencies: `rubocop` ~> 1.90, `rubocop-performance` ~> 1.27, `simplecov` ~> 1.1, `rake` ~> 13.4
|
|
@@ -130,18 +165,19 @@
|
|
|
130
165
|
- Suppressed ActiveSupport deprecation warnings from the `plaintext` gem (`String#mb_chars`, deprecated in Rails 8.2)
|
|
131
166
|
|
|
132
167
|
### Fixed
|
|
168
|
+
|
|
133
169
|
- `CHANGELOG.md` file permissions corrected to be world-readable (was `600`, now `644`)
|
|
134
170
|
|
|
135
171
|
## [0.4.0] - 2026-08-26
|
|
136
172
|
|
|
137
173
|
### Added
|
|
174
|
+
|
|
138
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
|
|
139
176
|
- Searchable content string (title, category, file type, date) set as document content so client-side search engines can index uploaded documents
|
|
140
177
|
|
|
141
178
|
### Changed
|
|
142
|
-
- Refactored `Generator#generate` by extracting `bake_document_data` and `searchable_content` helper methods to keep method length within RuboCop limits
|
|
143
179
|
|
|
144
|
-
|
|
180
|
+
- Refactored `Generator#generate` by extracting `bake_document_data` and `searchable_content` helper methods to keep method length within RuboCop limits
|
|
145
181
|
- Simplified release workflow to tag-push trigger (`push: tags: v*`) — no manual `gh release create` needed
|
|
146
182
|
- Switched to RubyGems trusted publishing (`rubygems/release-gem@v1` with OIDC)
|
|
147
183
|
- Centralized version in `version.rb` as single source of truth — removed `version` field from `package.json` (was drifted to 0.3.1)
|
|
@@ -157,6 +193,7 @@
|
|
|
157
193
|
## [0.3.3] - 2026-08-12
|
|
158
194
|
|
|
159
195
|
### Added
|
|
196
|
+
|
|
160
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
|
|
161
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
|
|
162
199
|
- `file_size` attribute baked into each document's data at generation time
|
|
@@ -166,20 +203,24 @@
|
|
|
166
203
|
## [0.3.2] - 2026-08-12
|
|
167
204
|
|
|
168
205
|
### Added
|
|
206
|
+
|
|
169
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
|
|
170
208
|
- 7 RSpec examples for `LayoutRegistrar` covering copy, override, idempotency, and hook registration
|
|
171
209
|
|
|
172
210
|
### Fixed
|
|
211
|
+
|
|
173
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
|
|
174
213
|
|
|
175
214
|
## [0.3.1] - 2026-08-03
|
|
176
215
|
|
|
177
216
|
### Added
|
|
217
|
+
|
|
178
218
|
- Added the context-aware `{% document_icon page %}` Liquid tag for simple icon rendering
|
|
179
219
|
- Added installed-gem system coverage for all supported document types and icon themes
|
|
180
220
|
- Added Playwright browser coverage for search interaction, links, icons, baseurl, and network errors
|
|
181
221
|
|
|
182
222
|
### Changed
|
|
223
|
+
|
|
183
224
|
- Minimum Ruby version raised from `>= 3.2` to `>= 3.3`
|
|
184
225
|
- Updated RuboCop target Ruby version to 3.3
|
|
185
226
|
- Updated compatible development gems, including RuboCop, Reek, RSpec, and Playwright tooling
|
|
@@ -187,6 +228,7 @@
|
|
|
187
228
|
- Added package-content checks to verify the built gem contains runtime templates, icons, JavaScript, and Liquid tags
|
|
188
229
|
|
|
189
230
|
### Fixed
|
|
231
|
+
|
|
190
232
|
- Corrected non-color icon mappings to reference packaged SVG assets
|
|
191
233
|
- Registered packaged icons and search JavaScript for copying during Jekyll builds
|
|
192
234
|
- Made document search respect the configured index path and site base URL
|
|
@@ -197,6 +239,7 @@
|
|
|
197
239
|
- Made Reek failures fail the quality task consistently
|
|
198
240
|
|
|
199
241
|
### Verification
|
|
242
|
+
|
|
200
243
|
- 186 Ruby/system examples passing with 100% Ruby line coverage
|
|
201
244
|
- 3 Playwright browser tests passing
|
|
202
245
|
- 0 RuboCop offenses, 0 Reek warnings, and 0 Bundler Audit vulnerabilities
|
|
@@ -204,6 +247,7 @@
|
|
|
204
247
|
## [0.3.0] - 2026-07-23
|
|
205
248
|
|
|
206
249
|
### Added
|
|
250
|
+
|
|
207
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
|
|
208
252
|
- **`FileTypeIcons.icon_for` class method**: Allows icon URL resolution without a Liquid context (used by generator)
|
|
209
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
|
|
@@ -213,6 +257,7 @@
|
|
|
213
257
|
- **System test for full build pipeline**: End-to-end test covering generator → JSON index → tag rendering
|
|
214
258
|
|
|
215
259
|
### Changed
|
|
260
|
+
|
|
216
261
|
- **Minimum Ruby version**: Bumped from `>= 2.7` to `>= 3.2` (zeitwerk 2.7+ — a Jekyll dependency — requires Ruby >= 3.2)
|
|
217
262
|
- **RuboCop `TargetRubyVersion`**: Updated from `2.7` to `3.2` to match gemspec
|
|
218
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
|
|
@@ -227,6 +272,7 @@
|
|
|
227
272
|
- **Reek**: 0 warnings (7 files inspected)
|
|
228
273
|
|
|
229
274
|
### Fixed
|
|
275
|
+
|
|
230
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
|
|
231
277
|
- **`rel_path` slicing** (Low): Replaced fragile `path[(site.source.length + 1)..]` with `String#delete_prefix` for robustness
|
|
232
278
|
- **`Date.parse` in `parse_filename`** (Low): Replaced with `Date.new(year, month, day)` using integer-converted regex captures for clarity
|
|
@@ -237,6 +283,7 @@
|
|
|
237
283
|
## [0.2.0] - 2026-03-12
|
|
238
284
|
|
|
239
285
|
### Added
|
|
286
|
+
|
|
240
287
|
- **Comprehensive code quality tools** (RuboCop, Reek, Bundler Audit, SimpleCov)
|
|
241
288
|
- **98.99% test coverage** with integration tests for Liquid tags
|
|
242
289
|
- **Enhanced release automation** with 10 safety checks and validations
|
|
@@ -250,6 +297,7 @@
|
|
|
250
297
|
- **Post-release verification** with helpful links
|
|
251
298
|
|
|
252
299
|
### Changed
|
|
300
|
+
|
|
253
301
|
- **Consolidated documentation** (README.Development.md combines all dev docs)
|
|
254
302
|
- **Simplified README.md** with KISS approach
|
|
255
303
|
- **Improved Rake tasks** with better organization and help system
|
|
@@ -257,12 +305,14 @@
|
|
|
257
305
|
- **Better error handling** in release scripts
|
|
258
306
|
|
|
259
307
|
### Fixed
|
|
308
|
+
|
|
260
309
|
- **Liquid tag testing** through integration tests (resolves 98% coverage)
|
|
261
310
|
- **Keyword argument compatibility** in filters
|
|
262
311
|
- **Release script safety** with comprehensive validation
|
|
263
312
|
- **Documentation consistency** across all markdown files
|
|
264
313
|
|
|
265
314
|
### Development
|
|
315
|
+
|
|
266
316
|
- **Quality metrics**: 98.99% coverage • 0 vulnerabilities • 3 RuboCop offenses
|
|
267
317
|
- **Release workflow**: Fully automated with rollback capability
|
|
268
318
|
- **Testing**: 79 examples, 0 failures, integration tests for all features
|
|
@@ -270,11 +320,13 @@
|
|
|
270
320
|
## [0.1.2] - 2026-03-09
|
|
271
321
|
|
|
272
322
|
### Added
|
|
323
|
+
|
|
273
324
|
- **Release automation scripts**
|
|
274
325
|
|
|
275
326
|
## [0.1.1] - 2026-03-09
|
|
276
327
|
|
|
277
328
|
### Added
|
|
329
|
+
|
|
278
330
|
- **4 icon sets**: color, lines, minimal, ultra-minimal (configurable)
|
|
279
331
|
- File type icons for 20+ formats (PDF, DOCX, XLSX, etc.)
|
|
280
332
|
- Folder icons for category lists
|
|
@@ -287,6 +339,7 @@
|
|
|
287
339
|
- `icon_set` configuration option
|
|
288
340
|
|
|
289
341
|
### Fixed
|
|
342
|
+
|
|
290
343
|
- Icon URLs (now using actual svgrepo.com icons)
|
|
291
344
|
- XSS vulnerabilities (HTML escaping)
|
|
292
345
|
- Date format standardized to ISO (YYYY-MM-DD)
|
|
@@ -294,17 +347,20 @@
|
|
|
294
347
|
- JavaScript search null safety
|
|
295
348
|
|
|
296
349
|
### Changed
|
|
350
|
+
|
|
297
351
|
- Icons now included in gem (no external dependencies)
|
|
298
352
|
- JSON index includes file_type and extension
|
|
299
353
|
- Search results display icons dynamically
|
|
300
354
|
- Improved documentation and examples
|
|
301
355
|
|
|
302
356
|
### Attribution
|
|
357
|
+
|
|
303
358
|
- Icons from [SVG Repo](https://www.svgrepo.com)
|
|
304
359
|
|
|
305
360
|
## [0.1.0] - 2026-03-09
|
|
306
361
|
|
|
307
362
|
### Initial Release
|
|
363
|
+
|
|
308
364
|
- Auto-collection from `assets/documents/`
|
|
309
365
|
- Filename parsing: `YYYY-MM-DD_Title.ext`
|
|
310
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>
|
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
|