jekyll-multisite 0.5 → 0.5.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/lib/jekyll-multisite.rb +27 -27
- metadata +9 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec27f20052b71fbfca4c7cb24ad9cda7e2ce72279fb228825aa6e1eacbcf54ac
|
4
|
+
data.tar.gz: 7eedfcb364cf40c4c8a65ec22feb63abf723672ce876b7869f8f496a8e2c0f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c43c745c8f6d54f9f615a07e5ddb40c497ca613a22dbcedf4b7be524448200352b075719a28de84693250a9e3fbd1eedbf8a4244714a8fc8ae738960558084a9
|
7
|
+
data.tar.gz: ed1642a88e91e7097b980ccecad2e3f6a094ff208d58799392381831c97e8a343148ed1bad5fb2c58542c14b0e0030565fa7b3f73a8e485f99b0424686997ad0
|
data/lib/jekyll-multisite.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
"""
|
2
|
-
jekyll-multisite Sumit Khanna - http://penguindreams.org
|
2
|
+
jekyll-multisite Sumit Khanna - http://penguindreams.org
|
3
3
|
|
4
4
|
---
|
5
5
|
|
@@ -29,19 +29,19 @@ module Jekyll
|
|
29
29
|
|
30
30
|
class << self
|
31
31
|
def sanitized_path(base_directory, questionable_path)
|
32
|
-
|
32
|
+
|
33
33
|
if base_directory.eql?(questionable_path)
|
34
34
|
base_directory
|
35
35
|
elsif questionable_path.start_with?(base_directory)
|
36
36
|
questionable_path
|
37
|
-
elsif File.
|
37
|
+
elsif File.exist?(questionable_path) and !questionable_path.start_with?('/') and (ENV['OS'] == 'Windows_NT')
|
38
38
|
File.expand_path(questionable_path)
|
39
|
-
elsif File.
|
39
|
+
elsif File.exist?(questionable_path) and questionable_path != '/' and !(ENV['OS'] == 'Windows_NT')
|
40
40
|
File.expand_path(questionable_path)
|
41
41
|
else
|
42
42
|
File.join(base_directory, questionable_path)
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -57,7 +57,7 @@ module Jekyll
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
# Shared source reader
|
62
62
|
|
63
63
|
class Reader
|
@@ -65,39 +65,39 @@ module Jekyll
|
|
65
65
|
def read
|
66
66
|
@site.layouts = LayoutReader.new(site).read
|
67
67
|
read_directories
|
68
|
-
|
68
|
+
|
69
69
|
if @site.config['shared_dir']
|
70
70
|
read_directories File.join('..', @site.config['shared_dir'])
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
sort_files!
|
74
74
|
@site.data = DataReader.new(site).read(site.config['data_dir'])
|
75
75
|
CollectionReader.new(site).read
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
end
|
79
79
|
|
80
80
|
|
81
81
|
# Move the _shared directories to the correct location
|
82
|
-
# (very hacky - we move all the files to the correct
|
82
|
+
# (very hacky - we move all the files to the correct
|
83
83
|
# location with a hook after the site is written/rendered)
|
84
84
|
|
85
85
|
def self.sync_dir(cur, base, dest)
|
86
86
|
Dir.glob( File.join(cur, '*'), File::FNM_DOTMATCH).each do |f|
|
87
|
-
|
87
|
+
|
88
88
|
rel = Pathname.new(f).relative_path_from(base)
|
89
89
|
dest_dir = File.join(dest, rel)
|
90
|
-
|
90
|
+
|
91
91
|
if File.basename(f) == '.' or File.basename(f) == '..'
|
92
|
-
next
|
92
|
+
next
|
93
93
|
elsif File.directory?(f)
|
94
|
-
|
95
|
-
|
96
|
-
|
94
|
+
if not File.exist?(dest_dir)
|
95
|
+
Dir.mkdir(dest_dir)
|
96
|
+
end
|
97
97
|
sync_dir(f, base, dest)
|
98
|
-
|
98
|
+
Dir.rmdir(f)
|
99
99
|
else
|
100
|
-
|
100
|
+
FileUtils.mv(f, dest_dir)
|
101
101
|
end
|
102
102
|
end
|
103
103
|
end
|
@@ -110,10 +110,10 @@ module Jekyll
|
|
110
110
|
base_shared = File.basename(site.config['shared_dir'])
|
111
111
|
shared_dir = File.join(site.dest, base_shared)
|
112
112
|
static_shared_dir = File.join(Configuration::DEFAULTS['destination'], base_shared)
|
113
|
-
|
113
|
+
|
114
114
|
sync_dir(shared_dir, Pathname.new(shared_dir), site.dest)
|
115
115
|
sync_dir(static_shared_dir, Pathname.new(static_shared_dir), site.dest)
|
116
|
-
|
116
|
+
|
117
117
|
Dir.rmdir(shared_dir)
|
118
118
|
Dir.rmdir(static_shared_dir)
|
119
119
|
end
|
@@ -140,7 +140,7 @@ module Jekyll
|
|
140
140
|
|
141
141
|
begin
|
142
142
|
require "jekyll-paginate"
|
143
|
-
|
143
|
+
|
144
144
|
module Paginate
|
145
145
|
|
146
146
|
class Pager
|
@@ -148,7 +148,7 @@ module Jekyll
|
|
148
148
|
page.name == 'index.html'
|
149
149
|
end
|
150
150
|
end
|
151
|
-
|
151
|
+
|
152
152
|
class Pagination < Generator
|
153
153
|
def paginate(site, page)
|
154
154
|
all_posts = site.site_payload['site']['posts']
|
@@ -159,14 +159,14 @@ module Jekyll
|
|
159
159
|
if num_page > 1
|
160
160
|
|
161
161
|
# Here is our monkey patch
|
162
|
-
|
163
|
-
|
162
|
+
if File.basename(page.dir) == site.config['shared_dir']
|
163
|
+
base = File.expand_path(File.join(site.source, '..'))
|
164
164
|
newpage = Page.new(site, base, page.dir, page.name)
|
165
165
|
else
|
166
|
-
|
167
|
-
|
166
|
+
newpage = Page.new(site, site.source, page.dir, page.name)
|
167
|
+
end
|
168
168
|
|
169
|
-
|
169
|
+
newpage.pager = pager
|
170
170
|
newpage.dir = Pager.paginate_path(site, num_page)
|
171
171
|
site.pages << newpage
|
172
172
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-multisite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Strickroth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jekyll
|
@@ -55,7 +55,11 @@ files:
|
|
55
55
|
homepage: https://github.com/csware/jekyll-multisite
|
56
56
|
licenses:
|
57
57
|
- GPL-3.0
|
58
|
-
metadata:
|
58
|
+
metadata:
|
59
|
+
source_code_uri: https://github.com/csware/jekyll-multisite
|
60
|
+
bug_tracker_uri: https://github.com/csware/jekyll-multisite/issues
|
61
|
+
changelog_uri: https://github.com/csware/jekyll-multisite/releases
|
62
|
+
homepage_uri: https://github.com/csware/jekyll-multisite
|
59
63
|
post_install_message:
|
60
64
|
rdoc_options: []
|
61
65
|
require_paths:
|
@@ -64,14 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
68
|
requirements:
|
65
69
|
- - ">="
|
66
70
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
71
|
+
version: 2.0.0
|
68
72
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
73
|
requirements:
|
70
74
|
- - ">="
|
71
75
|
- !ruby/object:Gem::Version
|
72
76
|
version: '0'
|
73
77
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
78
|
+
rubygems_version: 3.1.6
|
75
79
|
signing_key:
|
76
80
|
specification_version: 4
|
77
81
|
summary: jekyll-multisite
|