title: Where to find body html tag to put some scripts in it at index.md or index.mdx file of docusaurus static site generator?
body: <p>A question regarding adding netlifyCMS to docusaurus website.</p>
  <p>In a tutorial, I am stuck at this process where it requires me to add a script in Docusaurus <code>Head</code> and <code>Body</code> but the file is mdx and I am not sure how to make it happen?</p>
  <p>Quoting: &quot;To do this, add the following script before the closing body tag of your site's main index page:&quot;</p>
  <pre class="lang-js prettyprint-override"><code>&lt;script&gt;
    if (window.netlifyIdentity) {
      window.netlifyIdentity.on(&quot;init&quot;, user =&gt; {
        if (!user) {
          window.netlifyIdentity.on(&quot;login&quot;, () =&gt; {
            document.location.href = &quot;/admin/&quot;;
          });
        }
      });
    }
  &lt;/script&gt;
  </code></pre>
  <p>Link to the article: <a href="https://www.netlifycms.org/docs/add-to-your-site/#add-the-netlify-identity-widget" rel="nofollow noreferrer">https://www.netlifycms.org/docs/add-to-your-site/#add-the-netlify-identity-widget</a></p>
  <p>Basically as the <code>.mdx</code> or <code>.md</code> index file of my docusaurus code is not HTML, I am not sure where to find the <code>body</code> tag and put that script there.</p>