jekyll-securitytxt 1.0.2 → 1.0.3
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/jekyll-securitytxt.gemspec +6 -4
- data/lib/jekyll/securitytxt/version.rb +1 -1
- data/lib/jekyll/securitytxt.rb +15 -12
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 781ad29a0ac4d924c4d237b028a7cd8648602af05b70f73de7137871e842cc11
|
4
|
+
data.tar.gz: e0d92992aa601f7eb4a594fee6b234311f97c349a103349af280f7bf1750b866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 591fd1598c32a33d526676be6054e48534af2f5c139fba07aad1208fe7453cafc011717d319f0ea2028ac4c0a6e03501dd3bd1a0b32053bd727630c48edefc37
|
7
|
+
data.tar.gz: a22ddad70f618567683069828b0bf4a39328e234538512fb22fc341b2de369c58a7533a5a24785b9fbb5b942c4f75c108a945138ff91dcaaccf05a721b7d1fd6
|
data/jekyll-securitytxt.gemspec
CHANGED
@@ -8,14 +8,15 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["HAHWUL"]
|
9
9
|
spec.email = ["hahwul@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = "Jekyll plugin for security.txt"
|
12
|
-
spec.description = "
|
11
|
+
spec.summary = "A Jekyll plugin for generating security.txt files"
|
12
|
+
spec.description = "This plugin helps you generate security.txt files for your Jekyll site, " \
|
13
|
+
"providing security contact information and policies."
|
13
14
|
spec.homepage = "https://github.com/hahwul/jekyll-securitytxt"
|
14
15
|
spec.required_ruby_version = ">= 2.6.0"
|
15
16
|
spec.license = "MIT"
|
16
17
|
|
17
18
|
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
-
spec.metadata["source_code_uri"] =
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/hahwul/jekyll-securitytxt"
|
19
20
|
|
20
21
|
spec.files = Dir.chdir(__dir__) do
|
21
22
|
`git ls-files -z`.split("\x0").reject do |f|
|
@@ -26,5 +27,6 @@ Gem::Specification.new do |spec|
|
|
26
27
|
spec.bindir = "exe"
|
27
28
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
28
29
|
spec.require_paths = ["lib"]
|
29
|
-
|
30
|
+
|
31
|
+
spec.add_runtime_dependency "jekyll", "~> 4.0"
|
30
32
|
end
|
data/lib/jekyll/securitytxt.rb
CHANGED
@@ -5,7 +5,7 @@ require "jekyll"
|
|
5
5
|
|
6
6
|
module Jekyll
|
7
7
|
module Securitytxt
|
8
|
-
# Jekyll plugin for security.txt
|
8
|
+
# Jekyll plugin for generating security.txt
|
9
9
|
class Generator < Jekyll::Generator
|
10
10
|
safe true
|
11
11
|
priority :lowest
|
@@ -13,35 +13,38 @@ module Jekyll
|
|
13
13
|
# Plugin entry point.
|
14
14
|
def generate(site)
|
15
15
|
@site = site
|
16
|
-
@site.pages <<
|
16
|
+
@site.pages << create_security_txt_file unless security_txt_file_exists?
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
21
|
# Check if a security.txt file already exists in the source tree.
|
22
|
-
def
|
22
|
+
def security_txt_file_exists?
|
23
23
|
file_pattern = %r{.well-known/security\.txt?}
|
24
24
|
exists = @site.static_files.any? { |p| p.url =~ file_pattern }
|
25
|
-
|
26
|
-
|
25
|
+
if exists
|
26
|
+
Jekyll.logger.warn "Jekyll-securitytxt",
|
27
|
+
"Found a security.txt file in source tree matching",
|
28
|
+
"/#{file_pattern.source}/; not generating one..."
|
29
|
+
end
|
27
30
|
exists
|
28
31
|
end
|
29
32
|
|
30
33
|
# Get path of the template file.
|
31
|
-
def
|
32
|
-
File.expand_path
|
34
|
+
def template_file_path(file = "template.html")
|
35
|
+
File.expand_path(file.to_s, __dir__)
|
33
36
|
end
|
34
37
|
|
35
38
|
# Path of the security.txt file.
|
36
|
-
def
|
39
|
+
def security_txt_file_path
|
37
40
|
".well-known/security.txt"
|
38
41
|
end
|
39
42
|
|
40
43
|
# Construct a file object from a template with content that can be added to generated pages
|
41
|
-
def
|
42
|
-
Jekyll.logger.info "Jekyll-securitytxt", "Generating #{
|
43
|
-
page = PageWithoutAFile.new(@site, __dir__, "",
|
44
|
-
page.content = File.read(
|
44
|
+
def create_security_txt_file
|
45
|
+
Jekyll.logger.info "Jekyll-securitytxt", "Generating #{security_txt_file_path}"
|
46
|
+
page = PageWithoutAFile.new(@site, __dir__, "", security_txt_file_path)
|
47
|
+
page.content = File.read(template_file_path)
|
45
48
|
page.data["layout"] = nil
|
46
49
|
page
|
47
50
|
end
|
metadata
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-securitytxt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HAHWUL
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
-
description:
|
26
|
+
version: '4.0'
|
27
|
+
description: This plugin helps you generate security.txt files for your Jekyll site,
|
28
|
+
providing security contact information and policies.
|
28
29
|
email:
|
29
30
|
- hahwul@gmail.com
|
30
31
|
executables: []
|
@@ -61,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
62
|
- !ruby/object:Gem::Version
|
62
63
|
version: '0'
|
63
64
|
requirements: []
|
64
|
-
rubygems_version: 3.5.
|
65
|
+
rubygems_version: 3.5.16
|
65
66
|
signing_key:
|
66
67
|
specification_version: 4
|
67
|
-
summary: Jekyll plugin for security.txt
|
68
|
+
summary: A Jekyll plugin for generating security.txt files
|
68
69
|
test_files: []
|