jekyll-documents 0.7.5 → 0.7.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 649b75500be7e7a3e9c445e1c44cc35c95aef1caed51afba1711a6c9e8463388
4
- data.tar.gz: '0382acb5e7cbcad06d0fae9590bab4fba7d9f57abee556d7dbad20eb5cdafdce'
3
+ metadata.gz: f4997e7c9ae34ce7462c3fd52a46a1e97c74be3fe1871e489a14eff6c80427d0
4
+ data.tar.gz: f1df13ca930a08fa219b0871a300a67f3b1569ec1e24d0e6f817b713697ae53d
5
5
  SHA512:
6
- metadata.gz: dd3f001523be128185e881527f38d6c52afd890eafa72569f289f952d066f272eafd3f70b354f9bf234c8d25155bbe66f1c9ab5c9e693fc7265d9886d722e2a8
7
- data.tar.gz: d94034fe3aa2a3bac172267f2422cebb76d4c333586d0afd37579dae32e1f498aaa59f98f4e2a45660dc5c91f34d94ff11aaa21790ccfd15034247f90a6cf2a8
6
+ metadata.gz: adfc57aed564575bd22d4ebe2446331cc3252b6644e0e886b50ebfecdc44a8afa8ba9c305dc95a965d29c3cfd442ba539066d7b05e4fbe7fee521903eb3b9723
7
+ data.tar.gz: 63336b909cfea4ba2d3fbcd10208e9315261c1b68e5b74fa8c534379b192c75a9dc9e43ef877a2caf3d1db4ae61b59d0c1e2be9a3c3acfe4de93c769cb84dbde
data/CHANGELOG.md CHANGED
@@ -1,23 +1,66 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [0.7.7] - 2026-10-06
6
+
7
+ ### Added
8
+
9
+ - `Jekyll::Documents::Interface.to_h` — the public tag/filter/config/enum
10
+ surface derived from the code constants and the Liquid tag registry,
11
+ serialized to a committed `interface.yml` by `rake interface` for
12
+ downstream tooling (e.g. the jekyll-imgflow-vscode parity spec).
13
+ - `spec/interface_spec.rb` pins code ↔ manifest ↔ docs: a stale
14
+ `interface.yml`, an unmanifested tag/param/config key, or an
15
+ undocumented tag/param fails the suite.
16
+ - README coverage for `document_icon alt:`, the `{% latest_documents %}`
17
+ tag options (`count:`/`category:`), and `documents.include_extensions`.
18
+
19
+ ### Security
20
+
21
+ - Dev-tooling audit gate: `scripts/npm-audit.mjs` + `.audit-allow.json`
22
+ replace the bare `npm audit` CI step — patchable transitive deps are
23
+ forced to fixed versions via `overrides` (smol-toml, katex), and only
24
+ explicitly allowlisted unpatched advisories are tolerated (braces,
25
+ dev-only, no patched release).
26
+
27
+ ## [0.7.6] - 2026-09-29
28
+
29
+ ### Added
30
+
31
+ - Optional document metadata and download-link attribute include hooks in the generated layout
32
+ - README recipe for provider-neutral template customization and optional GoatCounter click events
33
+
34
+ ### Changed
35
+
36
+ - 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)
37
+
38
+ ### Fixed
39
+
40
+ - 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
41
+
3
42
  ## [0.7.5] - 2026-09-21
4
43
 
5
44
  ### Changed
45
+
6
46
  - 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
47
  - `.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
48
  - Bump `plaintext` to `~> 0.4`
9
49
  - 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
50
 
11
51
  ### Fixed
52
+
12
53
  - `.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
54
  - 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
55
 
15
56
  ## [0.7.4] - 2026-09-18
16
57
 
17
58
  ### Added
59
+
18
60
  - 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
61
 
20
62
  ### Changed
63
+
21
64
  - Auto-update `Gemfile.lock` on `rake version:bump` via `bundle lock` (use `SKIP_LOCK=1` to skip)
