jekyll-local-theme 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/lib/jekyll/local_theme/theme.rb +11 -11
- data/lib/jekyll/local_theme/version.rb +1 -1
- data/lib/jekyll/local_theme.rb +6 -6
- metadata +8 -9
- data/lib/jekyll/local_theme/mock_gem_specification.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00fef92712fd20dc68176d7ed08c8c96946d042395b266518d2ff6f5404447a6
|
4
|
+
data.tar.gz: 68c8bc9195f6a3036acaa70bfa44385ce9717f791a3ea3065d33226bf67e7b13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 612620c55a760df07041cfb4fea45418f6ac042aada3cb9f1e9084b5824410f6006b35340c56cfea247d8d5290c3c02464384f896616f61d0e83e2d0051f2974
|
7
|
+
data.tar.gz: aa755030aa4b8b5a9bc0cd0ebfdae6e436b31ad49a66f775043ef52e5550b4aba3968e1381ea5671261aa37ed865bdba193fa88646fe24d896c99bf74c8edb4d
|
data/LICENSE
CHANGED
@@ -6,19 +6,19 @@ module Jekyll
|
|
6
6
|
module LocalTheme
|
7
7
|
# The local {Theme} on file system.
|
8
8
|
class Theme < Jekyll::Theme
|
9
|
-
|
9
|
+
def initialize(root)
|
10
|
+
gemspec = Gem::Util.glob_files_in_dir(Bundler::Source::Path::DEFAULT_GLOB, root)
|
11
|
+
.min_by { |p| -p.split(File::SEPARATOR).size }
|
10
12
|
|
11
|
-
|
13
|
+
if gemspec
|
14
|
+
@gemspec = Bundler.load_gemspec_uncached(gemspec)
|
15
|
+
@gemspec.full_gem_path = File.dirname(gemspec)
|
16
|
+
else
|
17
|
+
@gemspec = Gem::Specification.new(File.basename(root))
|
18
|
+
@gemspec.full_gem_path = root
|
19
|
+
end
|
12
20
|
|
13
|
-
|
14
|
-
name = name.delete_prefix(JEKYLL_THEME_PREFIX)
|
15
|
-
gemspec = [
|
16
|
-
File.expand_path("#{name}.gemspec", root),
|
17
|
-
File.expand_path("#{JEKYLL_THEME_PREFIX}#{name}.gemspec", root)
|
18
|
-
].find { |file| File.exist?(file) }
|
19
|
-
@gemspec = MockGemSpecification.new(root,
|
20
|
-
gemspec ? Bundler.load_gemspec_uncached(gemspec).runtime_dependencies : [])
|
21
|
-
super(name)
|
21
|
+
super(@gemspec.name)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
data/lib/jekyll/local_theme.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative 'local_theme/mock_gem_specification'
|
4
3
|
require_relative 'local_theme/theme'
|
5
4
|
require_relative 'local_theme/version'
|
6
5
|
|
@@ -10,13 +9,14 @@ module Jekyll
|
|
10
9
|
module_function
|
11
10
|
|
12
11
|
def init(site)
|
13
|
-
|
14
|
-
return unless
|
12
|
+
path = site.config['local_theme']
|
13
|
+
return unless path
|
15
14
|
|
16
|
-
site.
|
17
|
-
site.theme =
|
15
|
+
theme = Theme.new(Jekyll.sanitized_path(Jekyll.sanitized_path(site.source, '_themes'), path))
|
16
|
+
site.theme = theme
|
17
|
+
site.config['theme'] = theme.name
|
18
18
|
|
19
|
-
Jekyll.logger.info 'Local theme:',
|
19
|
+
Jekyll.logger.info 'Local theme:', theme.root
|
20
20
|
|
21
21
|
site.send(:configure_include_paths)
|
22
22
|
site.plugin_manager.require_theme_deps
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-local-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.2.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:
|
26
|
+
version: 2.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jekyll
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,6 @@ files:
|
|
49
49
|
- README.md
|
50
50
|
- lib/jekyll-local-theme.rb
|
51
51
|
- lib/jekyll/local_theme.rb
|
52
|
-
- lib/jekyll/local_theme/mock_gem_specification.rb
|
53
52
|
- lib/jekyll/local_theme/theme.rb
|
54
53
|
- lib/jekyll/local_theme/version.rb
|
55
54
|
homepage: https://github.com/ntkme/jekyll-local-theme
|
@@ -57,8 +56,8 @@ licenses:
|
|
57
56
|
- MIT
|
58
57
|
metadata:
|
59
58
|
bug_tracker_uri: https://github.com/ntkme/jekyll-local-theme/issues
|
60
|
-
documentation_uri: https://rubydoc.info/gems/jekyll-local-theme/0.
|
61
|
-
source_code_uri: https://github.com/ntkme/jekyll-local-theme/tree/
|
59
|
+
documentation_uri: https://rubydoc.info/gems/jekyll-local-theme/1.0.0
|
60
|
+
source_code_uri: https://github.com/ntkme/jekyll-local-theme/tree/v1.0.0
|
62
61
|
funding_uri: https://github.com/sponsors/ntkme
|
63
62
|
rubygems_mfa_required: 'true'
|
64
63
|
post_install_message:
|
@@ -74,9 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
73
|
requirements:
|
75
74
|
- - ">="
|
76
75
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
76
|
+
version: 3.2.0
|
78
77
|
requirements: []
|
79
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.9
|
80
79
|
signing_key:
|
81
80
|
specification_version: 4
|
82
81
|
summary: Jekyll plugin for building Jekyll sites with any local theme
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module LocalTheme
|
5
|
-
# The mock for {Gem::Specification}.
|
6
|
-
class MockGemSpecification
|
7
|
-
attr_reader :full_gem_path, :runtime_dependencies
|
8
|
-
|
9
|
-
def initialize(full_gem_path, runtime_dependencies)
|
10
|
-
@full_gem_path = full_gem_path
|
11
|
-
@runtime_dependencies = runtime_dependencies
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
private_constant :MockGemSpecification
|
16
|
-
end
|
17
|
-
end
|