siteleaf 0.9.11 → 0.9.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +14 -5
- data/bin/siteleaf +1 -1
- data/lib/siteleaf/server.rb +2 -3
- data/lib/siteleaf/site.rb +1 -1
- data/lib/siteleaf/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -114,6 +114,7 @@ pages = site.pages
|
|
114
114
|
|
115
115
|
# create new page in site
|
116
116
|
page = Siteleaf::Page.create({
|
117
|
+
:site_id => site.id
|
117
118
|
:title => 'My Page',
|
118
119
|
:slug => 'my-page', # optional
|
119
120
|
:body => 'This is my first page.'
|
@@ -122,14 +123,22 @@ page = Siteleaf::Page.create({
|
|
122
123
|
# get page by id
|
123
124
|
page = Siteleaf::Page.find('519719ddcc85910626000001')
|
124
125
|
|
126
|
+
# create new post in page
|
127
|
+
post = Siteleaf::Post.create({
|
128
|
+
:page_id => page.id
|
129
|
+
:title => 'My Post',
|
130
|
+
:slug => 'my-post', # optional
|
131
|
+
:body => 'This is my first post.'
|
132
|
+
})
|
133
|
+
|
125
134
|
# update page, add metadata, add taxonomy
|
126
|
-
|
127
|
-
|
135
|
+
post.title = 'New Title'
|
136
|
+
post.meta = [ {"key" => "foo", "value" => "bar"} ]
|
128
137
|
post.taxonomy = [ {"key" => "Tags", "values" => ["One","Two","Three"]} ]
|
129
|
-
|
138
|
+
post.save
|
130
139
|
|
131
|
-
# delete
|
132
|
-
|
140
|
+
# delete post
|
141
|
+
post.delete
|
133
142
|
|
134
143
|
# delete page by id
|
135
144
|
Siteleaf::Page.delete('519719ddcc85910626000001')
|
data/bin/siteleaf
CHANGED
@@ -124,7 +124,7 @@ when '-h', '--help', 'help'
|
|
124
124
|
when 's', 'server'
|
125
125
|
if File.exist?('config.ru')
|
126
126
|
port = ARGV[2] if %w[-p --port].include?(ARGV[1]) && ARGV[1]
|
127
|
-
`rackup config.ru -p #{port || '9292'}`
|
127
|
+
`rackup config.ru -p #{port || '9292'} >&2`
|
128
128
|
else
|
129
129
|
puts "No config found, run `siteleaf config yoursite.com`.\n"
|
130
130
|
end
|
data/lib/siteleaf/server.rb
CHANGED
@@ -69,9 +69,8 @@ module Siteleaf
|
|
69
69
|
end
|
70
70
|
|
71
71
|
output = site.preview(url, template_data)
|
72
|
-
if output.code == 200 && output.headers[
|
73
|
-
|
74
|
-
[output.code, {'Content-Type' => output.headers[:content_type]}, [output.to_s]]
|
72
|
+
if output.code == 200 && output.headers["content-type"]
|
73
|
+
[output.code, {'Content-Type' => output.headers["content-type"]}, [output.to_s]]
|
75
74
|
else
|
76
75
|
[output.code, {'Content-Type' => 'text/html'}, [output.to_s]]
|
77
76
|
end
|
data/lib/siteleaf/site.rb
CHANGED
data/lib/siteleaf/version.rb
CHANGED
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.
|
4
|
+
version: 0.9.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|