Permalink
Browse files

big push. added config files. wmd for editing markdown.

  • Loading branch information...
1 parent 0f1add0 commit c8040ed63e35073e54d05363d4af0d5b05cde886 @jtulloch committed Dec 18, 2008
View
@@ -1,6 +1,4 @@
*.log
tmp/*
-config/app_config.rb
-config/config.yml
Capfile
config/deploy.rb
View
@@ -0,0 +1,14 @@
+configure do
+ require 'ostruct'
+ Blog = OpenStruct.new(
+ :title => 'a name for your blog',
+ :author => 'Joel Tulloch',
+ :url_base => 'http://localhost:4567/',
+ :database_name => 'change_db_name',
+ :url_base_database => nil,
+ :admin_password => 'changethis',
+ :admin_cookie_key => 'admin_cookie_key',
+ :admin_cookie_value => '54l976913ace58',
+ :disqus_shortname => nil
+ )
+end
View
@@ -0,0 +1,14 @@
+---
+environment: production
+chdir: /path/to/app/
+address: 127.0.0.1
+user: root
+group: root
+port: 4567
+pid: /path/to/app/tmp/thin.pid
+rackup: /path/to/app/config/rackup.ru
+log: /path/to/app/logs/thin.log
+max_conns: 1024
+timeout: 30
+max_persistent_conns: 512
+daemonize: true
View
@@ -6,7 +6,6 @@
class Post < CouchRest::Model
use_database CouchRest.database!((Blog.url_base_database || '') + Blog.database_name)
-
key_accessor :title, :body, :slug, :tags, :not_public
view_by :created_at, :descending=>true
@@ -104,11 +103,8 @@ def self.make_slug(title)
def to_html(markdown)
h = Maruku.new(markdown).to_html
- h.gsub(/<code>([^<]+)<\/code>/m) do
- convertor = Syntax::Convertors::HTML.for_syntax "ruby"
- highlighted = convertor.convert($1)
- "<code>#{highlighted}</code>"
- end
+ h.gsub!(/<pre>/, "<pre class=\"prettyprint\">")
+ h
end
def split_content(string)
View
@@ -0,0 +1,21 @@
+class FeedUser < CouchRest::Model
+ use_database CouchRest.database!((Blog.url_base_database || '') + Blog.database_name)
+ #use_database CouchRest.database!("yet_another_please")
+ key_accessor :last_access
+ key_reader :uid
+
+ view_by :last_access
+ view_by :uid
+
+ before(:create, :generate_uid)
+ def generate_uid
+ uuid = UUID.new
+ self['uid'] = uuid.generate :compact
+ end
+
+ def self.exists?(uid)
+ false if FeedUser.by_uid.first.nil?
+ end
+
+ couchrest_type = 'FeedUser'
+end
View
@@ -36,9 +36,10 @@ def parse_tags tags
get '/' do
posts = []
if admin?
- posts = Post.by_created_at :count=>10
+ posts = Post.by_created_at :count=>3
+ @readers = FeedUser.by_uid.size
else
- posts = Post.by_created_at_and_public :count=>10
+ posts = Post.by_created_at_and_public :count=>3
end
erb :index, :locals => { :posts => posts }, :layout => false
end
@@ -84,14 +85,21 @@ def parse_tags tags
end
get '/feed/:uid' do
- user = FeedUser.by_uid :key=>:uid, :count=>1
- user.first.last_access = Time.now
+ user = FeedUser.by_uid(:key=>params[:uid], :count=>1).first
+ user.last_access = Time.now
user.save
@posts = Post.by_created_at_and_public :count=>10
content_type 'application/atom+xml', :charset => 'utf-8'
builder :feed
end
+get '/robots.txt' do
+ content_type 'text/plain', :charset => 'utf-8'
+ 'User-agent: *
+Disallow: /feed
+Disallow: /feed/'
+end
+
get '/feed' do
user = FeedUser.new :last_access => Time.now
user.save
@@ -102,6 +110,10 @@ def parse_tags tags
redirect '/feed', 301
end
+get '/in_the_wild' do
+ erb :in_the_wild
+end
+
### Admin
get '/auth' do
@@ -152,3 +164,6 @@ def parse_tags tags
redirect post.url if post.save
end
+get '/about' do
+ erb :about
+end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -173,12 +173,87 @@ hr {
font-size: 120%;
}
+/* Banner */
+
+#banner
+{
+ position:fixed;
+ height:2em;
+ top:0.5em;
+ left:2.5em;
+ right:0.5em;
+ background:#3F3F3F;
+ border:0.5em solid #0A0A0D;
+ z-index:100;
+}
+#banner a
+{
+ color:#BFBFB3;
+ margin: auto 0.5em;
+}
+
#new_post {
position: absolute;
- top: 1em;
- right: 1em;
+ top:2.25em;
+ right: 0em;
+}
+#bar {
+ position: absolute;
+ top:0.25em;
+ left:1em;
+}
+#follow_me
+{
+ position: absolute;
+ top:0.25em;
+ right:0em;
+ color:#5F5F5F;
+}
+#follow_me img
+{
+ padding:0;
+ border:none;
+ height:1.5em;
+ width:1.5em;
+}
+#bar_menu
+{
+ margin:0;
+ padding:0;
+ list-style-type: none;
+ float:left;
+}
+#bar_menu li
+{
+ margin:0;
+ padding:0;
+ float:left;
+ margin:0 1px 0 0;
+ display:inline;
+}
+#bar_menu a, #bar_menu p
+{
+ float:left;
+ padding: 0 5px;
+ font-weight:bolder;
+ text-decoration:none;
+ color:#AFAFA4;
+}
+#bar_menu a:hover
+{
+ text-decoration:underline;
+}
+#bar_menu a:active
+{
+ font-weight:bold;
+ color:#0A0A0D;
+}
+#bar_menu img
+{
+ border:none;
}
+
/* Post */
.postzoom {
@@ -214,6 +289,12 @@ hr {
right: 0;
}
+.entry img.face
+{
+ margin:1em 0 1em 1em;
+ float:right;
+}
+
/* Footer */
#footer {
@@ -257,21 +338,21 @@ pre {
pre span.attribute { color: #009900; }
pre span.char { color: #F00; }
-pre span.class { color: #A020F0; font-weight: bold; }
-pre span.comment { color: #0000FF; }
-pre span.constant { color: #008B8B; }
-pre span.escape { color: #6A5ACD; }
+pre span.typ { color: #FFCB00; font-weight: bold; }
+pre span.com { color: #947F3D; }
+pre span.lit { color: #329998; }
+pre span.pln { color: #FFFFFF; }
pre span.expr { color: #2222CC; }
-pre span.global { color: #11AA44; }
+pre span.atv { color: #11AA44; }
pre span.ident { color: #CCCCCC; }
-pre span.keyword { color: #A52A2A; font-weight: bold; }
+pre span.kwd { color: #EE5400; font-weight: bold; }
pre span.method { color: #008B8B; }
-pre span.module { color: #A020F0; font-weight: bold; }
-pre span.number { color: #DD00DD; }
-pre span.punct { color: #6A5ACD; }
-pre span.regex { color: #DD00DD; }
-pre span.string { color: #DD00DD; }
-pre span.symbol { color: #008B8B; }
+pre span.tag { color: #FC6210; font-weight: bold; }
+pre span.dec { color: #DD00DD; }
+pre span.pun { color: #6A5ACD; }
+pre span.atn { color: #DD00DD; }
+pre span.str { color: #64FD00; }
+pre span.pun { color: #CCCCCC; }
/* Edit post */
View
@@ -0,0 +1,26 @@
+/* Pretty printing styles. Used with prettify.js. */
+
+.str { color: #080; }
+.kwd { color: #008; }
+.com { color: #800; }
+.typ { color: #606; }
+.lit { color: #066; }
+.pun { color: #660; }
+.pln { color: #000; }
+.tag { color: #008; }
+.atn { color: #606; }
+.atv { color: #080; }
+.dec { color: #606; }
+
+@media print {
+ .str { color: #060; }
+ .kwd { color: #006; font-weight: bold; }
+ .com { color: #600; font-style: italic; }
+ .typ { color: #404; font-weight: bold; }
+ .lit { color: #044; }
+ .pun { color: #440; }
+ .pln { color: #000; }
+ .tag { color: #006; font-weight: bold; }
+ .atn { color: #404; }
+ .atv { color: #060; }
+}
Oops, something went wrong.

0 comments on commit c8040ed

Please sign in to comment.