File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2
2
marker_footer = '<!-- /#End_Content_Marker - DO NOT (RE)MOVE! -->'
3
3
4
4
begin
5
- html = File . open ( Rails . root + '../index.html' , 'r' ) { |f | f . read }
5
+ puts "Try to generate static files for wiki..."
6
+ html = File . open ( Rails . root + '../index.html' , 'r' ) { |f | f . read }
6
7
7
8
doc = Nokogiri ::HTML ( html [ 0 , html . index ( marker_header ) ] )
8
9
24
25
write_to . puts ( header [ 0 , header . length -16 ] ) #extreme ugly because nokogiri add </body></html> at the end of its document
25
26
26
27
write_to = File . new ( Rails . root + "app/views/layouts/footer.html" , "w+" )
28
+
27
29
write_to . puts ( html [ html . index ( marker_footer ) +marker_footer . length , html . length ] )
28
30
29
31
#copy fresh static files from the frontend on every startup only on dev mode
36
38
%x[cp -R ../images public/]
37
39
%x[touch public/images/.images_go_here]
38
40
end
39
-
41
+ puts "...finished!"
40
42
rescue Exception => e
41
43
puts "Can't generate static HTML Header and Footer! Do nothing!"
42
44
puts "ERROR: #{ e } "
You can’t perform that action at this time.
0 commit comments