pagelime-rack 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +62 -41
- data/pagelime-rack.gemspec +4 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3a122b7b63846454d19ab2b6d167fba6f6ae579
|
4
|
+
data.tar.gz: 35a8ac5a95173b235e4cd72eb251f3f7bfd4a86d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c93b85cdee5e6958214820d2ed827d3c337382e426ba6aba0ef8f1beee75be30b573108376c0eadcb476aff7778d0eb7edede15688b676ef94079e31895cd39
|
7
|
+
data.tar.gz: f7554674b48afd006accc36ed67faade9033c7dc54b11dd37902fce68b180ce4f4d09c5550b4bd7dc4a84477f1b0ea83b6a57eb3fbdd411dfd3973a163730b32
|
data/README.md
CHANGED
@@ -3,16 +3,23 @@ Pagelime Rack Plugin
|
|
3
3
|
|
4
4
|
Easily add the Pagelime CMS to your Rack app.
|
5
5
|
|
6
|
-
Pagelime is a simple CMS service that allows you to define editable regions in your
|
7
|
-
Simply add a `class="cms-editable"` to any HTML element, and log-in to the Pagelime CMS service to edit your content and images with a nice UI.
|
6
|
+
Pagelime is a simple CMS service that allows you to define editable regions in your pages without installing any software on your website or app.
|
7
|
+
Simply add a `class="cms-editable"` to any HTML element, and log-in to the Pagelime CMS service to edit your content and images with a nice, simple UI.
|
8
8
|
We host all of the code, content, and data until you publish a page.
|
9
|
-
When you publish a page,
|
9
|
+
When you publish a page, the PageLime CMS pushes the content to your website via secure FTP or an API.
|
10
|
+
Using the Rack middleware, we pull the new content into your app dynamically via an API.
|
10
11
|
|
11
|
-
|
12
|
+
### Quick Start (1 line of code!)
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
Simply add the `cms-editable` class and an `id` to make content editable:
|
15
|
+
|
16
|
+
```html
|
17
|
+
<div id="my_content" class="cms-editable">
|
18
|
+
This content is now editable in Pagelime... no code... no databases... no fuss
|
19
|
+
</div>
|
20
|
+
```
|
21
|
+
|
22
|
+
Done!
|
16
23
|
|
17
24
|
Getting Started
|
18
25
|
---------------
|
@@ -26,11 +33,15 @@ Getting Started
|
|
26
33
|
|
27
34
|
Edit your `Gemfile` and add
|
28
35
|
|
29
|
-
|
36
|
+
```ruby
|
37
|
+
gem "pagelime-rack"
|
38
|
+
```
|
30
39
|
|
31
40
|
then run
|
32
41
|
|
33
|
-
|
42
|
+
```Bash
|
43
|
+
bundle install
|
44
|
+
```
|
34
45
|
|
35
46
|
### Step 2: Setup your Pagelime credentials
|
36
47
|
|
@@ -43,28 +54,37 @@ Make sure that the "Integration Method" for your site on the advanced tab is set
|
|
43
54
|
|
44
55
|
Set up your Environment variables: *(Skip if using Heroku add-on)*
|
45
56
|
|
46
|
-
|
47
|
-
|
48
|
-
|
57
|
+
```ruby
|
58
|
+
ENV['PAGELIME_ACCOUNT_KEY'] = "..."
|
59
|
+
ENV['PAGELIME_ACCOUNT_SECRET'] = "..."
|
60
|
+
ENV['PAGELIME_RACK_API_VERSION'] = "1.0"
|
61
|
+
```
|
49
62
|
|
50
63
|
Optionally, enable caching:
|
51
64
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
65
|
+
```ruby
|
66
|
+
Pagelime.configure do |config|
|
67
|
+
|
68
|
+
# object that responds to `fetch` and `delete`
|
69
|
+
config.cache = ...
|
70
|
+
|
71
|
+
# options passed to `fetch(key, options = {}, &block)`
|
72
|
+
config.cache_fetch_options = { ... }
|
73
|
+
|
74
|
+
end
|
75
|
+
```
|
58
76
|
|
59
77
|
### Step 4: Make pages editable
|
60
78
|
|
61
79
|
Create some editable regions in your views like so:
|
62
80
|
|
63
|
-
|
64
|
-
|
65
|
-
|
81
|
+
```html
|
82
|
+
<div id="my_content" class="cms-editable">
|
83
|
+
this is now editable
|
84
|
+
</div>
|
85
|
+
```
|
66
86
|
|
67
|
-
*The ID and the class are required for the CMS to work*
|
87
|
+
*The `ID` and the `class` are required for the CMS to work*
|
68
88
|
|
69
89
|
### Step 5: Edit your pages!
|
70
90
|
|
@@ -78,27 +98,28 @@ From there you can edit any page in your Rack app!
|
|
78
98
|
|
79
99
|
If you have a standalone Pagelime account, simply go to [pagelime.com](http://pagelime.com) and edit your site as usual (see Step 2).
|
80
100
|
|
81
|
-
|
82
101
|
Sinatra Sample
|
83
102
|
--------------
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
# Set the environment variables BEFORE requiring the pagelime-rack gem
|
106
|
+
|
107
|
+
ENV['PAGELIME_ACCOUNT_KEY'] = "..."
|
108
|
+
ENV['PAGELIME_ACCOUNT_SECRET'] = "..."
|
109
|
+
ENV['PAGELIME_RACK_API_VERSION'] = "1.0"
|
110
|
+
|
111
|
+
# Setup Sinatra app
|
112
|
+
|
113
|
+
require 'sinatra'
|
114
|
+
require 'pagelime-rack'
|
115
|
+
|
116
|
+
use Rack::Pagelime
|
117
|
+
|
118
|
+
get '/page/about' do
|
119
|
+
content_type "text/html"
|
120
|
+
return '<div id="content" class="cms-editable">Hello World!</div>'
|
121
|
+
end
|
122
|
+
```
|
102
123
|
|
103
124
|
Copyright (c) 2013 Pagelime LLC, released under the MIT license
|
104
125
|
|
data/pagelime-rack.gemspec
CHANGED
@@ -2,14 +2,15 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: pagelime-rack 0.4.6 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "pagelime-rack"
|
8
|
-
s.version = "0.4.
|
9
|
+
s.version = "0.4.6"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
12
|
s.authors = ["Emil Anticevic", "Joel Van Horn"]
|
12
|
-
s.date = "
|
13
|
+
s.date = "2014-02-11"
|
13
14
|
s.description = "The Pagelime Rack Middleware will process outgoing HTML, look for editable areas, and replace the content with the appropriate HTML from the Pagelime CDN and cache it in memory if possible."
|
14
15
|
s.email = "emil@pagelime.com"
|
15
16
|
s.extra_rdoc_files = [
|
@@ -40,7 +41,7 @@ Gem::Specification.new do |s|
|
|
40
41
|
s.homepage = "http://github.com/eanticev/pagelime-rack"
|
41
42
|
s.licenses = ["MIT"]
|
42
43
|
s.require_paths = ["lib"]
|
43
|
-
s.rubygems_version = "2.
|
44
|
+
s.rubygems_version = "2.1.5"
|
44
45
|
s.summary = "Rack Middleware for integrating Pagelime into ruby frameworks"
|
45
46
|
|
46
47
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagelime-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Anticevic
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
146
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.
|
147
|
+
rubygems_version: 2.1.5
|
148
148
|
signing_key:
|
149
149
|
specification_version: 4
|
150
150
|
summary: Rack Middleware for integrating Pagelime into ruby frameworks
|