Where I continue setting up webby o my o my…

Layout

Got to change some layouts/default.txt text … do … do …doing

o my o my… blueprint.css. What is all this: column span-20 prepend-2 append-2 first last ?
Now I need to learn the layout shortucts and get the conceptual model what blueprint.css is and what it is for … ok just read some articles got it..
So now off to layout but I have only 10 more minutes to spend on this so forget layout. just make links work and that’s it.

Purpose

I noticed that I have a hard time with writing in html tools and all the online places like blogger or wordpress. It makes sense to me to put something in txt files as source and work at it for few days and then publish some thoughts. So this is not really a blog but a scrapbook of analysis of things I work on so I will remember them in the future.

Rss Feed setup

got to make the feed. put the feed in blog/feed/atom.txt and on the layouts/default.txt add the line:

<link 
  rel="alternate" 
  type="application/atom+xml" 
  title="Blog Rss Feed"
  href="http://rubytester.com/blog/feed/atom.xml">

Deploy

how does webby handle the magic of deploy? webby provides 2 tasks webby deploy:rsync and webby deploy:ssh. and a general deploy task that first builds the site and then calls deploy:rsync.

The tasks are defined in file GEM_HOME\webby-*\lib\webby\tasks\deploy.rake.

The rsync tasks calls sh "rsync bla bla usual" and ssh uses SshDirPublisher.new(who what were bla bla).upload

So first in Sitefile I have to provide some of the options that will be used by the deploy like SITE.user, SITE.host, etc…

SITE.user = "rubytester" #your ssh name to login to the server
SITE.host = "rubytester.com" 
SITE.remote_dir = "~/rubytester.com"

ok, I think that should work.

let’s deploy…. tupi dooo ba ddo dooo… o crap!! Accessing the site gives me 403 Forbidden error.
What happened? .. ok, ….all the files are 500 mode -r-x------ and they should be 644 no? and directories should be 755? yes? I think so.
Maybe since I am on windows and I deploy to linux I end up with some generic permission collision.
the rsync or ssh task on windows does not work? or is my server not setup correctly?

looking at why webby deploy fails for me

webby uses the following tasks for deploy

require 'rake/contrib/sshpublisher'

namespace :deploy do

  desc 'Deploy to the server using rsync'
  task :rsync do
    cmd = "rsync #{SITE.rsync_args.join(' ')} "
    cmd << "#{SITE.output_dir}/ #{SITE.user}@#{SITE.host}:#{SITE.remote_dir}"
    sh cmd
  end

  desc 'Deploy to the server using ssh'
  task :ssh do
    Rake::SshDirPublisher.new(
        "#{SITE.user}@#{SITE.host}", SITE.remote_dir, SITE.output_dir
    ).upload
  end

end  # deploy

# EOF

Since I provided the user and host the deploy worked but the permissions for files sent to the server were incorrect. I write on Windows XP the files on the server were given mode 700. ok, let’s delete all the files from the server and try again using ssh this time instead of rsync

zippy duda do… ok, all ssh got copied over and the mode of files and dirs is rwx------ so I get permission denied on serving those files. Damn. The problem must be on windows side or on my server.

OK, let’s try to copy files with WinSCP; guess what, all dirs get set to 755 and files to 644 as expected. So the problem seems to be cygwin rsycn or OpenSSH for win xp. What if I switched to Putty? hmm… will need to investigate it. For now deploy is broken for me, I have to do it manually with winscp, (I wonder if Robocopy or RichCopy might work in this situation)

Next task add disqus to the posts

Next I think I should have some comments with disqus probably. But wait. I only want comments for articles and not for all pages but currently all pages are using one layout ‘default.txt’ so I need to make articles use its own layout first and include the output back in the main default.txt (I think). So this article.txt should have a layout: article and layouts/article.txt should have a layout: default.txt or just none, I mean default is default yes?

ok let’s do layouts/article.txt and add a disqus code to it.

blog comments powered by Disqus
rss icon