22
65
  - Further reduced `latest_documents.rb` `render` complexity by extracting `resolve_count` and `select_documents`
23
66
  - 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 +70,14 @@
27
70
  ## [0.7.3] - 2026-09-10
28
71
 
29
72
  ### Added
73
+
30
74
  - Added Semgrep CE security scanning with a custom ReDoS detection rule for pre-commit and CI
31
75
  - Added CodeFactor code quality analysis badge and integration
32
76
  - Added SEMGREP_APP_TOKEN integration for Cloud dashboard sync from CI
33
77
  - Added `rake version:pre_release` task for pre-release security gate with FORCE=1 override
34
78
 
35
79
  ### Changed
80
+
36
81
  - Updated CI to Node.js 26 and current Node 24-based GitHub Actions runtimes
37
82
  - Pinned all GitHub Actions to commit SHAs to prevent supply-chain attacks
38
83
  - Added cooldown period to Dependabot configuration
@@ -46,16 +91,19 @@
46
91
  - `options_parser.rb`: Extracted `read_value` from `parse_options`
47
92
 
48
93
  ### Fixed
94
+
49
95
  - Replaced dangerous subshell in system spec with Open3.capture2
50
96
 
51
97
  ## [0.7.2] - 2026-09-09
52
98
 
53
99
  ### Fixed
100
+
54
101
  - Replaced polynomial-time Liquid tag option regexes with a shared linear-time parser
55
102
 
56
103
  ## [0.7.1] - 2026-09-09
57
104
 
58
105
  ### Changed
106
+
59
107
  - Development dependencies now live in `Gemfile`; the gemspec declares runtime dependencies only
60
108
  - Removed redundant transitive dependency pins and made `Gemfile` read the exact Ruby version from `.ruby-version`
61
109
  - Refreshed compatible locked dependency versions and tracked `Gemfile.lock` for reproducible CI development environments
@@ -64,18 +112,21 @@
64
112
  ## [0.7.0] - 2026-09-05
65
113
 
66
114
  ### Added
115
+
67
116
  - Added stable `source_path`, `category_path`, and `category_slug` document metadata and JSON index fields
68
117
  - Added exact `path:` resolution for document and category tags plus explicit category aggregation
69
118
  - Added path/date permalink placeholders and full-path-first category mappings
70
119
  - Added configurable `warn` or `strict` handling for unresolved and ambiguous tag references
71
120
 
72
121
  ### Fixed
122
+
73
123
  - Ambiguous tags no longer silently select the first match
74
124
  - Duplicate generated permalinks now abort the build and identify every conflicting source file
75
125
 
76
126
  ## [0.6.1] - 2026-09-03
77
127
 
78
128
  ### Changed
129
+
79
130
  - 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
131
  - Extracted document content now retains searchable metadata for title, category, file type, and date
81
132
  - Text cache cleanup now preserves shared digest files and removes orphaned files safely
@@ -86,30 +137,35 @@
86
137
  - Removed redundant package metadata and duplicate development dependency declarations
87
138
 
88
139
  ### Fixed
140
+
89
141
  - Replaced use of the private ActiveSupport deprecation API with the public `ActiveSupport.deprecator` API
90
142
  - Empty extraction results now fall back to metadata-only searchable content
91
143
  - Manifest loading now validates entries, logs filesystem read failures, and resets dirty state after successful saves
92
144
  - Updated stale CI, development, cache-cleanup, and package-lock documentation
93
145
 
94
146
  ### Tests
147
+
95
148
  - Added real PDF extraction coverage and stronger cache-hit/persistence assertions
96
149
  - Added tests for cache configuration invalidation, UTF-8 byte truncation, shared cache references, orphan cleanup, and conditional cache exclusion
97
150
 
98
151
  ## [0.6.0] - 2026-08-27
99
152
 
