Browse Source

Some encoding shit

Aaron Mueller 7 years ago
parent
commit
81e3f0fc42
2 changed files with 5 additions and 4 deletions
  1. 2
    1
      scripts/generate_pages.rb
  2. 3
    3
      update.php

+ 2
- 1
scripts/generate_pages.rb View File

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

+ 3
- 3
update.php View File

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

Loading…
Cancel
Save