title: How to render pugjs on electron?
body: <p>I am trying to use pug on electron.</p>
  
  <p>I have a question my second <code>.pug</code> file is not rendered correctly, it just output the pug code itself.</p>
  
  <p>First I have this main pug file that was loaded by the main.js</p>
  
  <pre><code>doctype
  html(lang='en')
    head
      meta(charset='utf-8')
      title HIMS
    body
      div(id="app")
      script.
        require('./index.js')
  </code></pre>
  
  <p>then the index.js will just call the login.js</p>
  
  <pre><code>const fs = require('fs');
  const path = require('path');
  
  var link = document.createElement('link');
  link.setAttribute('rel', 'stylesheet');
  link.setAttribute('href', path.join(__dirname, 'style.css'));
  document.head.appendChild(link);
  
  const login = path.join(__dirname, 'login.pug');
  fs.readFile(login, 'utf8', function (err, data) {
      if (err) {
          return console.log(err);
      }
      document.getElementById('app')
          .innerHTML = data;
  });
  </code></pre>
  
  <p>but the <code>.innerHTML</code> will just output the pug code itself.</p>
  
  <p>Please help how I can fix.
  I will appreciate any advice or hint will come, thanks.</p>