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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmQ5MDVhNjhiMmY3ZTQ2MTA3ODExMGRlNDM3MzY3YmMxMzYxZGQ3YQ==
4
+ NjZhODA2NzkxZjhkYjJmNjdkOGQ5MTNlNTBlZjNkOTQ2ODJhNTgzNg==
5
5
  data.tar.gz: !binary |-
6
- M2VmNmE5Y2JjMDFmODRkM2ZjY2FkMDBkMTQzZTJmOWFmNTUwMTlkNA==
6
+ MGJhZDdhZTg4YThhMjY0ODFmNmY1NDcyODM2OGM3NDI1ZGJmMDljOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ODNiOTBiYzI1NmM4NTAwOTBmMjVlMmE0NGUyYjZkM2NhYWI5ZTNhMGM1YWY2
10
- NDE1Y2YyZjljZGY5NTdjMjM5YmQ3NTM0NzFhNTY3YzZiNTAwNjNkZmZjNDFh
11
- Nzc3OWM1ODkwYTM4YTFmMTNmNjM0MTM2ZWNkZmE2ZjlhZGFiMzY=
9
+ Y2JkYWQ2NWJjODM3YTEyYjFmOWI1M2FkZWMxMDBjMzFkOTI5MmUzNjJlNjBk
10
+ NjA5ZGIzNmYyODc2MjU3YzMyYzdiODZkZTIzOWViZTg3NmY5Y2MxZDRmNTVi
11
+ ZDQ1Y2MyNzRhNDYwMTZjNmI3ZTQwM2Q1ZWMwMzMwODA4MjgxMmI=
12
12
  data.tar.gz: !binary |-
13
- NjY1YTk3MmE1ODUyYTViOTQxNzNlZmEwNmQxNWY3MTNjNjlkNGZiNjg4OWIz
14
- NGZhNmE5MTRiMDYwMjQzZDNhNmU1MTg5ZTViYzA3M2FlMDYxNGFjMjA4YjFj
15
- NDRhOTg2Yjg1NzdiZTg1M2Y0NDAyZjZmMWUzY2I1YjgxNWY1ZGM=
13
+ ZWU3YjJlMmMzZTY1N2FiNGViNDkzNTg0NGM3OGIxMzUwN2E1MmRlYzcwNjc4
14
+ ZTg0NDk3MzA0OTRkY2UxNjZjN2E1NDg5MmU5NTBkNzJiYWM4ZmVmMjJjOTBh
15
+ YzYyMDM2MGMxY2FlMjE1OGY1YzZhZmYzNjlkM2MyOWYzZjYxYjg=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pagoda-jekyll (0.0.9)
4
+ pagoda-jekyll (0.0.11)
5
5
  grit
6
6
  jekyll
7
7
  json
data/README.md CHANGED
@@ -18,6 +18,11 @@ Screenshots
18
18
  **Fullscreen editing**
19
19
  ![http://cl.ly/image/0b3Y101Y3g0A/Screen%20Shot%202013-05-14%20at%2011.57.45%20PM.png](http://cl.ly/image/0b3Y101Y3g0A/Screen%20Shot%202013-05-14%20at%2011.57.45%20PM.png)
20
20
 
21
+ ** Edit YAML Data **
22
+
23
+ ![http://cl.ly/image/2P342Q1W0q1H/Screen%20Shot%202013-06-09%20at%203.13.13%20PM.png](http://cl.ly/image/2P342Q1W0q1H/Screen%20Shot%202013-06-09%20at%203.13.13%20PM.png)
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
  ![http://cl.ly/image/1B3Z1Q3I1g37/pagoda-install.png](http://cl.ly/image/1B3Z1Q3I1g37/pagoda-install.png)
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
  ============================
@@ -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)}
@@ -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: 20px;
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: 20px;
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 {
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'pagoda-jekyll'
8
- s.version = '0.0.10'
8
+ s.version = '0.0.11'
9
9
  s.date = '2013-06-09'
10
10
  s.rubyforge_project = 'pagoda-jekyll'
11
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagoda-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alagu