#!/bin/ruby require 'erb' require 'fileutils' require 'yaml' require './lib/blog' require './lib/statics' require './lib/pather' require './lib/templated' require './lib/util' def path_to asset_id P.path_to asset_id end if !Dir.exists? 'public' Dir.mkdir 'public' end P = Pather.new P.cd 'src' statics = [ 'style.css', '.well-known/acme-challenge/Tw4EQEgfzPP6garbkCV5pQJaJiOLhJYbuTbfPyFElcI', '.well-known/keybase.txt', 'key.asc' ] P.add 'key', 'key.asc' P.add 'style', 'style.css' P.add 'index', 'index.html' P.add 'blog', 'blog.html' P.add 'projects', 'projects.html' P.add 'crypto', 'crypto.html' P.add 'rss', 'rss.xml' P.add 'sunday', 'sunday-corner' if !Dir.exists? 'public/blog' Dir.mkdir 'public/blog' end posts.each do |post| P.add post['id'], post['html_filename'] end write_statics statics write_templated_erb 'index.html.erb', title: 'Martin Chrzanowski.' write_templated_erb 'projects.html.erb', title: 'Projects.' write_blog_archive write_templated_file 'crypto.html', title: 'Crypto addresses.' P.cd 'blog' compile_posts posts write_blog_files P.cd '..' write_erb 'rss.xml.erb'