100
153
  ### Added
154
+
101
155
  - 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
156
  - Documented field renaming in jekyll-client-search for integration with other search conventions
103
157
  - 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
158
  - Icons default to `1em` (line-height) so they scale with surrounding text
105
159
 
106
160
  ### Changed
161
+
107
162
  - 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
163
  - Inline `1em` sizing added to JS-rendered and folder icons as a fallback when the CSS file is not included
109
164
 
110
165
  ## [0.5.0] - 2026-08-27
111
166
 
112
167
  ### Added
168
+
113
169
  - 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
170
  - `extract_text` configuration option to enable text extraction (disabled by default)
115
171
  - `text_max_bytes` configuration option to control extracted text truncation (default 500KB)
@@ -120,6 +176,7 @@
120
176
  - `plaintext` as a development dependency for testing extraction
121
177
 
122
178
  ### Changed
179
+
123
180
  - Minimum Ruby version raised from 3.3 to 3.4 (tested on Ruby 3.4.10)
124
181
  - RuboCop target version updated from 3.3 to 3.4
125
182
  - Updated development dependencies: `rubocop` ~> 1.90, `rubocop-performance` ~> 1.27, `simplecov` ~> 1.1, `rake` ~> 13.4
@@ -130,18 +187,19 @@
130
187
  - Suppressed ActiveSupport deprecation warnings from the `plaintext` gem (`String#mb_chars`, deprecated in Rails 8.2)
131
188
 
132
189
  ### Fixed
190
+
133
191
  - `CHANGELOG.md` file permissions corrected to be world-readable (was `600`, now `644`)
134
192
 
135
193
  ## [0.4.0] - 2026-08-26
136
194
 
137
195
  ### Added
196
+
138
197
  - `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
198
  - Searchable content string (title, category, file type, date) set as document content so client-side search engines can index uploaded documents
140
199
 
141
200
  ### Changed
142
- - Refactored `Generator#generate` by extracting `bake_document_data` and `searchable_content` helper methods to keep method length within RuboCop limits
143
201
 
144
- ### Changed
202
+ - Refactored `Generator#generate` by extracting `bake_document_data` and `searchable_content` helper methods to keep method length within RuboCop limits
145
203
  - Simplified release workflow to tag-push trigger (`push: tags: v*`) — no manual `gh release create` needed
146
204
  - Switched to RubyGems trusted publishing (`rubygems/release-gem@v1` with OIDC)
147
205
  - Centralized version in `version.rb` as single source of truth — removed `version` field from `package.json` (was drifted to 0.3.1)
@@ -157,6 +215,7 @@
157
215
  ## [0.3.3] - 2026-08-12
158
216
 
159
217
  ### Added
