jekyll-agent-markdown 0.3.0 → 0.3.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/lib/jekyll/agent_markdown/author_metadata.rb +26 -0
- data/lib/jekyll/agent_markdown/date_metadata.rb +2 -8
- data/lib/jekyll/agent_markdown/generator.rb +8 -5
- data/lib/jekyll/agent_markdown/llms_headings.rb +3 -8
- data/lib/jekyll/agent_markdown/metadata_footer.rb +26 -0
- data/lib/jekyll/agent_markdown/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: 81a9e3ec622a528158f77eab0ea51648c8229b3a4faceb84deb7c648a6a7ae65
|
|
4
|
+
data.tar.gz: 95a3a69bf269b5399c50209d89bfd0ff24e137e9aba82955b5f82be3c5fbc4ab
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4eeba03b01f2ffec891e0ab206f659135f5bb892591cd1dbff6ec141ef4db1f6f315baba491b617127614ba5ed167384661303fd2e85d90d50fb63c18de81545
|
|
7
|
+
data.tar.gz: 48d40c90d4677d033e803469b95521459192386db5fa83fb653446d2ad8190fa1d926ce9d1b77ae81004e01a41c113807b5f64a0350bca0c598ab04f74066bba
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.3.1] - 2026-08-20
|
|
4
|
+
|
|
5
|
+
- Include the site author in each exported article's metadata footer on the same line as published and updated dates.
|
|
6
|
+
|
|
3
7
|
## [0.3.0] - 2026-08-20
|
|
4
8
|
|
|
5
9
|
- Include the site author's name in `llms.txt` by default, with an `include_author` opt-out.
|
data/README.md
CHANGED
|
@@ -34,7 +34,7 @@ agent_markdown:
|
|
|
34
34
|
|
|
35
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
36
|
|
|
37
|
-
By default, `llms.txt`
|
|
37
|
+
By default, `llms.txt` and each exported article footer include 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 entry is omitted. Set `include_author: false` under `agent_markdown` to omit author metadata from both outputs.
|
|
38
38
|
|
|
39
39
|
Set `url` to your site's absolute HTTP(S) URL; the `llms.txt` index uses it to generate absolute article links:
|
|
40
40
|
|
|
@@ -59,14 +59,14 @@ Markdown sibling paths are deterministic:
|
|
|
59
59
|
|
|
60
60
|
Extensions are matched case-insensitively, and percent-encoded aliases are compared by their final decoded destination. Destination ownership also treats case-only and Unicode-normalization aliases as equivalent on every platform, keeping builds portable across filesystems. File-versus-directory conflicts are reserved as well. Before adding an export, the plugin checks every page, static file, and writable collection document already known to Jekyll. The existing destination owner wins; later post exports are skipped with a warning and omitted from `llms.txt`. A committed `llms.txt` wins in the same way.
|
|
61
61
|
|
|
62
|
-
The generated file preserves the post's original Markdown body as its initial content, with no front matter, HTML conversion, or Liquid rendering. Liquid tags and directives such as `{{ site.title }}` are published literally. By default, the plugin appends the post's published `date
|
|
62
|
+
The generated file preserves the post's original Markdown body as its initial content, with no front matter, HTML conversion, or Liquid rendering. Liquid tags and directives such as `{{ site.title }}` are published literally. By default, the plugin appends the post's published `date`, optional `last_modified_at` value, and site author as a small footer:
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
---
|
|
66
|
-
Published at: 2026-01-01 | Updated at: 2026-02-03
|
|
66
|
+
Published at: 2026-01-01 | Updated at: 2026-02-03 | Author: Jane Doe
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Each available date is formatted as `YYYY-MM-DD`. String values must contain an explicit year, month, and day; missing, incomplete, and invalid values and their labels are omitted. An empty post contains only the metadata line, without a leading `---` that could be mistaken for front matter.
|
|
69
|
+
Each available date is formatted as `YYYY-MM-DD`. String values must contain an explicit year, month, and day; missing, incomplete, and invalid values and their labels are omitted. An empty post contains only the metadata line, without a leading `---` that could be mistaken for front matter. `include_dates: false` omits dates from Markdown exports and `llms.txt` article links while leaving an author-only footer when an author is configured. `include_author: false` leaves a date-only footer. Set both options to `false` for a body-only export.
|
|
70
70
|
|
|
71
71
|
Exclude one post with front matter:
|
|
72
72
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Jekyll
|
|
4
|
+
module AgentMarkdown
|
|
5
|
+
class AuthorMetadata
|
|
6
|
+
def initialize(config)
|
|
7
|
+
@config = config
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def to_s
|
|
11
|
+
author_name = name
|
|
12
|
+
author_name.empty? ? "" : "Author: #{author_name}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
private
|
|
16
|
+
|
|
17
|
+
attr_reader :config
|
|
18
|
+
|
|
19
|
+
def name
|
|
20
|
+
author = config["author"]
|
|
21
|
+
author = author["name"] || author[:name] if author.is_a?(Hash)
|
|
22
|
+
author ? author.to_s.gsub(/\s+/, " ").strip : ""
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "date"
|
|
4
|
+
require_relative "metadata_footer"
|
|
4
5
|
|
|
5
6
|
module Jekyll
|
|
6
7
|
module AgentMarkdown
|
|
@@ -21,10 +22,7 @@ module Jekyll
|
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
def append_to(content)
|
|
24
|
-
|
|
25
|
-
return "#{self}\n" if content.empty?
|
|
26
|
-
|
|
27
|
-
"#{content}#{separator_for(content)}---\n#{self}\n"
|
|
25
|
+
MetadataFooter.new([to_s]).append_to(content)
|
|
28
26
|
end
|
|
29
27
|
|
|
30
28
|
def published_date = parsed_date(@data["date"])
|
|
@@ -36,10 +34,6 @@ module Jekyll
|
|
|
36
34
|
"#{label}: #{date}" if date
|
|
37
35
|
end
|
|
38
36
|
|
|
39
|
-
def separator_for(content)
|
|
40
|
-
content.end_with?("\n") ? "\n" : "\n\n"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
37
|
def formatted_date(value)
|
|
44
38
|
parsed_date(value)&.strftime(DATE_FORMAT)
|
|
45
39
|
end
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "jekyll"
|
|
4
|
+
require_relative "author_metadata"
|
|
4
5
|
require_relative "configuration"
|
|
5
6
|
require_relative "date_metadata"
|
|
6
7
|
require_relative "destination_claims"
|
|
7
8
|
require_relative "llms_headings"
|
|
8
9
|
require_relative "markdown_sibling_path"
|
|
10
|
+
require_relative "metadata_footer"
|
|
9
11
|
require_relative "raw_markdown_file"
|
|
10
12
|
|
|
11
13
|
module Jekyll
|
|
@@ -47,7 +49,7 @@ module Jekyll
|
|
|
47
49
|
setting_name = "agent_markdown in #{post.relative_path}"
|
|
48
50
|
return unless Configuration.enabled_value?(setting, name: setting_name)
|
|
49
51
|
|
|
50
|
-
file = RawMarkdownFile.new(site, MarkdownSiblingPath.for(post.url), post_content(post, settings))
|
|
52
|
+
file = RawMarkdownFile.new(site, MarkdownSiblingPath.for(post.url), post_content(site, post, settings))
|
|
51
53
|
url = file.url
|
|
52
54
|
return collision_warning(post, url) unless claim_destination?(destination_claims, site, file)
|
|
53
55
|
|
|
@@ -116,10 +118,11 @@ module Jekyll
|
|
|
116
118
|
[link, date_metadata(post).to_s].reject(&:empty?).join(" | ")
|
|
117
119
|
end
|
|
118
120
|
|
|
119
|
-
def post_content(post, settings)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
def post_content(site, post, settings)
|
|
122
|
+
entries = []
|
|
123
|
+
entries << date_metadata(post).to_s if Configuration.enabled?(settings, "include_dates")
|
|
124
|
+
entries << AuthorMetadata.new(site.config).to_s if Configuration.enabled?(settings, "include_author")
|
|
125
|
+
MetadataFooter.new(entries).append_to(post.content)
|
|
123
126
|
end
|
|
124
127
|
|
|
125
128
|
def date_metadata(post) = DateMetadata.new(post.data)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require_relative "author_metadata"
|
|
3
4
|
require_relative "configuration"
|
|
4
5
|
|
|
5
6
|
module Jekyll
|
|
@@ -29,14 +30,8 @@ module Jekyll
|
|
|
29
30
|
def author_heading
|
|
30
31
|
return unless Configuration.enabled?(settings, "include_author")
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
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)
|
|
33
|
+
metadata = AuthorMetadata.new(site.config).to_s
|
|
34
|
+
metadata unless metadata.empty?
|
|
40
35
|
end
|
|
41
36
|
|
|
42
37
|
def articles_description = "> Posts only. Pages and collections are not included."
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Jekyll
|
|
4
|
+
module AgentMarkdown
|
|
5
|
+
class MetadataFooter
|
|
6
|
+
def initialize(entries)
|
|
7
|
+
@text = entries.compact.reject(&:empty?).join(" | ")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def append_to(content)
|
|
11
|
+
return content if text.empty?
|
|
12
|
+
return "#{text}\n" if content.empty?
|
|
13
|
+
|
|
14
|
+
"#{content}#{separator_for(content)}---\n#{text}\n"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
|
|
19
|
+
attr_reader :text
|
|
20
|
+
|
|
21
|
+
def separator_for(content)
|
|
22
|
+
content.end_with?("\n") ? "\n" : "\n\n"
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
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.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lucian Ghinda
|
|
@@ -41,12 +41,14 @@ files:
|
|
|
41
41
|
- LICENSE.txt
|
|
42
42
|
- README.md
|
|
43
43
|
- lib/jekyll-agent-markdown.rb
|
|
44
|
+
- lib/jekyll/agent_markdown/author_metadata.rb
|
|
44
45
|
- lib/jekyll/agent_markdown/configuration.rb
|
|
45
46
|
- lib/jekyll/agent_markdown/date_metadata.rb
|
|
46
47
|
- lib/jekyll/agent_markdown/destination_claims.rb
|
|
47
48
|
- lib/jekyll/agent_markdown/generator.rb
|
|
48
49
|
- lib/jekyll/agent_markdown/llms_headings.rb
|
|
49
50
|
- lib/jekyll/agent_markdown/markdown_sibling_path.rb
|
|
51
|
+
- lib/jekyll/agent_markdown/metadata_footer.rb
|
|
50
52
|
- lib/jekyll/agent_markdown/raw_markdown_file.rb
|
|
51
53
|
- lib/jekyll/agent_markdown/version.rb
|
|
52
54
|
homepage: https://github.com/lucianghinda/jekyll-agent-markdown
|