MiddlemanMiddleman es un entorno para generación de páginas estatícas. Entre sus ventajas contamos:
Conversión de Erfurtwiki a MiddlemanPara convertir de Erfurtwiki (corriendo en PostgreSQL) a Middleman hicimos esto:
COPY (SELECT DISTINCT pagename, (TIMESTAMP 'epoch' + created * INTERVAL '1 SECOND')::DATE, version, content FROM ewiki WHERE (pagename, version) IN ( SELECT pagename, max(version) FROM ewiki GROUP BY 1) ORDER BY 2) TO '/tmp/e' with csv;
require 'csv' def ew_a_md(ew) md = ew.gsub("==", '```') md.gsub!("!!!", "#") md.gsub!("!!", "##") md.gsub!("^\!", "###") return md end CSV.foreach "/tmp/e" do |row| t = row[0].gsub(/[^0-9A-Za-z.\-]/, '_') f = row[1] n = f + "-" + t + ".html.markdown" puts n io = open n, "w" io.puts "---" io.puts "title: #{t}" io.puts "date: #{f}" io.puts "tags:" io.puts "---" io.puts ew_a_md row[3] io.close end Uso tipicoPara crear un articulo de titulo "Compracion de Navegadores": middleman article "Comparacion de Navegadores" |