# Custom code for 'links' widget require 'liveblog' class ::RuneBlog::Widget class Links Type, Title = "links", "External links" def initialize(repo) @blog = repo @datafile = input = "list.data" @lines = _get_data(@datafile) end def build write_main write_card end def _html_body(file, css = nil) file.puts "" if css file.puts "
" file.puts " " file.puts " " end file.puts " " yield file.puts " \n" end def write_main @data = @lines.map! {|x| x.chomp.split(/, */, 3) } css = "body { font-family: verdana }" card_title = Title File.open("#{Type}-main.html", "w") do |f| _html_body(f, css) do f.puts "