pagoda-jekyll 0.0.10 → 0.0.11
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 +8 -8
- data/Gemfile.lock +1 -1
- data/README.md +9 -0
- data/lib/pagoda/app.rb +13 -5
- data/lib/pagoda/helper.rb +10 -0
- data/lib/pagoda/public/css/pagoda.css +4 -1
- data/lib/pagoda/public/css/pagoda.scss +5 -1
- data/pagoda.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjZhODA2NzkxZjhkYjJmNjdkOGQ5MTNlNTBlZjNkOTQ2ODJhNTgzNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGJhZDdhZTg4YThhMjY0ODFmNmY1NDcyODM2OGM3NDI1ZGJmMDljOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2JkYWQ2NWJjODM3YTEyYjFmOWI1M2FkZWMxMDBjMzFkOTI5MmUzNjJlNjBk
|
10
|
+
NjA5ZGIzNmYyODc2MjU3YzMyYzdiODZkZTIzOWViZTg3NmY5Y2MxZDRmNTVi
|
11
|
+
ZDQ1Y2MyNzRhNDYwMTZjNmI3ZTQwM2Q1ZWMwMzMwODA4MjgxMmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWU3YjJlMmMzZTY1N2FiNGViNDkzNTg0NGM3OGIxMzUwN2E1MmRlYzcwNjc4
|
14
|
+
ZTg0NDk3MzA0OTRkY2UxNjZjN2E1NDg5MmU5NTBkNzJiYWM4ZmVmMjJjOTBh
|
15
|
+
YzYyMDM2MGMxY2FlMjE1OGY1YzZhZmYzNjlkM2MyOWYzZjYxYjg=
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -18,6 +18,11 @@ Screenshots
|
|
18
18
|
**Fullscreen editing**
|
19
19
|

|
20
20
|
|
21
|
+
** Edit YAML Data **
|
22
|
+
|
23
|
+

|
24
|
+
|
25
|
+
|
21
26
|
**Mobile Dashboard and Editing**
|
22
27
|
|
23
28
|
|
@@ -38,6 +43,10 @@ Two commands, one for installing, another for running.
|
|
38
43
|

|
39
44
|
|
40
45
|
|
46
|
+
Default YAML
|
47
|
+
=============
|
48
|
+
Each post created with pagoda will have a default yaml data. To modify it, create a `_default.yml` in your jekyll repository and commit it.
|
49
|
+
|
41
50
|
|
42
51
|
Deploying on your own server
|
43
52
|
============================
|
data/lib/pagoda/app.rb
CHANGED
@@ -7,6 +7,7 @@ require 'jekyll'
|
|
7
7
|
require 'json'
|
8
8
|
require 'grit'
|
9
9
|
require 'stringex'
|
10
|
+
require 'yaml'
|
10
11
|
|
11
12
|
require 'pagoda/views/layout'
|
12
13
|
require 'pagoda/helper'
|
@@ -24,17 +25,24 @@ module Shwedagon
|
|
24
25
|
before do
|
25
26
|
@base_url = url('/', false).chomp('/')
|
26
27
|
end
|
27
|
-
|
28
|
+
|
29
|
+
def yaml_data(post_title)
|
30
|
+
defaults = { 'title' => post_title,
|
31
|
+
'layout' => 'post',
|
32
|
+
'published' => false }
|
33
|
+
|
34
|
+
defaults = defaults.merge(default_yaml())
|
35
|
+
|
36
|
+
defaults
|
37
|
+
end
|
38
|
+
|
28
39
|
# Create a new post from scratch. Return filename
|
29
40
|
# This would not commit the file.
|
30
41
|
def create_new_post(params)
|
31
42
|
post_title = params['post']['title']
|
32
43
|
post_date = (Time.now).strftime("%Y-%m-%d")
|
33
|
-
yaml_data = { 'title' => post_title,
|
34
|
-
'layout' => 'post',
|
35
|
-
'published' => false }
|
36
44
|
|
37
|
-
content = yaml_data.to_yaml + "---\n" + params[:post][:content]
|
45
|
+
content = yaml_data(post_title).to_yaml + "---\n" + params[:post][:content]
|
38
46
|
post_file = (post_date + " " + post_title).to_url + '.md'
|
39
47
|
file = File.join(jekyll_site.source, *%w[_posts], post_file)
|
40
48
|
File.open(file, 'w') { |file| file.write(content)}
|
data/lib/pagoda/helper.rb
CHANGED
@@ -31,6 +31,16 @@ module Shwedagon
|
|
31
31
|
File.join(jekyll_site.source, *%w[_posts], post_file)
|
32
32
|
end
|
33
33
|
|
34
|
+
def default_yaml
|
35
|
+
defaults_file = File.join(jekyll_site.source, '_default.yml')
|
36
|
+
defaults = {}
|
37
|
+
if File.exists? defaults_file
|
38
|
+
defaults = YAML::load(File.read(defaults_file))
|
39
|
+
end
|
40
|
+
|
41
|
+
defaults
|
42
|
+
end
|
43
|
+
|
34
44
|
# Jekyll instance of post file
|
35
45
|
def jekyll_post(post_file)
|
36
46
|
Jekyll::Post.new(jekyll_site, jekyll_site.source, '', post_file)
|
@@ -249,7 +249,7 @@ code {
|
|
249
249
|
position: absolute;
|
250
250
|
background-color: #fff;
|
251
251
|
bottom: 10px;
|
252
|
-
left:
|
252
|
+
left: -60px;
|
253
253
|
float: left;
|
254
254
|
background-color: #aaa;
|
255
255
|
display: none;
|
@@ -292,6 +292,9 @@ code {
|
|
292
292
|
#publish-bar .yaml-block .yaml-table ul li .value {
|
293
293
|
margin-left: -3px;
|
294
294
|
}
|
295
|
+
#publish-bar .yaml-block .yaml-table ul li .value input {
|
296
|
+
width: 250px;
|
297
|
+
}
|
295
298
|
#publish-bar .yaml-block .yaml-table ul li:last-child .key, #publish-bar .yaml-block .yaml-table ul li:last-child .value {
|
296
299
|
border-bottom: 0 none;
|
297
300
|
}
|
@@ -249,7 +249,7 @@ code {
|
|
249
249
|
position: absolute;
|
250
250
|
background-color: #fff;
|
251
251
|
bottom: 10px;
|
252
|
-
left:
|
252
|
+
left: -60px;
|
253
253
|
float: left;
|
254
254
|
background-color: #aaa;
|
255
255
|
display: none;
|
@@ -293,6 +293,10 @@ code {
|
|
293
293
|
|
294
294
|
.value {
|
295
295
|
margin-left: -3px;
|
296
|
+
|
297
|
+
input {
|
298
|
+
width: 250px;
|
299
|
+
}
|
296
300
|
}
|
297
301
|
|
298
302
|
&:last-child {
|
data/pagoda.gemspec
CHANGED