jekyll-local-theme 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +34 -0
- data/lib/jekyll/local_theme/mock_gem_specification.rb +15 -0
- data/lib/jekyll/local_theme/theme.rb +27 -0
- data/lib/{jekyll-local-theme → jekyll/local_theme}/version.rb +1 -1
- data/lib/jekyll/local_theme.rb +29 -0
- data/lib/jekyll-local-theme.rb +2 -24
- metadata +35 -14
- data/lib/jekyll-local-theme/mock_gemspec.rb +0 -8
- data/lib/jekyll-local-theme/munger.rb +0 -32
- data/lib/jekyll-local-theme/theme.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe768c654ac41e43f48280e826983f5b5fd69ae04f544d2422d36edcea07427c
|
4
|
+
data.tar.gz: c97f3e1fc628e47bc38b1f97894f6bc7bc23adf5b81d0dbb82472f8b56606977
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c705c541eac1cf85f661877c2cf5a587f9a60e1106e7004317e6b281c28e9276a561f42844d655789b0fe7c17ebf623a2ff6bade1a949d00f484504548903edd
|
7
|
+
data.tar.gz: 0d52f8497ee0f0b98469fe9791ed0e0022ed5e036626b7939776dc7d1a157f4df4f925428e53a8bf992af57a9dbb70f9f18bec289cf17899b0033f9620f88740
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 なつき
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Jekyll Local Theme
|
2
|
+
|
3
|
+
Jekyll plugin for building Jekyll sites with any local theme
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
1. Add the following to your Gemfile
|
8
|
+
|
9
|
+
``` ruby
|
10
|
+
gem "jekyll-local-theme"
|
11
|
+
```
|
12
|
+
|
13
|
+
and run `bundle install` to install the plugin
|
14
|
+
|
15
|
+
2. Add the following to your site's `_config.yml` to activate the plugin
|
16
|
+
|
17
|
+
``` yml
|
18
|
+
plugins:
|
19
|
+
- jekyll-local-theme
|
20
|
+
```
|
21
|
+
|
22
|
+
3. Add themes to your site's `_themes` directory
|
23
|
+
|
24
|
+
``` sh
|
25
|
+
git submodule add https://github.com/jekyll/minima.git _themes/minima
|
26
|
+
```
|
27
|
+
|
28
|
+
Note: You can just copy files without using `git submodule`
|
29
|
+
|
30
|
+
4. Add the following to your site's `_config.yml` to choose your theme
|
31
|
+
|
32
|
+
``` yml
|
33
|
+
local_theme: minima
|
34
|
+
```
|
@@ -0,0 +1,15 @@
|
|
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
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'bundler'
|
4
|
+
|
5
|
+
module Jekyll
|
6
|
+
module LocalTheme
|
7
|
+
# The local {Theme} on file system.
|
8
|
+
class Theme < Jekyll::Theme
|
9
|
+
JEKYLL_THEME_PREFIX = 'jekyll-theme-'
|
10
|
+
|
11
|
+
private_constant :JEKYLL_THEME_PREFIX
|
12
|
+
|
13
|
+
def initialize(name, root)
|
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)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private_constant :Theme
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'local_theme/mock_gem_specification'
|
4
|
+
require_relative 'local_theme/theme'
|
5
|
+
require_relative 'local_theme/version'
|
6
|
+
|
7
|
+
module Jekyll
|
8
|
+
# The {LocalTheme} plugin for {Jekyll}.
|
9
|
+
module LocalTheme
|
10
|
+
module_function
|
11
|
+
|
12
|
+
def init(site)
|
13
|
+
name = site.config['local_theme']
|
14
|
+
return unless name
|
15
|
+
|
16
|
+
site.config['theme'] = name
|
17
|
+
site.theme = Theme.new(name, Jekyll.sanitized_path(Jekyll.sanitized_path(site.source, '_themes'), name))
|
18
|
+
|
19
|
+
Jekyll.logger.info 'Local theme:', site.theme.root
|
20
|
+
|
21
|
+
site.send(:configure_include_paths)
|
22
|
+
site.plugin_manager.require_theme_deps
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
Jekyll::Hooks.register :site, :after_init do |site|
|
28
|
+
Jekyll::LocalTheme.init(site)
|
29
|
+
end
|
data/lib/jekyll-local-theme.rb
CHANGED
@@ -1,26 +1,4 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# frozen_string_literal: true
|
2
3
|
|
3
|
-
|
4
|
-
require "jekyll-remote-theme"
|
5
|
-
|
6
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
|
-
|
8
|
-
module Jekyll
|
9
|
-
module LocalTheme
|
10
|
-
autoload :MockGemspec, "jekyll-local-theme/mock_gemspec"
|
11
|
-
autoload :Munger, "jekyll-local-theme/munger"
|
12
|
-
autoload :Theme, "jekyll-local-theme/theme"
|
13
|
-
autoload :VERSION, "jekyll-local-theme/version"
|
14
|
-
|
15
|
-
CONFIG_KEY = "local_theme"
|
16
|
-
LOG_KEY = "Local Theme:"
|
17
|
-
|
18
|
-
def self.init(site)
|
19
|
-
Munger.new(site).munge!
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
Jekyll::Hooks.register :site, :after_reset do |site|
|
25
|
-
Jekyll::LocalTheme.init(site)
|
26
|
-
end
|
4
|
+
require_relative 'jekyll/local_theme'
|
metadata
CHANGED
@@ -1,29 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-local-theme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- なつき
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.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: 1.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jekyll
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.0.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.0.0
|
27
41
|
description:
|
28
42
|
email:
|
29
43
|
- i@ntk.me
|
@@ -31,15 +45,22 @@ executables: []
|
|
31
45
|
extensions: []
|
32
46
|
extra_rdoc_files: []
|
33
47
|
files:
|
48
|
+
- LICENSE
|
49
|
+
- README.md
|
34
50
|
- lib/jekyll-local-theme.rb
|
35
|
-
- lib/jekyll
|
36
|
-
- lib/jekyll
|
37
|
-
- lib/jekyll
|
38
|
-
- lib/jekyll
|
51
|
+
- lib/jekyll/local_theme.rb
|
52
|
+
- lib/jekyll/local_theme/mock_gem_specification.rb
|
53
|
+
- lib/jekyll/local_theme/theme.rb
|
54
|
+
- lib/jekyll/local_theme/version.rb
|
39
55
|
homepage: https://github.com/ntkme/jekyll-local-theme
|
40
56
|
licenses:
|
41
57
|
- MIT
|
42
|
-
metadata:
|
58
|
+
metadata:
|
59
|
+
bug_tracker_uri: https://github.com/ntkme/jekyll-local-theme/issues
|
60
|
+
documentation_uri: https://rubydoc.info/gems/jekyll-local-theme/0.2.1
|
61
|
+
source_code_uri: https://github.com/ntkme/jekyll-local-theme/tree/v0.2.1
|
62
|
+
funding_uri: https://github.com/sponsors/ntkme
|
63
|
+
rubygems_mfa_required: 'true'
|
43
64
|
post_install_message:
|
44
65
|
rdoc_options: []
|
45
66
|
require_paths:
|
@@ -48,14 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
69
|
requirements:
|
49
70
|
- - ">="
|
50
71
|
- !ruby/object:Gem::Version
|
51
|
-
version: 2.
|
72
|
+
version: 2.4.0
|
52
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
74
|
requirements:
|
54
75
|
- - ">="
|
55
76
|
- !ruby/object:Gem::Version
|
56
77
|
version: '0'
|
57
78
|
requirements: []
|
58
|
-
rubygems_version: 3.
|
79
|
+
rubygems_version: 3.5.6
|
59
80
|
signing_key:
|
60
81
|
specification_version: 4
|
61
82
|
summary: Jekyll plugin for building Jekyll sites with any local theme
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module LocalTheme
|
5
|
-
class Munger < Jekyll::RemoteTheme::Munger
|
6
|
-
def munge!
|
7
|
-
return unless raw_theme
|
8
|
-
|
9
|
-
Jekyll.logger.info LOG_KEY, "Using theme #{theme.root}"
|
10
|
-
unless munged?
|
11
|
-
configure_theme
|
12
|
-
end
|
13
|
-
|
14
|
-
theme
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def munged?
|
20
|
-
site.theme&.is_a?(Jekyll::LocalTheme::Theme)
|
21
|
-
end
|
22
|
-
|
23
|
-
def theme
|
24
|
-
@theme ||= Theme.new(raw_theme, Jekyll.sanitized_path(Jekyll.sanitized_path(site.source, "_themes"), raw_theme))
|
25
|
-
end
|
26
|
-
|
27
|
-
def raw_theme
|
28
|
-
config[CONFIG_KEY]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jekyll
|
4
|
-
module LocalTheme
|
5
|
-
class Theme < Jekyll::Theme
|
6
|
-
def initialize(name, root)
|
7
|
-
@root = root
|
8
|
-
super(name)
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def gemspec
|
14
|
-
@gemspec ||= MockGemspec.new(self)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|