jekyll-documents 0.7.6 → 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: 81bf5267fbf1af10ac172d0b7b0962ffefa222fadd47c7b6dbd1df100ff4ffa4
4
- data.tar.gz: dc4c65b4b050e7a64883dc17183cfa02b65c69ccb668d6c56fbc213517f8e599
3
+ metadata.gz: f4997e7c9ae34ce7462c3fd52a46a1e97c74be3fe1871e489a14eff6c80427d0
4
+ data.tar.gz: f1df13ca930a08fa219b0871a300a67f3b1569ec1e24d0e6f817b713697ae53d
5
5
  SHA512:
6
- metadata.gz: b06f57c4a2923181bb8d7612f77935177de32797ee2d7aff40442d13162d629875884a0fb4e9c647415ba60799574f1f92129a19541180c082222af65efed049
7
- data.tar.gz: a3fa9c436896180548d9e7ced68ce624a195bdf79ca31951323590876b3b04f13939c7ad437f08f02f080b5644ac68d66e4ac560de0b7a9a7fdcf51e7d982992
6
+ metadata.gz: adfc57aed564575bd22d4ebe2446331cc3252b6644e0e886b50ebfecdc44a8afa8ba9c305dc95a965d29c3cfd442ba539066d7b05e4fbe7fee521903eb3b9723
7
+ data.tar.gz: 63336b909cfea4ba2d3fbcd10208e9315261c1b68e5b74fa8c534379b192c75a9dc9e43ef877a2caf3d1db4ae61b59d0c1e2be9a3c3acfe4de93c769cb84dbde
data/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## [Unreleased]
4
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
+
5
27
  ## [0.7.6] - 2026-09-29
6
28
 
7
29
  ### Added
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # jekyll-documents
2
2
 
3
3
  [![Status: Active](https://img.shields.io/badge/status-active-success)](https://github.com/gundestrup/jekyll-documents)
4
- [![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)
5
5
  [![Codecov](https://codecov.io/gh/gundestrup/jekyll-documents/graph/badge.svg)](https://codecov.io/gh/gundestrup/jekyll-documents)
6
6
  [![Gem Version](https://img.shields.io/gem/v/jekyll-documents)](https://rubygems.org/gems/jekyll-documents)
7
7
  [![Gem Downloads](https://img.shields.io/gem/dt/jekyll-documents)](https://rubygems.org/gems/jekyll-documents)
@@ -116,6 +116,17 @@ Link mode renders an `<a>` tag to the category page. List mode renders a `<ul>`
116
116
  Use `path:` for an exact, case-sensitive category path, `limit:N` to cap the list, and
117
117
  `aggregate:true list:true` to explicitly combine repeated short category names.
118
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
+
119
130
  ## Document template customization
120
131
 
121
132
  The document layout provides two optional include hooks. Both are empty by default, and the
@@ -152,7 +163,9 @@ Those remain optional site-level analytics behavior.
152
163
  documents:
153
164
  root: "assets/documents"
154
165
  icon_set: "color"
166
+ include_extensions: [".pdf", ".docx", ".pptx", ".xlsx", ".odt", ".ods", ".odp"]
155
167
  strict_filename: true
168
+ strict_extensions: true
156
169
  resolution_mode: "warn"
157
170
  ```
158
171
 
@@ -204,6 +217,7 @@ Usage with the `document_icon` tag:
204
217
 
205
218
  ```liquid
206
219
  {% document_icon page class:"document-file-icon icon-x2" %}
220
+ {% document_icon doc alt:"Board minutes" %}
207
221
  ```
208
222
 
209
223
  Or with any `<img>`:
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.6"
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.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svend Gundestrup
@@ -147,6 +147,7 @@ files:
147
147
  - assets/icons/ultra-minimal/xls.svg
148
148
  - assets/icons/ultra-minimal/zip.svg
149
149
  - assets/js/documents-search.js
150
+ - interface.yml
150
151
  - jekyll-documents.gemspec
151
152
  - lib/jekyll-documents.rb
152
153
  - lib/jekyll/documents/assets_generator.rb
@@ -154,6 +155,7 @@ files:
154
155
  - lib/jekyll/documents/file_type_icons.rb
155
156
  - lib/jekyll/documents/filters.rb
156
157
  - lib/jekyll/documents/generator.rb
158
+ - lib/jekyll/documents/interface.rb
157
159
  - lib/jekyll/documents/json_index_generator.rb
158
160
  - lib/jekyll/documents/layout_registrar.rb
159
161
  - lib/jekyll/documents/options_parser.rb