jekyll-llms 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23293734537766446bec10323faae85e54243da602e80bca5d8675feffff8abd
4
- data.tar.gz: 33b4069fbc9e69e04305f33f487788d67e279a2f60842d789400d7f43de87c20
3
+ metadata.gz: 57d82d3bfe869a5d72d4df4e09ee949f2306986a4280d01ed68f619af99e9876
4
+ data.tar.gz: 1f335c5be7fb633c0b140ed57ed5bed3a1e55ea735d78202096d777bf574d75c
5
5
  SHA512:
6
- metadata.gz: a0e1ad5425441b17e99e316762b097c2f00f8b259cf4b9742ce9440d3712d740b51a160d95317459b94677dcd4fc3a1262e3e5642dba949394216c1af3a1101c
7
- data.tar.gz: fac4f5e71fce6d09cfc476ac61fe236cfb00fa181d90be85eaa2cf0f17fbf0d62c9804ef11abfc36ae0618acc0b559ac7cc7b13331ed050a87b86b7d3e9ec758
6
+ metadata.gz: 5d9d5f38e376bb2a707832fb72466a559c31f8c3e7bac12fccdf6f4a4292475bcf57772db5ff577443a55b5c82371cbfd37ccd5692ec12c23a2d9f8c61420ad0
7
+ data.tar.gz: '09bacc3aa61d09e578b2a397c7384f75ab4edd5a7509962a8bdb775f74bbcc3bb536107939d2b65acfbed844828d223995da60ee19a7b1b4e0c855def195d231'
data/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 0.1.1
6
+
7
+ ### Changed
8
+
9
+ - Exclude `/README.md` and `/CHANGELOG.md` by default. Set `llms.exclude` to replace this list.
10
+
11
+ ### Fixed
12
+
13
+ - Copy Markdown sidecars only based off already existing Markdown files
14
+ - Keep HTML-source entries linked to their original URLs in `llms.txt` and skip Markdown alternate links for them.
15
+
16
+ ## 0.1.0 - 2026-05-03
17
+
18
+ ### Added
19
+
20
+ - Generate `llms.txt` for included pages, posts, and output collections.
21
+ - Generate Markdown source sidecars for included entries.
22
+ - Add HTML alternate links pointing to generated Markdown sidecars.
data/README.md CHANGED
@@ -24,10 +24,10 @@ plugins:
24
24
  ## Output
25
25
 
26
26
  - `/llms.txt`: Markdown index of included entries.
27
- - `*.md`: source-body sidecars for included entries.
27
+ - `*.md`: source-body sidecars for included Markdown-source entries.
28
28
  - HTML `<link rel="alternate" type="text/markdown" href="...">` tags pointing to sidecars.
29
29
 
30
- Sidecars are source bodies, not HTML-to-Markdown conversions. Front matter is removed. Liquid is rendered unless `render_with_liquid: false` is set.
30
+ Sidecars are source bodies, not HTML-to-Markdown conversions. Front matter is removed. Liquid is rendered unless `render_with_liquid: false` is set. HTML-source entries stay linked by their original URLs.
31
31
 
32
32
  ## Configuration
33
33
 
@@ -39,14 +39,16 @@ llms:
39
39
  - pages
40
40
  - posts
41
41
  exclude:
42
+ - /README.md
43
+ - /CHANGELOG.md
42
44
  - /404.html
43
45
  - /assets/**
44
46
  ```
45
47
 
46
- - `markdown`: generate sidecars, link `llms.txt` to sidecars, and add HTML alternate links. Default: `true`.
48
+ - `markdown`: generate sidecars for Markdown sources, link `llms.txt` to those sidecars, and add HTML alternate links. Default: `true`.
47
49
  - `llms_txt`: generate `/llms.txt`. Default: `true`.
48
50
  - `include`: `pages`, `posts`, and output collection names. Default: `[pages, posts]`.
49
- - `exclude`: URL, Markdown path, or source path globs. Default: `[]`.
51
+ - `exclude`: URL, Markdown path, or source path globs. Default: `[/README.md, /CHANGELOG.md]`.
50
52
 
51
53
  Per-entry opt-out:
52
54
 
@@ -7,7 +7,7 @@ module Jekyll
7
7
  "markdown" => true,
8
8
  "llms_txt" => true,
9
9
  "include" => %w[pages posts],
10
- "exclude" => [],
10
+ "exclude" => ["/README.md", "/CHANGELOG.md"],
11
11
  }.freeze
12
12
 
13
13
  def self.from_site(site)
@@ -6,6 +6,7 @@ module Jekyll
6
6
  attr_reader :item, :section, :url
7
7
 
8
8
  def initialize(site:, item:, section:)
9
+ @site = site
9
10
  @item = item
10
11
  @section = section
11
12
  @url = Url.new(site: site, item: item)
@@ -19,6 +20,10 @@ module Jekyll
19
20
  item.data.fetch("llms", true)
20
21
  end
21
22
 
23
+ def markdown_source?
24
+ markdown_extensions.include?(File.extname(item.relative_path).delete_prefix("."))
25
+ end
26
+
22
27
  def excluded_by?(patterns)
23
28
  patterns.any? do |pattern|
24
29
  url.matches?(pattern)
@@ -34,6 +39,12 @@ module Jekyll
34
39
 
35
40
  private
36
41
 
42
+ attr_reader :site
43
+
44
+ def markdown_extensions
45
+ site.config.fetch("markdown_ext", Configuration::DEFAULTS.fetch("markdown_ext")).split(",")
46
+ end
47
+
37
48
  def fallback_title
38
49
  if item.respond_to?(:basename_without_ext)
39
50
  item.basename_without_ext
@@ -36,7 +36,7 @@ module Jekyll
36
36
  end
37
37
 
38
38
  def entry_line(entry)
39
- line = "- [#{entry.title}](#{entry.url.absolute(markdown: markdown)})"
39
+ line = "- [#{entry.title}](#{entry.url.absolute(markdown: markdown && entry.markdown_source?)})"
40
40
  entry.description.empty? ? line : "#{line}: #{entry.description}"
41
41
  end
42
42
 
@@ -27,13 +27,17 @@ module Jekyll
27
27
  end
28
28
 
29
29
  def write_markdown
30
- entries.each do |entry|
30
+ markdown_entries.each do |entry|
31
31
  files.write(entry.url.markdown_path, MarkdownSource.new(site: site, item: entry.item).content)
32
32
  end
33
33
  end
34
34
 
35
35
  def write_html_links
36
- HtmlLinker.new(site: site, entries: entries).write
36
+ HtmlLinker.new(site: site, entries: markdown_entries).write
37
+ end
38
+
39
+ def markdown_entries
40
+ entries.select(&:markdown_source?)
37
41
  end
38
42
  end
39
43
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Llms
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-llms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stanislav Katkov
@@ -106,6 +106,7 @@ executables: []
106
106
  extensions: []
107
107
  extra_rdoc_files: []
108
108
  files:
109
+ - CHANGELOG.md
109
110
  - LICENSE.txt
110
111
  - README.md
111
112
  - lib/jekyll-llms.rb