218
+
160
219
  - `{% 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
220
  - `{% 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
221
  - `file_size` attribute baked into each document's data at generation time
@@ -166,20 +225,24 @@
166
225
  ## [0.3.2] - 2026-08-12
167
226
 
168
227
  ### Added
228
+
169
229
  - 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
230
  - 7 RSpec examples for `LayoutRegistrar` covering copy, override, idempotency, and hook registration
171
231
 
172
232
  ### Fixed
233
+
173
234
  - 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
235
 
175
236
  ## [0.3.1] - 2026-08-03
176
237
 
177
238
  ### Added
239
+
178
240
  - Added the context-aware `{% document_icon page %}` Liquid tag for simple icon rendering
179
241
  - Added installed-gem system coverage for all supported document types and icon themes
180
242
  - Added Playwright browser coverage for search interaction, links, icons, baseurl, and network errors
181
243
 
182
244
  ### Changed
245
+
183
246
  - Minimum Ruby version raised from `>= 3.2` to `>= 3.3`
184
247
  - Updated RuboCop target Ruby version to 3.3
185
248
  - Updated compatible development gems, including RuboCop, Reek, RSpec, and Playwright tooling
@@ -187,6 +250,7 @@
187
250
  - Added package-content checks to verify the built gem contains runtime templates, icons, JavaScript, and Liquid tags
188
251
 
189
252
  ### Fixed
253
+
190
254
  - Corrected non-color icon mappings to reference packaged SVG assets
191
255
  - Registered packaged icons and search JavaScript for copying during Jekyll builds
192
256
  - Made document search respect the configured index path and site base URL
@@ -197,6 +261,7 @@
197
261
  - Made Reek failures fail the quality task consistently
198
262
 
199
263
  ### Verification
264
+
200
265
  - 186 Ruby/system examples passing with 100% Ruby line coverage
201
266
  - 3 Playwright browser tests passing
202
267
  - 0 RuboCop offenses, 0 Reek warnings, and 0 Bundler Audit vulnerabilities
@@ -204,6 +269,7 @@
204
269
  ## [0.3.0] - 2026-07-23
205
270
 
206
271
  ### Added
272
+
207
273
  - **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
274
  - **`FileTypeIcons.icon_for` class method**: Allows icon URL resolution without a Liquid context (used by generator)
209
275
  - **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 +279,7 @@
213
279
  - **System test for full build pipeline**: End-to-end test covering generator → JSON index → tag rendering
214
280
 
215
281
  ### Changed
282
+
216
283
  - **Minimum Ruby version**: Bumped from `>= 2.7` to `>= 3.2` (zeitwerk 2.7+ — a Jekyll dependency — requires Ruby >= 3.2)
217
284
  - **RuboCop `TargetRubyVersion`**: Updated from `2.7` to `3.2` to match gemspec
218
285
  - **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 +294,7 @@
227
294
  - **Reek**: 0 warnings (7 files inspected)
228
295
 
229
296
  ### Fixed
297
+
230
298
  - **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
299
  - **`rel_path` slicing** (Low): Replaced fragile `path[(site.source.length + 1)..]` with `String#delete_prefix` for robustness
232
300
  - **`Date.parse` in `parse_filename`** (Low): Replaced with `Date.new(year, month, day)` using integer-converted regex captures for clarity
@@ -237,6 +305,7 @@
237
305
  ## [0.2.0] - 2026-03-12
238
306
 
239
307
  ### Added
308
+
240
309
  - **Comprehensive code quality tools** (RuboCop, Reek, Bundler Audit, SimpleCov)
241
310
  - **98.99% test coverage** with integration tests for Liquid tags
242
311
  - **Enhanced release automation** with 10 safety checks and validations
@@ -250,6 +319,7 @@
250
319
  - **Post-release verification** with helpful links
251
320
 
252
321
  ### Changed
322
+
253
323
  - **Consolidated documentation** (README.Development.md combines all dev docs)
254
324
  - **Simplified README.md** with KISS approach
255
325
  - **Improved Rake tasks** with better organization and help system
@@ -257,12 +327,14 @@
257
327
  - **Better error handling** in release scripts
258
328
 
259
329
  ### Fixed
330
+
260
331
  - **Liquid tag testing** through integration tests (resolves 98% coverage)
261
332
  - **Keyword argument compatibility** in filters
262
333
  - **Release script safety** with comprehensive validation
263
334
  - **Documentation consistency** across all markdown files
264
335
 
265
336
  ### Development
337
+
266
338
  - **Quality metrics**: 98.99% coverage • 0 vulnerabilities • 3 RuboCop offenses
267
339
  - **Release workflow**: Fully automated with rollback capability
268
340
  - **Testing**: 79 examples, 0 failures, integration tests for all features
@@ -270,11 +342,13 @@
270
342
  ## [0.1.2] - 2026-03-09
271
343
 
272
344
  ### Added
345
+
273
346
  - **Release automation scripts**
274
347
 
275
348
  ## [0.1.1] - 2026-03-09
276
349
 
277
350
  ### Added
351
+
278
352
  - **4 icon sets**: color, lines, minimal, ultra-minimal (configurable)
279
353
  - File type icons for 20+ formats (PDF, DOCX, XLSX, etc.)
280
354
  - Folder icons for category lists
@@ -287,6 +361,7 @@
287
361
  - `icon_set` configuration option
288
362
 
289
363
  ### Fixed
364
+
290
365
  - Icon URLs (now using actual svgrepo.com icons)
291
366
  - XSS vulnerabilities (HTML escaping)
292
367
  - Date format standardized to ISO (YYYY-MM-DD)
@@ -294,17 +369,20 @@
294
369
  - JavaScript search null safety
295
370
 
296
371
  ### Changed
372
+
297
373
  - Icons now included in gem (no external dependencies)
298
374
  - JSON index includes file_type and extension
299
375
  - Search results display icons dynamically
300
376
  - Improved documentation and examples
301
377
 
302
378
  ### Attribution
379
+
303
380
  - Icons from [SVG Repo](https://www.svgrepo.com)
304
381
 
305
382
  ## [0.1.0] - 2026-03-09
306
383
 
307
384
  ### Initial Release
385
+
308
386
  - Auto-collection from `assets/documents/`
309
387
  - Filename parsing: `YYYY-MM-DD_Title.ext`
310
388
  - Category from folder structure
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # jekyll-documents
2
+
2
3
  [![Status: Active](https://img.shields.io/badge/status-active-success)](https://github.com/gundestrup/jekyll-documents)
3
- [![Tests](https://github.com/gundestrup/jekyll-documents/actions/workflows/test.yml/badge.svg)](https://github.com/gundestrup/jekyll-documents/actions/workflows/test.yml)
4
+ [![Tests](https://github.com/gundestrup/jekyll-documents/actions/workflows/ci.yml/badge.svg)](https://github.com/gundestrup/jekyll-documents/actions/workflows/ci.yml)
4
5
  [![Codecov](https://codecov.io/gh/gundestrup/jekyll-documents/graph/badge.svg)](https://codecov.io/gh/gundestrup/jekyll-documents)
5
6
  [![Gem Version](https://img.shields.io/gem/v/jekyll-documents)](https://rubygems.org/gems/jekyll-documents)
6
7
  [![Gem Downloads](https://img.shields.io/gem/dt/jekyll-documents)](https://rubygems.org/gems/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,13 +116,56 @@ 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
+ **List the most recent documents**:
120
+
121
+ ```liquid
122
+ {% latest_documents %}
123
+ {% latest_documents count:3 %}
124
+ {% latest_documents count:3 category:"minutes" %}
125
+ ```
126
+
127
+ `count:` defaults to `latest_default_count` (5); `category:` filters to a single category.
128
+ Unlike `{% include latest_documents.html %}`, the tag reads its defaults from site config.
129
+
130
+ ## Document template customization
131
+
132
+ The document layout provides two optional include hooks. Both are empty by default, and the
133
+ `LayoutRegistrar` copies them only when the site does not already provide a file with that name:
134
+
135
+ - `_includes/document_metadata_extra.html` renders inside the document metadata paragraph, after the
136
+ date and category.
137
+ - `_includes/document_download_attributes.html` renders inside the opening tag of the document
138
+ download link. It should output zero or more valid HTML attributes, including any leading spaces.
139
+
140
+ For example, a site can put a downloads label or count display in the metadata include, and add
141
+ analytics attributes to the download link without copying the full document layout. These hooks are
142
+ provider-neutral; the site owns their content and any associated JavaScript.
143
+
144
+ ### Optional GoatCounter click events
145
+
146
+ If the site loads GoatCounter's `count.js`, it can record clicks on the document-page download link
147
+ using the attributes include. Use a stable, unique event name for each document:
148
+
149
+ ```liquid
150
+ data-goatcounter-click="download-{{ page.source_path | url_encode | escape }}"
151
+ data-goatcounter-no-session="1"
152
+ ```
153
+
154
+ `data-goatcounter-no-session="1"` counts repeat clicks by the same visitor. GoatCounter counts a
155
+ click attempt, not a confirmed file transfer. This hook covers the download link on the document
156
+ page only; direct file links in site-authored listings or posts need the same event attributes of
157
+ their own. The gem does not load GoatCounter, fetch event totals, or combine historical baselines.
158
+ Those remain optional site-level analytics behavior.
159
+
118
160
  ## Configuration
119
161
 
120
162
  ```yaml
121
163
  documents:
122
164
  root: "assets/documents"
123
165
  icon_set: "color"
166
+ include_extensions: [".pdf", ".docx", ".pptx", ".xlsx", ".odt", ".ods", ".odp"]
124
167
  strict_filename: true
168
+ strict_extensions: true
125
169
  resolution_mode: "warn"
126
170
  ```
127
171
 
@@ -173,6 +217,7 @@ Usage with the `document_icon` tag:
173
217
 
174
218
  ```liquid
175
219
  {% document_icon page class:"document-file-icon icon-x2" %}
220
+ {% document_icon doc alt:"Board minutes" %}
176
221
  ```
177
222
 
178
223
  Or with any `<img>`:
@@ -299,7 +344,7 @@ documents:
299
344
 
300
345
  Add the cache directory to `.gitignore`:
301
346
 
302
- ```
347
+ ```text
303
348
  .cache/jekyll-documents/
304
349
  ```
305
350
 
@@ -309,7 +354,7 @@ The `plaintext` gem uses the `rubyzip` Ruby gem for Office formats (no CLI
309
354
  tools needed). PDF extraction shells out to a system command:
310
355
 
311
356
  | Format | Tool |
312
- |--------|------|
357
+ | -------- | ------ |
313
358
  | PDF | `pdftotext` (poppler-utils) |
314
359
  | DOCX/PPTX/XLSX | rubyzip (Ruby gem, no CLI needed) |
315
360
  | ODT/ODS/ODP | rubyzip (Ruby gem, no CLI needed) |
File without changes
File without changes
@@ -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/interface.yml ADDED
@@ -0,0 +1,61 @@
1
+ # Generated by `rake interface` — do not edit.
2
+ # Public tag/filter/config surface for tooling (editor extensions, doc linters).
3
+ ---
4
+ gem: jekyll-documents
5
+ version: 0.7.7
6
+ tags:
7
+ doc_link:
8
+ params:
9
+ - icon
10
+ - path
11
+ - size
12
+ - text
13
+ doc_category:
14
+ params:
15
+ - aggregate
16
+ - limit
17
+ - list
18
+ - path
19
+ - text
20
+ document_icon:
21
+ params:
22
+ - alt
23
+ - class
24
+ latest_documents:
25
+ params:
26
+ - category
27
+ - count
28
+ filters:
29
+ - documents_slugify
30
+ - documents_title_from_filename
31
+ - file_type_icon
32
+ - file_type_icon_tag
33
+ config:
34
+ documents:
35
+ - categories_from_path
36
+ - category_map
37
+ - extract_text
38
+ - icon_set
39
+ - include_extensions
40
+ - json_index
41
+ - json_index_path
42
+ - latest_default_count
43
+ - layout
44
+ - permalink
45
+ - resolution_mode
46
+ - root
47
+ - slug_danish_map
48
+ - slug_downcase
49
+ - strict_extensions
50
+ - strict_filename
51
+ - text_cache_dir
52
+ - text_max_bytes
53
+ enums:
54
+ icon_set:
55
+ - color
56
+ - lines
57
+ - minimal
58
+ - ultra-minimal
59
+ resolution_mode:
60
+ - strict
61
+ - warn
@@ -31,7 +31,8 @@ Gem::Specification.new do |spec|
31
31
  ">= #{File.read(File.expand_path('.ruby-version', __dir__)).strip[/\d+\.\d+/]}"
32
32
 
33
33
  spec.files = Dir.glob("{lib,assets,_includes,_layouts}/**/*") +
34
- ["README.md", "CHANGELOG.md", "LICENSE", "jekyll-documents.gemspec"]
34
+ ["README.md", "CHANGELOG.md", "LICENSE", "interface.yml",
35
+ "jekyll-documents.gemspec"]
35
36
  spec.require_paths = ["lib"]
36
37
 
37
38
  spec.add_dependency "jekyll", ">= 4.4", "< 5.0"
@@ -13,7 +13,6 @@ module Jekyll
13
13
 
14
14
  class Configuration
15
15
  RESOLUTION_MODES = %w[warn strict].freeze
16
- private_constant :RESOLUTION_MODES
17
16
 
18
17
  DEFAULTS = {
19
18
  "root" => "assets/documents",
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Documents
5
+ # Machine-readable description of the plugin's public interface:
6
+ # Liquid tags + their options, filters, config keys, and enum values.
7
+ # `rake interface` writes this as interface.yml (shipped in the gem) so
8
+ # tooling like editor extensions can consume it without parsing Ruby.
9
+ module Interface
10
+ TAG_OPTIONS = {
11
+ "doc_link" => %w[icon path size text],
12
+ "doc_category" => %w[aggregate limit list path text],
13
+ "document_icon" => %w[alt class],
14
+ "latest_documents" => %w[category count]
15
+ }.freeze
16
+
17
+ FILTERS = %w[
18
+ documents_slugify
19
+ documents_title_from_filename
20
+ file_type_icon
21
+ file_type_icon_tag
22
+ ].freeze
23
+
24
+ def self.to_h
25
+ {
26
+ "gem" => "jekyll-documents",
27
+ "version" => VERSION,
28
+ "tags" => TAG_OPTIONS.transform_values { |params| { "params" => params } },
29
+ "filters" => FILTERS,
30
+ "config" => { "documents" => Configuration::DEFAULTS.keys.sort },
31
+ "enums" => {
32
+ "icon_set" => FileTypeIcons::ICON_MAP.keys.sort,
33
+ "resolution_mode" => Configuration::RESOLUTION_MODES.sort
34
+ }
35
+ }
36
+ end
37
+ end
38
+ end
39
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Documents
5
- VERSION = "0.7.5"
5
+ VERSION = "0.7.7"
6
6
  end
7
7
  end
@@ -20,6 +20,8 @@ require_relative "jekyll/documents/tags/document_icon"
20
20
  require_relative "jekyll/documents/tags/doc_link"
21
21
  require_relative "jekyll/documents/tags/doc_category"
22
22
 
23
+ require_relative "jekyll/documents/interface"
24
+
23
25
  module Jekyll
24
26
  module Documents
25
27
  # Namespace module for the plugin.
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.5
4
+ version: 0.7.7
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
@@ -145,6 +147,7 @@ files:
145
147
  - assets/icons/ultra-minimal/xls.svg
146
148
  - assets/icons/ultra-minimal/zip.svg
147
149
  - assets/js/documents-search.js
150
+ - interface.yml
148
151
  - jekyll-documents.gemspec
149
152
  - lib/jekyll-documents.rb
150
153
  - lib/jekyll/documents/assets_generator.rb
@@ -152,6 +155,7 @@ files:
152
155
  - lib/jekyll/documents/file_type_icons.rb
153
156
  - lib/jekyll/documents/filters.rb
154
157
  - lib/jekyll/documents/generator.rb
158
+ - lib/jekyll/documents/interface.rb
155
159
  - lib/jekyll/documents/json_index_generator.rb
156
160
  - lib/jekyll/documents/layout_registrar.rb
157
161
  - lib/jekyll/documents/options_parser.rb