kiln 0.2.0 → 0.2.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 +7 -0
- data/lib/kiln/build.rb +8 -1
- data/lib/kiln/sitemap.rb +7 -1
- data/lib/kiln/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5769fc8686c82a97194dbf3704c7e46b32fccd599d9a0af64680e7e6599079f
|
|
4
|
+
data.tar.gz: e08bf6dd11727a3273d54347a45e9d3493d9ef333c85301cbfe37a70025c99b0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b479bfb6d6b644b7dd1a36dbc1572cf73351b7575f41e008abf57c846c472ac48ca3f00b237e61bc8da41c8b212ff74bb52100062e7c9ce5da0dfad158e4561
|
|
7
|
+
data.tar.gz: 681aca4de196497241120cd95288b81dfeae61faabe7b21d5314a180066bdf6772de5c89195d9bdf97a70a7976154d9fac906ebeffac3849e07708f34360af8d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.1 (2026-11-15)
|
|
4
|
+
|
|
5
|
+
Added:
|
|
6
|
+
|
|
7
|
+
- When `url` is set, the build writes `robots.txt`, which allows every crawler and points to
|
|
8
|
+
`sitemap.xml`. A `robots.txt` from a route or `public/` is kept instead.
|
|
9
|
+
|
|
3
10
|
## 0.2.0 (2026-11-15)
|
|
4
11
|
|
|
5
12
|
Breaking:
|
data/lib/kiln/build.rb
CHANGED
|
@@ -111,7 +111,7 @@ module Kiln
|
|
|
111
111
|
write_files
|
|
112
112
|
writer.copy_public(app.root.join("public"), generated: generated_files)
|
|
113
113
|
Redirects.new(@redirects, host: config.host).write(writer) if @redirects.any?
|
|
114
|
-
|
|
114
|
+
write_sitemap if config.url
|
|
115
115
|
write_cname if config.cname
|
|
116
116
|
end
|
|
117
117
|
|
|
@@ -131,6 +131,13 @@ module Kiln
|
|
|
131
131
|
[ ("404.html" if config.not_found), ("CNAME" if config.cname), *config.files.keys.map(&:to_s) ].compact
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
# A robots.txt from a route or public/ is the app's own and stays as it is.
|
|
135
|
+
def write_sitemap
|
|
136
|
+
sitemap = Sitemap.new(manifest, url: config.url)
|
|
137
|
+
sitemap.write(writer)
|
|
138
|
+
sitemap.write_robots(writer) unless @stage.join(Sitemap::ROBOTS).exist?
|
|
139
|
+
end
|
|
140
|
+
|
|
134
141
|
# config.cname = true takes the host from config.url.
|
|
135
142
|
def write_cname
|
|
136
143
|
host = config.cname == true ? config.url && URI(config.url).host : config.cname
|
data/lib/kiln/sitemap.rb
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
require "erb"
|
|
2
2
|
|
|
3
3
|
module Kiln
|
|
4
|
-
# sitemap.xml with every indexable HTML page in the manifest.
|
|
4
|
+
# sitemap.xml with every indexable HTML page in the manifest, and a robots.txt that points to it.
|
|
5
5
|
class Sitemap
|
|
6
6
|
FILENAME = "sitemap.xml"
|
|
7
|
+
ROBOTS = "robots.txt"
|
|
7
8
|
|
|
8
9
|
def self.noindex?(response, body)
|
|
9
10
|
return false unless response.html?
|
|
@@ -34,5 +35,10 @@ module Kiln
|
|
|
34
35
|
#{urls.join}</urlset>
|
|
35
36
|
XML
|
|
36
37
|
end
|
|
38
|
+
|
|
39
|
+
# robots.txt that allows everything and points crawlers at the sitemap.
|
|
40
|
+
def write_robots(writer)
|
|
41
|
+
writer.write_file(ROBOTS, "User-agent: *\nAllow: /\n\nSitemap: #{@url}/#{FILENAME}\n")
|
|
42
|
+
end
|
|
37
43
|
end
|
|
38
44
|
end
|
data/lib/kiln/version.rb
CHANGED