zerofetcher 0.0.75 → 0.0.79

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5ddfb19a41e7570151f37a4521a7f4d318b0c924
4
- data.tar.gz: 49aa6fd53a842155418c64ee9243cff3870a3afa
2
+ SHA256:
3
+ metadata.gz: 9f182186f7a5055fadfc306fa9b37a7de06ce816d9cb74c34f11184f7a597c32
4
+ data.tar.gz: 70bed69c4c3aef8a8101bf24ff3026be85e597f765efc49808aeceba578ab468
5
5
  SHA512:
6
- metadata.gz: 9ac77a5c69e9d56bcb8ff1074e87bc6ff4f81940a4c11447ff65794a072a72eafab53c58d2829dc4e70342f020d51c20292418602e9a667dcd7ef7fadf08e481
7
- data.tar.gz: 63f198152c4d7311b53f9e4172eed52268127c650605505e0438c35f44e7243c5ee082838ec405ca6d70f2bddd04e22d1647105d2edc20c316dc296a9834a4c4
6
+ metadata.gz: fa6d8b1732bd2f90be7ee65f7ee069c47d18c8720ea882368f14edb76fd347a5766244664f2a274f645ad2c0673651f46e3f085d3c6759bc3fd8c8270456809c
7
+ data.tar.gz: ed04a11984f7305a6e0a335543ceaf7fed74548cab2c2f91bb0f6c7c89976f3a01f3697b5d87c645b923088262656c009904291333c13f325129d5b3feec2d3d
@@ -75,6 +75,7 @@ class JekyllFile
75
75
  end
76
76
 
77
77
  @yaml_parsed['sitemap'] = ('1' == data['ignore_sitemap']) ? false : true
78
+ @yaml_parsed['parent_id'] = @file_data['parent_id']
78
79
  @yaml_parsed['page_id'] = @file_data['id']
79
80
  @yaml_parsed['meta_title'] = (@file_data['meta_title']) ? @file_data['meta_title'] : @file_data['name']
80
81
  @yaml_parsed['meta_description'] = @file_data['meta_description']
data/lib/zerofetcher.rb CHANGED
@@ -35,6 +35,7 @@ class ZeroFetcher
35
35
  FileUtils::mkdir_p jekyll_path+'/_logs'
36
36
  FileUtils::mkdir_p jekyll_path+'/_data'
37
37
  FileUtils::mkdir_p jekyll_path+'/_posts'
38
+ FileUtils::mkdir_p jekyll_path+'/_passwords'
38
39
  FileUtils::mkdir_p jekyll_path+'/assets'
39
40
  FileUtils::mkdir_p jekyll_path+'/assets/images'
40
41
  FileUtils::mkdir_p jekyll_path+'/assets/images/pages'
@@ -99,6 +100,8 @@ ErrorDocument 404 /404/index.html'
99
100
  # Image Variants
100
101
  @@image_variants = data['image_variants']
101
102
 
103
+ paths_with_passwords = Array.new
104
+
102
105
  # Pages
103
106
  if data.key?("pages")
104
107
  pages_files_saved = Array.new
@@ -129,6 +132,10 @@ ErrorDocument 404 /404/index.html'
129
132
 
130
133
  self.log(" - Saved:"+jpage.getFileName)
131
134
 
135
+ if page['password_id']
136
+ paths_with_passwords.push({'url' => page['url'], 'password_id' => page['password_id']})
137
+ end
138
+
132
139
  # Add to pages array
133
140
  page_info = {
134
141
  'id' => page['id'],
@@ -164,7 +171,18 @@ ErrorDocument 404 /404/index.html'
164
171
 
165
172
  # Clean up content files
166
173
  self.cleanUpPages( pages_folder, content_files_saved )
167
- end
174
+ end
175
+
176
+ if data.key?("passwords")
177
+ # Save individual password files
178
+ data['passwords'].each do |password|
179
+ self.log('writing File /_passwords/.htpasswd_'+password['id'])
180
+ self.writeFile( jekyll_path+'/_passwords/.htpasswd_'+password['id'] , password['username']+':'+password['password'] );
181
+ end
182
+
183
+ # write _data/passwords.json
184
+ self.writeFile( jekyll_path+'/_data/passwords.json', JSON.pretty_generate(paths_with_passwords) )
185
+ end
168
186
 
169
187
  # Variables
170
188
  if data.key?("variables")
@@ -172,16 +190,21 @@ ErrorDocument 404 /404/index.html'
172
190
  self.log("Writing File /_data/vars.json")
173
191
  end
174
192
 
175
- # Content Blocks
193
+ # Content Blocks v2
176
194
  if data.key?("content_blocks")
177
195
  puts 'Content Blocks - ' + data['content_blocks'].length.to_s
178
196
  self.log('Content Blocks - ' + data['content_blocks'].length.to_s)
179
197
  cb_folder = jekyll_path+'/_includes/content_blocks'
180
198
 
181
- data['content_blocks'].each do |key, content_block|
182
- self.log('writing File /_includes/content_blocks/'+key+'.md')
183
- self.writeFile( cb_folder+'/'+key+'.md' , content_block.to_s );
199
+ # Save original .md files
200
+ data['content_blocks'].each do |content_block|
201
+ self.log('writing File /_includes/content_blocks/'+content_block['key']+'.md')
202
+ self.writeFile( cb_folder+'/'+content_block['key']+'.md' , content_block['content'].to_s );
184
203
  end
204
+
205
+ # Save json data file
206
+ self.writeFile( jekyll_path+'/_data/content_blocks.json', JSON.pretty_generate(data['content_blocks']) )
207
+ self.log('Writing file /_data/galleries.json')
185
208
  end
186
209
 
187
210
  # Content Images
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zerofetcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.75
4
+ version: 0.0.79
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Liccardo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-10 00:00:00.000000000 Z
11
+ date: 2022-01-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fetches content from zero
14
14
  email: brian@d3corp.com
@@ -25,7 +25,7 @@ homepage: http://d3corp.com
25
25
  licenses:
26
26
  - MIT
27
27
  metadata: {}
28
- post_install_message:
28
+ post_install_message:
29
29
  rdoc_options: []
30
30
  require_paths:
31
31
  - lib
@@ -40,9 +40,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  requirements: []
43
- rubyforge_project:
44
- rubygems_version: 2.4.5
45
- signing_key:
43
+ rubygems_version: 3.1.6
44
+ signing_key:
46
45
  specification_version: 4
47
46
  summary: Zero Fetcher
48
47
  test_files: []