rename to conveyer
This commit is contained in:
parent
45db2ba40f
commit
551ca08296
|
@ -2,6 +2,6 @@ History.txt
|
||||||
Manifest.txt
|
Manifest.txt
|
||||||
README.txt
|
README.txt
|
||||||
Rakefile
|
Rakefile
|
||||||
bin/autoblog
|
bin/conveyer
|
||||||
lib/autoblog.rb
|
lib/conveyer.rb
|
||||||
test/test_autoblog.rb
|
test/test_conveyer.rb
|
|
@ -1,10 +1,10 @@
|
||||||
h1. AutoBlog
|
h1. Conveyer
|
||||||
|
|
||||||
Blog like a developer.
|
Blog like a developer.
|
||||||
|
|
||||||
h2. Example Proto-Site
|
h2. Example Proto-Site
|
||||||
|
|
||||||
My own personal site/blog is generated with autoblog.
|
My own personal site/blog is generated with Conveyer.
|
||||||
|
|
||||||
The proto-site repo ("http://github.com/mojombo/tpw":http://github.com/mojombo/tpw)
|
The proto-site repo ("http://github.com/mojombo/tpw":http://github.com/mojombo/tpw)
|
||||||
is converted into the actual site ("http://tom.preston-werner.com/":http://tom.preston-werner.com)
|
is converted into the actual site ("http://tom.preston-werner.com/":http://tom.preston-werner.com)
|
||||||
|
@ -14,9 +14,9 @@ h2. Install and Run
|
||||||
This is beta software. You will need to download the source
|
This is beta software. You will need to download the source
|
||||||
and run the software from there.
|
and run the software from there.
|
||||||
|
|
||||||
$ git clone git://github.com/mojombo/autoblog
|
$ git clone git://github.com/mojombo/conveyer
|
||||||
$ cd autoblog
|
$ cd conveyer
|
||||||
$ bin/autoblog /path/to/proto/site /path/to/generated/site
|
$ bin/conveyer /path/to/proto/site /path/to/generated/site
|
||||||
|
|
||||||
h2. License
|
h2. License
|
||||||
|
|
||||||
|
|
6
Rakefile
6
Rakefile
|
@ -1,12 +1,12 @@
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
require 'hoe'
|
require 'hoe'
|
||||||
|
|
||||||
# Hoe.new('autoblog', Autoblog::VERSION) do |p|
|
# Hoe.new('conveyer', Conveyer::VERSION) do |p|
|
||||||
# # p.rubyforge_name = 'autoblogx' # if different than lowercase project name
|
# # p.rubyforge_name = 'conveyerx' # if different than lowercase project name
|
||||||
# # p.developer('FIX', 'FIX@example.com')
|
# # p.developer('FIX', 'FIX@example.com')
|
||||||
# end
|
# end
|
||||||
|
|
||||||
desc "Open an irb session preloaded with this library"
|
desc "Open an irb session preloaded with this library"
|
||||||
task :console do
|
task :console do
|
||||||
sh "irb -rubygems -r ./lib/autoblog.rb"
|
sh "irb -rubygems -r ./lib/conveyer.rb"
|
||||||
end
|
end
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
||||||
|
|
||||||
require 'autoblog'
|
require 'conveyer'
|
||||||
|
|
||||||
AutoBlog.process(ARGV[0], ARGV[1])
|
Conveyer.process(ARGV[0], ARGV[1])
|
|
@ -14,17 +14,17 @@ require 'liquid'
|
||||||
require 'redcloth'
|
require 'redcloth'
|
||||||
|
|
||||||
# internal requires
|
# internal requires
|
||||||
require 'autoblog/site'
|
require 'conveyer/site'
|
||||||
require 'autoblog/convertible'
|
require 'conveyer/convertible'
|
||||||
require 'autoblog/layout'
|
require 'conveyer/layout'
|
||||||
require 'autoblog/page'
|
require 'conveyer/page'
|
||||||
require 'autoblog/post'
|
require 'conveyer/post'
|
||||||
require 'autoblog/filters'
|
require 'conveyer/filters'
|
||||||
|
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
VERSION = '0.1.0'
|
VERSION = '0.1.0'
|
||||||
|
|
||||||
def self.process(source, dest)
|
def self.process(source, dest)
|
||||||
AutoBlog::Site.new(source, dest).process
|
Conveyer::Site.new(source, dest).process
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
module Convertible
|
module Convertible
|
||||||
# Read the YAML frontmatter
|
# Read the YAML frontmatter
|
||||||
# +base+ is the String path to the dir containing the file
|
# +base+ is the String path to the dir containing the file
|
||||||
|
@ -35,7 +35,7 @@ module AutoBlog
|
||||||
payload = payload.merge(site_payload)
|
payload = payload.merge(site_payload)
|
||||||
|
|
||||||
# render content
|
# render content
|
||||||
self.content = Liquid::Template.parse(self.content).render(payload, [AutoBlog::Filters])
|
self.content = Liquid::Template.parse(self.content).render(payload, [Conveyer::Filters])
|
||||||
|
|
||||||
# output keeps track of what will finally be written
|
# output keeps track of what will finally be written
|
||||||
self.output = self.content
|
self.output = self.content
|
||||||
|
@ -44,7 +44,7 @@ module AutoBlog
|
||||||
layout = layouts[self.data["layout"]]
|
layout = layouts[self.data["layout"]]
|
||||||
while layout
|
while layout
|
||||||
payload = payload.merge({"content" => self.output, "page" => self.data})
|
payload = payload.merge({"content" => self.output, "page" => self.data})
|
||||||
self.output = Liquid::Template.parse(layout.content).render(payload, [AutoBlog::Filters])
|
self.output = Liquid::Template.parse(layout.content).render(payload, [Conveyer::Filters])
|
||||||
|
|
||||||
layout = layouts[layout.data["layout"]]
|
layout = layouts[layout.data["layout"]]
|
||||||
end
|
end
|
|
@ -1,4 +1,4 @@
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
|
|
||||||
module Filters
|
module Filters
|
||||||
def date_to_string(date)
|
def date_to_string(date)
|
|
@ -1,4 +1,4 @@
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
|
|
||||||
class Layout
|
class Layout
|
||||||
include Convertible
|
include Convertible
|
||||||
|
@ -36,12 +36,12 @@ module AutoBlog
|
||||||
# Returns nothing
|
# Returns nothing
|
||||||
def add_layout(layouts, site_payload)
|
def add_layout(layouts, site_payload)
|
||||||
payload = {"page" => self.data}.merge(site_payload)
|
payload = {"page" => self.data}.merge(site_payload)
|
||||||
self.content = Liquid::Template.parse(self.content).render(payload, [AutoBlog::Filters])
|
self.content = Liquid::Template.parse(self.content).render(payload, [Conveyer::Filters])
|
||||||
|
|
||||||
layout = layouts[self.data["layout"]] || self.content
|
layout = layouts[self.data["layout"]] || self.content
|
||||||
payload = {"content" => self.content, "page" => self.data}
|
payload = {"content" => self.content, "page" => self.data}
|
||||||
|
|
||||||
self.content = Liquid::Template.parse(layout).render(payload, [AutoBlog::Filters])
|
self.content = Liquid::Template.parse(layout).render(payload, [Conveyer::Filters])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
|
|
||||||
class Page
|
class Page
|
||||||
include Convertible
|
include Convertible
|
|
@ -1,4 +1,4 @@
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
|
|
||||||
class Post
|
class Post
|
||||||
include Comparable
|
include Comparable
|
|
@ -1,4 +1,4 @@
|
||||||
module AutoBlog
|
module Conveyer
|
||||||
|
|
||||||
class Site
|
class Site
|
||||||
attr_accessor :source, :dest
|
attr_accessor :source, :dest
|
|
@ -1,8 +1,8 @@
|
||||||
require File.join(File.dirname(__FILE__), *%w[.. lib autoblog])
|
require File.join(File.dirname(__FILE__), *%w[.. lib conveyer])
|
||||||
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
||||||
include AutoBlog
|
include Conveyer
|
||||||
|
|
||||||
def dest_dir
|
def dest_dir
|
||||||
File.join(File.dirname(__FILE__), *%w[dest])
|
File.join(File.dirname(__FILE__), *%w[dest])
|
||||||
|
|
Loading…
Reference in New Issue