flutterby icon indicating copy to clipboard operation
flutterby copied to clipboard

Unable to build static site

Open arnoldtonderaimarunda opened this issue 7 years ago • 2 comments

Tried to run bin/flutterby build and obtained the following error. A partially filled folder _Build has been created. The localhost run bin/flutterby serve works well.

🦋 Flutterby 0.6.2 📚 Importing site... 🌲 Read 45 nodes. 💾 Exporting site... • Exported /css/styles.css • Exported /files/year5.html • Exported /img/247booking.png • Exported /index.html • Exported /js/app.js • Exported /year10/Arts/arts_lesson_1.html • Exported /year10/Arts/arts_lesson_2.html • Exported /year10/Exegesis/exegesis_lesson_1.html • Exported /year10/Exegesis/exegesis_lesson_2.html • Exported /year10/lessons.html /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/node.rb:354:in block in render': undefined method html_safe' for nil:NilClass (NoMethodError) Did you mean? html_safe? from /usr/local/Cellar/ruby/2.4.3_1/lib/ruby/2.4.0/benchmark.rb:308:in realtime' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/node.rb:352:in render' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:19:in export_node' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:24:in block in export_node' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:23:in each' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:23:in export_node' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:24:in block in export_node' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:23:in each' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:23:in export_node' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/exporter.rb:8:in export!' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/cli.rb:47:in block in build' from /usr/local/Cellar/ruby/2.4.3_1/lib/ruby/2.4.0/benchmark.rb:308:in realtime' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/lib/flutterby/cli.rb:38:in build' from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in run' from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in dispatch' from /usr/local/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/base.rb:466:in start' from /usr/local/lib/ruby/gems/2.4.0/gems/flutterby-0.6.2/exe/flutterby:10:in <top (required)>' from bin/flutterby:17:in load' from bin/flutterby:17:in

'

arnoldtonderaimarunda avatar Dec 30 '17 09:12 arnoldtonderaimarunda

Note, removing the html_safe from node.rb method allows the process to complete successfully.

arnoldtonderaimarunda avatar Dec 30 '17 09:12 arnoldtonderaimarunda

Whilst, it successfully created a static build I noted a failure to render correctly the hyperlinks in .html.slim documents to other .html.slim documents.

For example; li = link_to "Year 5", "/year5/lessons", class: "button"

is rendered in the _build directory as <li><a class="button" href="/year5/lessons">Year 5</a></li>

instead of <li><a class="button" href="/year5/lessons.html">Year 5</a></li>

Thanks

arnoldtonderaimarunda avatar Dec 30 '17 10:12 arnoldtonderaimarunda