Browse Source

Some encoding shit

master
Aaron Mueller 8 years ago
parent
commit
81e3f0fc42
  1. 3
      scripts/generate_pages.rb
  2. 6
      update.php

3
scripts/generate_pages.rb

@ -29,7 +29,8 @@ Dir.glob('wiki-data/pages/**/*').each do |file|
# Markdown files gets converted to HTML
next unless File.extname(file) == '.mkd'
document = Kramdown::Document.new(File.read(file), :input => 'markdown')
content = File.read(file).force_encoding("UTF-8").encode("UTF-8", :replace => nil)
document = Kramdown::Document.new(content, :input => 'markdown')
File.open("#{basepath}/public_html/pages/#{file_relative[0..-5]}.html", 'w') do |f|
f.write(document.to_html)
end

6
update.php

@ -3,6 +3,6 @@
$token = trim(file_get_contents('update_token'));
if (empty($_GET['token']) || $_GET['token'] !== $token) die();
exec('git pull');
exec('git submodule update');
exec('scripts/generate_pages.rb');
shell_exec('git pull');
shell_exec('cd wiki-data && git pull');
shell_exec('scripts/generate_pages.rb');