├── tmp └── pids │ └── empty ├── .ruby-version ├── tasks ├── rakehelper.rb ├── gem.rake ├── job.rake └── heroku.rake ├── .coveralls.yml ├── .gitignore ├── test ├── examples │ └── sample-blog.git │ │ ├── HEAD │ │ ├── refs │ │ └── heads │ │ │ └── master │ │ ├── description │ │ ├── config │ │ ├── objects │ │ ├── 11 │ │ │ └── 992faecf562bbb2c61b2204a3127de2ee12334 │ │ ├── 26 │ │ │ └── 39904f3862ce5d03e5b2e170623e82db429759 │ │ ├── 27 │ │ │ └── 74b7649263d005cb3f20fe10433b2b4a38331c │ │ ├── 31 │ │ │ └── e1656029f748f12f2bafb16d178f2dc750898f │ │ ├── 41 │ │ │ └── 8d02bb8f340b39b22187accfb6eafba2dc371b │ │ ├── 45 │ │ │ └── eff3004e279198ef929df9b5cd8e3a4acd6f83 │ │ ├── 61 │ │ │ └── b271f3c22b5cced7ccb68e000287e73575ae19 │ │ ├── 72 │ │ │ └── cf7cd00432b7fa1b1a5a6c9816a8f40475c02d │ │ ├── 76 │ │ │ └── a56d9261863c7e4c0627105258cfcfdc9eb8ee │ │ ├── 09 │ │ │ └── 38f453a21cc470d172d353aaa6d1cc9a3665dd │ │ ├── 4f │ │ │ └── b2e631f02920ff5a32483f0a45510b2a06d835 │ │ ├── 6d │ │ │ └── 67c09ede6bf1dd09c61c175c9007ed1b06d9fd │ │ ├── 9c │ │ │ └── 3fff779a5b5706a180c3a84c3ed46317d1037e │ │ ├── 9d │ │ │ ├── b41e9e0deb7f6ffa7e4d06dc56c9eb1316b693 │ │ │ └── e0c333998d31283a90e0983e1e865e1333318d │ │ ├── bc │ │ │ └── da5867b55a878660b3431b815e7cb7c051bf64 │ │ ├── c0 │ │ │ └── 50d75c623cd4a558b8caa010feb487c8786eca │ │ ├── c1 │ │ │ └── 3b61a6115adef8fb9b87fb87a818b4095b7ea8 │ │ ├── d1 │ │ │ └── 1e3c9e553731278e9db746e6b2e204df247526 │ │ ├── d4 │ │ │ └── c6b64e785d44c6f97e00483fe26ad1ea269a26 │ │ ├── d6 │ │ │ └── ecb16f4ecb3c8a0cb3752c2e447e622e458d91 │ │ ├── dd │ │ │ └── 0d7ed109642d315916857fe9846cb352952b87 │ │ ├── e4 │ │ │ └── 3b74d098c234eb1d05925c71f43da6a49fabd5 │ │ └── fa │ │ │ └── a2241ced67495f860ab37e0c79932bd5b3b5e1 │ │ ├── hooks │ │ ├── post-commit.sample │ │ ├── post-update.sample │ │ ├── pre-applypatch.sample │ │ ├── applypatch-msg.sample │ │ ├── post-receive.sample │ │ ├── commit-msg.sample │ │ ├── prepare-commit-msg.sample │ │ ├── pre-commit.sample │ │ ├── update.sample │ │ └── pre-rebase.sample │ │ └── info │ │ └── exclude ├── helper.rb └── test_app.rb ├── .env ├── test.rb ├── unicorn.rb ├── lib ├── pagoda │ ├── public │ │ ├── images │ │ │ ├── fullscreen.png │ │ │ └── apple-touch-icon.png │ │ ├── js │ │ │ ├── jquery.autosize.js │ │ │ ├── keymaster.min.js │ │ │ ├── screenfull.js │ │ │ ├── jquery.tiptip.min.js │ │ │ ├── editor.coffee │ │ │ └── editor.js │ │ └── css │ │ │ ├── tiptip.css │ │ │ ├── pagoda.scss │ │ │ └── pagoda.css │ ├── views │ │ ├── settings.rb │ │ ├── home.rb │ │ ├── new_post.rb │ │ ├── edit.rb │ │ └── layout.rb │ ├── templates │ │ ├── settings.mustache │ │ ├── editor_area.mustache │ │ ├── new_post.mustache │ │ ├── layout.mustache │ │ ├── home.mustache │ │ └── edit.mustache │ ├── config.rb │ ├── jekyll_mod.rb │ ├── helper.rb │ └── app.rb └── workers │ ├── sidekiq.rb │ └── push_commit.rb ├── .travis.yml ├── config.rb ├── Gemfile ├── Rakefile ├── bin ├── pagoda-local.ru └── pagoda ├── config.ru ├── Changelog.md ├── LICENSE ├── pagoda.gemspec ├── Gemfile.lock └── README.md /tmp/pids/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 1.9.3 2 | -------------------------------------------------------------------------------- /tasks/rakehelper.rb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .sass-cache 2 | *gem 3 | coverage 4 | tmp/repo 5 | -------------------------------------------------------------------------------- /test/examples/sample-blog.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | JEKYLL_REPO=git@github.com:alagu/pagoda-demo-blog.git 2 | PUSH_VIA_QUEUE=true -------------------------------------------------------------------------------- /test.rb: -------------------------------------------------------------------------------- 1 | puts File.dirname(File.expand_path File.dirname(File.dirname(__FILE__))) 2 | -------------------------------------------------------------------------------- /unicorn.rb: -------------------------------------------------------------------------------- 1 | pid "./tmp/pids/unicorn.pid" 2 | listen "unix:./tmp/sock/unicorn.sock" 3 | -------------------------------------------------------------------------------- /test/examples/sample-blog.git/refs/heads/master: -------------------------------------------------------------------------------- 1 | 72cf7cd00432b7fa1b1a5a6c9816a8f40475c02d 2 | -------------------------------------------------------------------------------- /test/examples/sample-blog.git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /lib/pagoda/public/images/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/lib/pagoda/public/images/fullscreen.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | rvm: 2 | - 1.9.3 3 | notifications: 4 | email: 5 | - alagu@alagu.net 6 | before_install: 7 | - sudo apt-get update -------------------------------------------------------------------------------- /lib/pagoda/public/images/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/lib/pagoda/public/images/apple-touch-icon.png -------------------------------------------------------------------------------- /test/examples/sample-blog.git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = true 5 | ignorecase = true 6 | -------------------------------------------------------------------------------- /lib/pagoda/views/settings.rb: -------------------------------------------------------------------------------- 1 | module Shwedagon 2 | module Views 3 | class Settings < Layout 4 | 5 | def title 6 | "Settings" 7 | end 8 | end 9 | end 10 | end -------------------------------------------------------------------------------- /lib/pagoda/views/home.rb: -------------------------------------------------------------------------------- 1 | module Shwedagon 2 | module Views 3 | class Home < Layout 4 | attr_reader :drafts 5 | attr_reader :published 6 | 7 | 8 | end 9 | end 10 | end -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/09/38f453a21cc470d172d353aaa6d1cc9a3665dd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/09/38f453a21cc470d172d353aaa6d1cc9a3665dd -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/11/992faecf562bbb2c61b2204a3127de2ee12334: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/11/992faecf562bbb2c61b2204a3127de2ee12334 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/26/39904f3862ce5d03e5b2e170623e82db429759: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/26/39904f3862ce5d03e5b2e170623e82db429759 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/27/74b7649263d005cb3f20fe10433b2b4a38331c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/27/74b7649263d005cb3f20fe10433b2b4a38331c -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/31/e1656029f748f12f2bafb16d178f2dc750898f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/31/e1656029f748f12f2bafb16d178f2dc750898f -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/41/8d02bb8f340b39b22187accfb6eafba2dc371b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/41/8d02bb8f340b39b22187accfb6eafba2dc371b -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/45/eff3004e279198ef929df9b5cd8e3a4acd6f83: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/45/eff3004e279198ef929df9b5cd8e3a4acd6f83 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/4f/b2e631f02920ff5a32483f0a45510b2a06d835: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/4f/b2e631f02920ff5a32483f0a45510b2a06d835 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/61/b271f3c22b5cced7ccb68e000287e73575ae19: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/61/b271f3c22b5cced7ccb68e000287e73575ae19 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/6d/67c09ede6bf1dd09c61c175c9007ed1b06d9fd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/6d/67c09ede6bf1dd09c61c175c9007ed1b06d9fd -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/72/cf7cd00432b7fa1b1a5a6c9816a8f40475c02d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/72/cf7cd00432b7fa1b1a5a6c9816a8f40475c02d -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/76/a56d9261863c7e4c0627105258cfcfdc9eb8ee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/76/a56d9261863c7e4c0627105258cfcfdc9eb8ee -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/9c/3fff779a5b5706a180c3a84c3ed46317d1037e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/9c/3fff779a5b5706a180c3a84c3ed46317d1037e -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/9d/b41e9e0deb7f6ffa7e4d06dc56c9eb1316b693: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/9d/b41e9e0deb7f6ffa7e4d06dc56c9eb1316b693 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/9d/e0c333998d31283a90e0983e1e865e1333318d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/9d/e0c333998d31283a90e0983e1e865e1333318d -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/bc/da5867b55a878660b3431b815e7cb7c051bf64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/bc/da5867b55a878660b3431b815e7cb7c051bf64 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/c0/50d75c623cd4a558b8caa010feb487c8786eca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/c0/50d75c623cd4a558b8caa010feb487c8786eca -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/c1/3b61a6115adef8fb9b87fb87a818b4095b7ea8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/c1/3b61a6115adef8fb9b87fb87a818b4095b7ea8 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/d1/1e3c9e553731278e9db746e6b2e204df247526: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/d1/1e3c9e553731278e9db746e6b2e204df247526 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/d4/c6b64e785d44c6f97e00483fe26ad1ea269a26: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/d4/c6b64e785d44c6f97e00483fe26ad1ea269a26 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/d6/ecb16f4ecb3c8a0cb3752c2e447e622e458d91: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/d6/ecb16f4ecb3c8a0cb3752c2e447e622e458d91 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/dd/0d7ed109642d315916857fe9846cb352952b87: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/dd/0d7ed109642d315916857fe9846cb352952b87 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/e4/3b74d098c234eb1d05925c71f43da6a49fabd5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/e4/3b74d098c234eb1d05925c71f43da6a49fabd5 -------------------------------------------------------------------------------- /test/examples/sample-blog.git/objects/fa/a2241ced67495f860ab37e0c79932bd5b3b5e1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alagu/pagoda/HEAD/test/examples/sample-blog.git/objects/fa/a2241ced67495f860ab37e0c79932bd5b3b5e1 -------------------------------------------------------------------------------- /lib/workers/sidekiq.rb: -------------------------------------------------------------------------------- 1 | 2 | $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib]) 3 | 4 | require 'rubygems' 5 | require 'pagoda/app' 6 | require 'workers/push_commit' 7 | require 'dotenv' 8 | 9 | Dotenv.load -------------------------------------------------------------------------------- /lib/pagoda/views/new_post.rb: -------------------------------------------------------------------------------- 1 | module Shwedagon 2 | module Views 3 | class NewPost < Layout 4 | attr_reader :ptitle 5 | 6 | def title 7 | @ptitle 8 | end 9 | 10 | end 11 | end 12 | end -------------------------------------------------------------------------------- /config.rb: -------------------------------------------------------------------------------- 1 | http_path = "" 2 | css_dir = "lib/pagoda/public/css" 3 | sass_dir = "lib/pagoda/public/css" 4 | output_style = :expanded 5 | line_comments = false 6 | preferred_syntax = :scss 7 | relative_assets = true 8 | fonts_dir = "" -------------------------------------------------------------------------------- /test/examples/sample-blog.git/hooks/post-commit.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script that is called after a successful 4 | # commit is made. 5 | # 6 | # To enable this hook, rename this file to "post-commit". 7 | 8 | : Nothing 9 | -------------------------------------------------------------------------------- /test/examples/sample-blog.git/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | ruby '1.9.3' 2 | 3 | source 'https://rubygems.org' 4 | 5 | gemspec 6 | gem 'rake', '~> 10.0.3' 7 | 8 | # Test related 9 | gem 'simplecov', :require => false, :group => :test 10 | gem 'coveralls', require: false 11 | gem 'sshkey' 12 | gem 'highline' 13 | gem 'sidekiq' -------------------------------------------------------------------------------- /lib/pagoda/views/edit.rb: -------------------------------------------------------------------------------- 1 | module Shwedagon 2 | module Views 3 | class Edit < Layout 4 | attr_accessor :title 5 | attr_accessor :content 6 | attr_accessor :name 7 | attr_accessor :draft 8 | attr_accessor :data_array 9 | 10 | end 11 | end 12 | end -------------------------------------------------------------------------------- /test/examples/sample-blog.git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'bundler' 3 | require 'rake' 4 | 5 | Bundler.setup 6 | 7 | Dir["tasks/*.rake"].sort.each { |ext| load ext } 8 | 9 | require 'rake/testtask' 10 | Rake::TestTask.new(:test) do |test| 11 | test.libs << 'lib' << 'test' 12 | test.pattern = 'test/**/test_*.rb' 13 | test.verbose = true 14 | end 15 | 16 | task :default => :test -------------------------------------------------------------------------------- /lib/pagoda/views/layout.rb: -------------------------------------------------------------------------------- 1 | require 'cgi' 2 | 3 | module Shwedagon 4 | module Views 5 | class Layout < Mustache 6 | include Rack::Utils 7 | alias_method :h, :escape_html 8 | 9 | attr_reader :name, :path 10 | 11 | def title 12 | "Home" 13 | end 14 | 15 | def base_url 16 | @base_url 17 | end 18 | 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /test/examples/sample-blog.git/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | test -x "$GIT_DIR/hooks/pre-commit" && 13 | exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /tasks/gem.rake: -------------------------------------------------------------------------------- 1 | require 'rake' 2 | 3 | # Publishing gem: 4 | # 5 | # $ bundle exec rake gem:publish 6 | 7 | namespace :gem do 8 | 9 | task :cleanup do 10 | puts "Cleaning up old gems" 11 | system "rm pagoda-jekyll*gem" 12 | end 13 | 14 | task :create do 15 | puts "Building new gem" 16 | system "gem build pagoda.gemspec" 17 | end 18 | 19 | task :publish => [:cleanup, :create] do 20 | gem_zip = `ls pagoda-jekyll*gem`.gsub("\n", "") 21 | command = "gem push #{gem_zip}" 22 | system command 23 | end 24 | end -------------------------------------------------------------------------------- /lib/pagoda/templates/settings.mustache: -------------------------------------------------------------------------------- 1 |
2 | 3 |
......
32 |
33 |
34 | Install
35 | =======
36 |
37 | Installing locally
38 | ------------------
39 | Two commands, one for installing, another for running.
40 |
41 | ```sh
42 | gem install pagoda-jekyll
43 | pagoda .
44 | ```
45 |
46 |
47 | 
48 |
49 |
50 | Running it on Heroku
51 | --------------------
52 | Requirements:
53 | 1. Heroku
54 | 2. Git
55 | 3. Your Jekyll Repo
56 |
57 | ```sh
58 | git clone https://github.com/alagu/pagoda
59 | cd pagoda
60 | heroku create
61 | bundle exec rake heroku
62 | ```
63 |
64 |
65 | Default YAML
66 | =============
67 | 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.
68 |
69 |
70 | Deploying on your own server
71 | ============================
72 | I use basic http authentication in real world use. I've deployed through nginx + unicorn. There could be easier deployment than this.
73 |
74 | This is still not well organized, but the setup works.
75 |
76 | ## Create sock and pid folders
77 |
78 | ```sh
79 | mkdir -p tmp/pids
80 | mkdir tmp/sock
81 | ```
82 |
83 | ## Your unicorn configuration (unicorn.rb):
84 |
85 | ```ruby
86 | pid "./tmp/pids/blog-admin.pid"
87 | listen "unix:./tmp/sock/blog-admin.sock"
88 | ENV['blog'] = '/path/to/your/jekyll/blog'
89 | ```
90 |
91 | ## Script to start Unicorn (start.sh):
92 |
93 | ```sh
94 | cd /path/to/pagoda
95 | rvm use 1.9.3
96 | unicorn -c unicorn.rb -D
97 | ```
98 | Note: This should be run as bash --login start.sh
99 |
100 | ## Create htpasswd file for authentication
101 | ```
102 | htpasswd -c /path/to/httpasswd/file alagu
103 | New password: