siteleaf 0.9.18 → 0.9.19

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.
Files changed (4) hide show
  1. data/README.md +10 -3
  2. data/bin/siteleaf +4 -4
  3. data/lib/siteleaf/version.rb +1 -1
  4. metadata +1 -1
data/README.md CHANGED
@@ -124,9 +124,9 @@ page = Siteleaf::Page.find('519719ddcc85910626000001')
124
124
 
125
125
  # create new post in page
126
126
  post = Siteleaf::Post.create({
127
- :page_id => page.id
128
- :title => 'My Post',
129
- :body => 'This is my first post.'
127
+ :parent_id => page.id
128
+ :title => 'My Post',
129
+ :body => 'This is my first post.'
130
130
  })
131
131
 
132
132
  # update page, add metadata, add taxonomy
@@ -135,6 +135,13 @@ post.meta = [ {"key" => "foo", "value" => "bar"} ]
135
135
  post.taxonomy = [ {"key" => "Tags", "values" => ["One","Two","Three"]} ]
136
136
  post.save
137
137
 
138
+ # upload asset to post (use site_id, page_id, or theme_id to upload to Site, Page, or Theme instead)
139
+ asset = Siteleaf::Asset.create({
140
+ :post_id => post.id,
141
+ :file => File.open("~/image.png"),
142
+ :filename => "image.png"
143
+ })
144
+
138
145
  # delete post
139
146
  post.delete
140
147
 
data/bin/siteleaf CHANGED
@@ -167,7 +167,7 @@ when 's', 'server'
167
167
  when 'auth'
168
168
  auth true
169
169
  when 'c', 'config', 'setup'
170
- if auth
170
+ if auth != false
171
171
  if site = Siteleaf::Site.find_by_domain(ARGV[1])
172
172
  config site
173
173
  else
@@ -175,7 +175,7 @@ when 'c', 'config', 'setup'
175
175
  end
176
176
  end
177
177
  when 'n', 'new'
178
- if auth
178
+ if auth != false
179
179
  if (site = Siteleaf::Site.create(:title => ARGV[1], :domain => ARGV[1])) && (!site.error)
180
180
  dir = ARGV.size >= 3 ? ARGV[2] : ARGV[1]
181
181
  Dir.mkdir(dir) unless File.directory?(dir)
@@ -188,7 +188,7 @@ when 'n', 'new'
188
188
  when 'pull'
189
189
  case ARGV[1]
190
190
  when 'theme'
191
- if auth
191
+ if auth != false
192
192
  if site_id = get_site_id
193
193
  get_theme_assets(site_id)
194
194
  else
@@ -201,7 +201,7 @@ when 'pull'
201
201
  when 'push'
202
202
  case ARGV[1]
203
203
  when 'theme'
204
- if auth
204
+ if auth != false
205
205
  if site_id = get_site_id
206
206
  put_theme_assets(site_id)
207
207
  else
@@ -1,3 +1,3 @@
1
1
  module Siteleaf
2
- VERSION = "0.9.18"
2
+ VERSION = "0.9.19"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: siteleaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.18
4
+ version: 0.9.19
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: