Skip to content

[Website] Bug: Generating a page from a markdown file without a first-line '# header' causes the html file to be generated in unexpected path #84

Description

@monk-afk

CMS only, no in-game experience is affected by this.

Per the title, for example:

### This is not an H1 tag

Here is some content

![Some Example](/images/foo/ack/bar.html)

___

The html file renders the full markdown files within the <title> and

tags:

<!DOCTYPE html>
  <html lang="en_US">
    <head>
      <meta charset="utf-8" />
      <link rel="canonical" href="https://squareone.moe/">
      <link rel="icon" type="image/png" href="/favicon.ico">
      <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
      <link href="/css/style.css" type="text/css" rel="stylesheet">
      <link href="/css/menu.css" type="text/css" rel="stylesheet">
      <link href="/css/notices.css" type="text/css" rel="stylesheet">
      <title>SquareOne ❖ ### This is not an H1 tag

Here is some content

![Some Example](foo/ack/bar.html)

___
 </title>

      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">

      <meta name="viewport" content="width=device-width, initial-scale=1">
      <meta name="description" content="SquareOne ❖ Survival Multi-Player for Luanti ❖ monk.moe:30023">

      <meta property="og:url" content="https://squareone.moe/">
      <meta property="og:type" content="object">
      <meta property="og:title" content="SquareOne ❖ monk.moe:30023">
      <meta property="og:description" content="SquareOne is an Open-world Survival Multiplayer Server for Luanti. Join us at 'monk.moe' on port '30023'. MultiCraft invite code: 'monk.moe:30023'">
      <meta property="og:image" content="https://squareone.moe/images/squareone_banner.png">

      <meta name="twitter:card" content="summary_large_image">
      <meta name="twitter:image" content="https://squareone.moe/images/squareone_banner.png">
      <meta property="twitter:url" content="https://squareone.moe/">
      <meta property="twitter:domain" content="squareone.moe">
      <meta name="twitter:title" content="SquareOne ❖ monk.moe:30023">
      <meta name="twitter:description" content="SquareOne is an Open-world Survival Multiplayer Server for Luanti. Join us at 'monk.moe' on port '30023'. MultiCraft invite code: 'monk.moe:30023'">

      <script src="/js/jquery-3.x.min.js"></script>
    </head>

    <body>
      <!-- ======== NAVIGATION MENU ============================= -->
      <div class="main-nav slideout-menu slideout-menu-left" id="menu">
        <div class="flex-container">
          <nav class="sidebar-nav">
            <ul class="metismenu" id="metismenu">
              <li>
                <a href="/index.html" aria-expanded="false" class="sidebar-brand">
                  <img src="/images/squareone_text.png" id="sidebar-logo" alt="SquareOne">
                </a>
              </li>

                  <li><a href="/pages/rules.html" aria-expanded="false" class="webkitNoSelect">RULES</a></li>

                  <li><a href="/pages/staff.html" aria-expanded="false" class="webkitNoSelect">STAFF</a></li>

                  <li><a href="/pages/map.html" aria-expanded="false" class="webkitNoSelect">MAPS</a></li>

              <li class="">
                <a href="#" class="has-arrow webkitNoSelect" aria-expanded="false">MOD INFO</a>
                <ul class="mm-collapse">
                  <li><a href="/pages/economy.html" aria-expanded="false" class="webkitNoSelect">Economy</a></li>
                  <li><a href="/pages/tools.html" aria-expanded="false" class="webkitNoSelect">Tools</a></li>
                  <li><a href="/pages/armor.html" aria-expanded="false" class="webkitNoSelect">Armor</a></li>
                  <li><a href="/pages/exp.html" aria-expanded="false" class="webkitNoSelect">Exp</a></li>
                  <li><a href="/pages/mining.html" aria-expanded="false" class="webkitNoSelect">Mining</a></li>
                  <li><a href="/pages/crystal.html" aria-expanded="false" class="webkitNoSelect">Crystal</a></li>
                  <li><a href="/pages/protect.html" aria-expanded="false" class="webkitNoSelect">Protect</a></li>
                  <li><a href="/pages/faq.html" aria-expanded="false" class="webkitNoSelect">FAQs</a></li>
                </ul>
              </li>

                  <li><a href="/pages/history.html" aria-expanded="false" class="webkitNoSelect">HISTORY</a></li>

                  <li><a href="/pages/guide.html" aria-expanded="false" class="webkitNoSelect">INTRO GUIDE</a></li>

                  <li><a href="/pages/updates.html" aria-expanded="false" class="webkitNoSelect">UPDATES</a></li>

              <li><a href="https://discord.gg/pE4Tu3cf23"><img src="https://dcbadge.limes.pink/api/server/pE4Tu3cf23?logoColor=red&theme=grey" alt=""></a></li>
            </ul>
          </nav>
        </div>
      </div>
      <main id="panel" class="slideout-panel slideout-panel-left">
        <div id="header">
          <h1 id="top">  ### This is not an H1 tag

Here is some content

![Some Example](foo/ack/bar.html)

___
</h1>
          <div class="toggle-button hamburger hamburger--spin">
            <div class="hamburger-box">
              <div class="hamburger-inner">
              </div>
            </div>
          </div>
        </div>
        <div class="content">
          <hr class="header-hr">
          <div class="pagebox">
            <!-- ===== MAIN CONTENT ============================= -->
<h3>This is not an H1 tag</h3>

<p>Here is some content</p>

<p><img src="/images/foo/ack/bar.html" alt="Some Example" /></p>

<hr class="header-hr">
            <div class="page-timestamp">
              <span><a href="#top">TOP</a></span>
              <span>Updated <code>2026-07-18 12:35:20</code></span>
            </div>
          </div>
        </div>
        <!-- ===== FOOTER =================================== -->
        <footer>
          <hr class="header-hr">
          <div class="signature">
            <span>Circa. 2023-05-28</span>
            <span class="icon"></span>
            <span>Square<span class="icon">One</span>
            </span>
            <span class="icon"></span>
            <span><a href="https://github.com/monk-afk">by mønκ</a></span>
          </div>
          <div class="footer-logo">
            <img src="/images/squareone_icon_64px.png" alt="SquareOne Four-squared Diamond Logo" />
          </div>
        </footer>
      </main>
    </div>
    <script src="/js/metismenu.js"></script>
    <script src="/js/slideout.js"></script>
    <script src="/js/hamburger.js"></script>
  </body>
</html>

The HTML in the body is the expected

header.

The html page created from test.md would have written out into /pages/test.html. Because of the image tag, ![]() the page is written to /pages/images/test.html

:~/SquareOne/cms$ lua init.lua markdown/test.md -o
Converted markdown/test.md to /SquareOne/pages/images/test.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions