jekyll-agent-markdown 0.2.0 → 0.3.0

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: 747268dbb22f5d319ed8f760fa97ff9503eb12b632a44c8ef74bcef8694d821d
4
- data.tar.gz: 57e5b25acc73b618d1d74f3e11f8e20f44393af1f976bfd17669e2f6d52b226a
3
+ metadata.gz: aefdb0b717baa8666d581d48746d9b0afad4f730bbf25af6e534dc4a13800ec8
4
+ data.tar.gz: c702b617f5b8b022f7f3ddc5fe05ca69eeeadc94ed8ecbb87d20b84406c33291
5
5
  SHA512:
6
- metadata.gz: 02e6fa6d6a722bee4b94052f2a2d42ea0d5de18599f4380da778c1e42390a7b54e346d68e3830b7cb0bbb35c0634031ae4fac1c2d8374c074947191f38248cb6
7
- data.tar.gz: 715edcbd124b53fca22dedfbf96e115fc4ed1373797ef27ded43868c551f5ec61aecabc1f8057612a842f237d9a544c20e228ecd9ec33a3899d0c308854fb11c
6
+ metadata.gz: aef9d1e51132fd68ea7f6e0936addd32c5d69d1da0ef0a9c721df1076d6e9ee99680f7bd2b6c1005af3080b1fd0cf8091da49a68d423acfb8d587afa2ad64007
7
+ data.tar.gz: db2b8abb8fdb9c4d622483bffc2fadf7c32d65b20b1f338d6c2e09bcdefe6a51c351d32cdd203befdb4a97ec111689833432f794592bb2ac81a78799e56b19c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.3.0] - 2026-08-20
4
+
5
+ - Include the site author's name in `llms.txt` by default, with an `include_author` opt-out.
6
+
3
7
  ## [0.2.0] - 2026-08-20
4
8
 
5
9
  - Add configurable `llms.txt` ordering by normalized published date, defaulting to newest first and placing missing or invalid dates last.
data/README.md CHANGED
@@ -28,10 +28,13 @@ agent_markdown:
28
28
  posts: true
29
29
  llms_txt: true
30
30
  sort: desc
31
+ include_author: true
31
32
  include_dates: true
32
33
  ```
33
34
 
34
- `posts`, `llms_txt`, and `include_dates` accept `true`, `false`, or one of the false-style strings `"false"`, `"no"`, and `"off"` (case-insensitively). `sort` accepts `asc` or `desc` and defaults to `desc`, ordering the `llms.txt` article list by normalized published date. Posts with a missing, incomplete, or invalid published date are listed last in their existing order. Unknown keys and other values stop the build with a configuration error instead of being silently ignored. An explicit per-post `agent_markdown` value follows the boolean-setting rules, so a mistyped opt-out cannot publish raw source by accident.
35
+ `posts`, `llms_txt`, `include_author`, and `include_dates` accept `true`, `false`, or one of the false-style strings `"false"`, `"no"`, and `"off"` (case-insensitively). `sort` accepts `asc` or `desc` and defaults to `desc`, ordering the `llms.txt` article list by normalized published date. Posts with a missing, incomplete, or invalid published date are listed last in their existing order. Unknown keys and other values stop the build with a configuration error instead of being silently ignored. An explicit per-post `agent_markdown` value follows the boolean-setting rules, so a mistyped opt-out cannot publish raw source by accident.
36
+
37
+ By default, `llms.txt` includes the blog author's name from either a scalar Jekyll setting (`author: Jane Doe`) or a mapping (`author: { name: Jane Doe }`). If no author name is configured, the line is omitted. Set `include_author: false` under `agent_markdown` to omit it explicitly.
35
38
 
36
39
  Set `url` to your site's absolute HTTP(S) URL; the `llms.txt` index uses it to generate absolute article links:
37
40
 
@@ -88,6 +91,8 @@ The generated `/llms.txt` is a compact index, for example:
88
91
 
89
92
  > A short description
90
93
 
94
+ Author: Example Author
95
+
91
96
  ## Articles
92
97
 
93
98
  > Posts only. Pages and collections are not included.
@@ -6,7 +6,7 @@ require "uri"
6
6
  module Jekyll
7
7
  module AgentMarkdown
8
8
  class Configuration
9
- ALLOWED_SETTINGS = %w[include_dates llms_txt posts sort].freeze
9
+ ALLOWED_SETTINGS = %w[include_author include_dates llms_txt posts sort].freeze
10
10
  FALSE_STRINGS = %w[false no off].freeze
11
11
  SORT_ORDERS = %w[asc desc].freeze
12
12
 
@@ -4,6 +4,7 @@ require "jekyll"
4
4
  require_relative "configuration"
5
5
  require_relative "date_metadata"
6
6
  require_relative "destination_claims"
7
+ require_relative "llms_headings"
7
8
  require_relative "markdown_sibling_path"
8
9
  require_relative "raw_markdown_file"
9
10
 
@@ -91,22 +92,10 @@ module Jekyll
91
92
  end
92
93
 
93
94
  def llms_txt(site, posts, settings)
94
- sections = [llms_headings(site), article_links(site, posts, settings)]
95
+ sections = [LlmsHeadings.new(site, settings).to_s, article_links(site, posts, settings)]
95
96
  "#{sections.reject(&:empty?).join("\n\n")}\n"
96
97
  end
97
98
 
98
- def llms_headings(site)
99
- title = one_line(site.config.fetch("title", ""))
100
- headings = ["# #{title}".rstrip]
101
- description = one_line(site.config["description"])
102
- headings << "> #{description}" unless description.empty?
103
- headings << "## Articles"
104
- headings << "> Posts only. Pages and collections are not included."
105
- headings.join("\n\n")
106
- end
107
-
108
- def one_line(value) = value ? value.to_s.gsub(/\s+/, " ").strip : ""
109
-
110
99
  def article_links(site, posts, settings)
111
100
  site_url = site.config["url"].sub(%r{/+\z}, "")
112
101
  sorted_posts(posts, settings).map { |post| article_link(site_url, post, settings) }.join("\n")
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "configuration"
4
+
5
+ module Jekyll
6
+ module AgentMarkdown
7
+ class LlmsHeadings
8
+ def initialize(site, settings)
9
+ @site = site
10
+ @settings = settings
11
+ end
12
+
13
+ def to_s
14
+ [title_heading, description_heading, author_heading, "## Articles", articles_description]
15
+ .compact.join("\n\n")
16
+ end
17
+
18
+ private
19
+
20
+ attr_reader :site, :settings
21
+
22
+ def title_heading = "# #{one_line(site.config.fetch("title", ""))}".rstrip
23
+
24
+ def description_heading
25
+ description = one_line(site.config["description"])
26
+ "> #{description}" unless description.empty?
27
+ end
28
+
29
+ def author_heading
30
+ return unless Configuration.enabled?(settings, "include_author")
31
+
32
+ name = author_name
33
+ "Author: #{name}" unless name.empty?
34
+ end
35
+
36
+ def author_name
37
+ author = site.config["author"]
38
+ author = author["name"] || author[:name] if author.is_a?(Hash)
39
+ one_line(author)
40
+ end
41
+
42
+ def articles_description = "> Posts only. Pages and collections are not included."
43
+
44
+ def one_line(value) = value ? value.to_s.gsub(/\s+/, " ").strip : ""
45
+ end
46
+ end
47
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module AgentMarkdown
5
- VERSION = "0.2.0"
5
+ VERSION = "0.3.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-agent-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucian Ghinda
@@ -45,6 +45,7 @@ files:
45
45
  - lib/jekyll/agent_markdown/date_metadata.rb
46
46
  - lib/jekyll/agent_markdown/destination_claims.rb
47
47
  - lib/jekyll/agent_markdown/generator.rb
48
+ - lib/jekyll/agent_markdown/llms_headings.rb
48
49
  - lib/jekyll/agent_markdown/markdown_sibling_path.rb
49
50
  - lib/jekyll/agent_markdown/raw_markdown_file.rb
50
51
  - lib/jekyll/agent_markdown/version.rb