~sivers/sive.rs

sive.rs/script/pages.rb -rwxr-xr-x 345 bytes
5fcf6634 — Derek Sivers cover and hardcover 18 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby
require_relative 'init.rb'

files = Dir[ROOT + 'content/pages/*']

def parse(fn)
  res = meta(fn)
  res[:uri] = File.basename(fn)
  res[:body] = body(fn)
  res[:bodyid] = res[:uri]
  res[:pagetitle] = res[:title].dup
  res
end

pages = files.map {|fn| parse(fn)}

pages.each do |page|
  wput(page[:uri], page(nil, page))
end