~sivers/sive.rs

daa8cb5778c40aabd1ba7e0e049280d409d61c24 — Derek Sivers 6 days ago acb9eb2 master
move DB to comments.rb only
2 files changed, 5 insertions(+), 4 deletions(-)

M script/comments.rb
M script/init.rb
M script/comments.rb => script/comments.rb +5 -1
@@ 1,7 1,11 @@
#!/usr/bin/env ruby
# WEB_DIR and DB here:
# WEB_DIR here:
require_relative 'init'

require 'pg'
DB = PG::Connection.new(dbname: 'd50b', user: 'd50b')


###########################################################################
# Turn comments in the database into static HTML on disk, for faster serving
###########################################################################

M script/init.rb => script/init.rb +0 -3
@@ 1,4 1,3 @@
require 'pg'
require 'psych'
require 'mustache'
require 'date'


@@ 14,8 13,6 @@ WEB_DIR = ROOT + '/site/'
# https://m.sive.rs/ files
MEDIA_DIR = File.expand_path('../../../m', __FILE__) + '/'

DB = PG::Connection.new(dbname: 'd50b', user: 'd50b')

# write file only if different than what's already there
def wput(uri, contents)
  filepath = WEB_DIR + uri