jekyll-github-code 0.2.0 → 0.2.2
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 +10 -2
- data/lib/jekyll-github-code/generator.rb +53 -45
- data/lib/jekyll-github-code/version.rb +1 -2
- 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: a8371ea2bd07b6ffc3db43573843179b8bf420c02c59e252771cfa27c1df38b1
|
|
4
|
+
data.tar.gz: a0e590925ed33002b75815b6018e015fa6291baa1f6d93af4e4e57bbbea94dff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 750b8c33c7c1cc37fc556ec7d12aad267bc13dcc28bae4263362af57724b8d8ad58697e09e7eec40db4f1c8b49eea0b85ba7de2606fb449e740806c05a981dfd
|
|
7
|
+
data.tar.gz: 4463d6f073ada40c343da33d28571d4ae0bcaa8863c24889e2057003b03f25902a3d531e74ca80aab2146a19e15da859546dd4472b60df3dd4556e2311e1bca2
|
data/CHANGELOG.md
CHANGED
|
@@ -5,12 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [0.2.
|
|
8
|
+
## [0.2.2] - 2025-12-12
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fix override with jekyll-github-card
|
|
12
|
+
|
|
13
|
+
## [0.2.1] - 2025-12-12
|
|
9
14
|
|
|
10
15
|
### Fixed
|
|
11
|
-
-
|
|
16
|
+
- Location for automatic asset generation (css and js copied to `_site/assets/github-code/`)
|
|
12
17
|
|
|
18
|
+
## [0.2.0] - 2025-12-12
|
|
13
19
|
|
|
20
|
+
### Added
|
|
21
|
+
- Automatic asset generation (css and js copied to `_site/assets/github-code/`)
|
|
14
22
|
|
|
15
23
|
## [0.1.0] - 2025-12-12
|
|
16
24
|
|
|
@@ -1,72 +1,80 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Jekyll
|
|
4
|
-
module
|
|
5
|
-
|
|
6
|
-
class Generator < Jekyll::Generator
|
|
4
|
+
module GithubCode
|
|
5
|
+
class CodeStyleGenerator < Jekyll::Generator
|
|
7
6
|
safe true
|
|
8
|
-
priority :
|
|
7
|
+
priority :low
|
|
9
8
|
|
|
10
9
|
def generate(site)
|
|
11
|
-
|
|
12
|
-
gem_root = File.expand_path('../../..', __dir__)
|
|
13
|
-
assets_source = File.join(gem_root, 'assets')
|
|
10
|
+
content = File.read(File.join(File.dirname(__FILE__), "..", "..", "assets", "css", "github-code.css"))
|
|
14
11
|
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
# Create a static file for the CSS
|
|
13
|
+
site.static_files << CodeStyleFile.new(site, content)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class JavaScriptGenerator < Jekyll::Generator
|
|
18
|
+
safe true
|
|
19
|
+
priority :low
|
|
20
|
+
|
|
21
|
+
def generate(site)
|
|
22
|
+
content = File.read(File.join(File.dirname(__FILE__), "..", "..", "assets", "js", "github-code.js"))
|
|
25
23
|
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
if File.exist?(js_source)
|
|
29
|
-
site.static_files << AssetFile.new(
|
|
30
|
-
site,
|
|
31
|
-
assets_source,
|
|
32
|
-
'js',
|
|
33
|
-
'github-code.js'
|
|
34
|
-
)
|
|
35
|
-
end
|
|
24
|
+
# Create a static file for the CSS
|
|
25
|
+
site.static_files << JavaScriptFile.new(site, content)
|
|
36
26
|
end
|
|
37
27
|
end
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def initialize(site, base, dir, name)
|
|
29
|
+
class CodeStyleFile < Jekyll::StaticFile
|
|
30
|
+
def initialize(site, content)
|
|
42
31
|
@site = site
|
|
43
|
-
@
|
|
44
|
-
@
|
|
45
|
-
@
|
|
46
|
-
@
|
|
47
|
-
@
|
|
48
|
-
|
|
32
|
+
@content = content
|
|
33
|
+
@relative_path = "/assets/css/github-code.css"
|
|
34
|
+
@extname = ".css"
|
|
35
|
+
@name = "github-code.css"
|
|
36
|
+
@dir = "/assets/css"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def write(dest)
|
|
40
|
+
dest_path = File.join(dest, @relative_path)
|
|
41
|
+
FileUtils.mkdir_p(File.dirname(dest_path))
|
|
42
|
+
File.write(dest_path, @content)
|
|
43
|
+
true
|
|
49
44
|
end
|
|
50
45
|
|
|
51
46
|
def path
|
|
52
|
-
|
|
47
|
+
@relative_path
|
|
53
48
|
end
|
|
54
49
|
|
|
55
|
-
def
|
|
56
|
-
|
|
50
|
+
def relative_path
|
|
51
|
+
@relative_path
|
|
57
52
|
end
|
|
53
|
+
end
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
class JavaScriptFile < Jekyll::StaticFile
|
|
56
|
+
def initialize(site, content)
|
|
57
|
+
@site = site
|
|
58
|
+
@content = content
|
|
59
|
+
@relative_path = "/assets/js/github-code.js"
|
|
60
|
+
@extname = ".js"
|
|
61
|
+
@name = "github-code.js"
|
|
62
|
+
@dir = "/assets/js"
|
|
63
|
+
end
|
|
62
64
|
|
|
65
|
+
def write(dest)
|
|
66
|
+
dest_path = File.join(dest, @relative_path)
|
|
63
67
|
FileUtils.mkdir_p(File.dirname(dest_path))
|
|
64
|
-
|
|
68
|
+
File.write(dest_path, @content)
|
|
65
69
|
true
|
|
66
70
|
end
|
|
67
71
|
|
|
68
|
-
def
|
|
69
|
-
|
|
72
|
+
def path
|
|
73
|
+
@relative_path
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def relative_path
|
|
77
|
+
@relative_path
|
|
70
78
|
end
|
|
71
79
|
end
|
|
72
80
|
end
|