mfashby.net

Website mfashby.net
git clone git://code.mfashby.net:/mfashby.net
Log | Files | Refs | Submodules | README

main.shtml (2050B)


      1 <!DOCTYPE html>
      2 <html lang="en-GB">
      3   <head>
      4     <meta charset="utf-8">
      5     <meta name="viewport" content="width=device-width, initial-scale=1">
      6     <meta name="author" content="$page.author">
      7     <meta name="description" content="$page.description">
      8     <title :text="$page.title.suffix('|', $site.title)"></title>
      9     <link rel="stylesheet" href="$site.asset('css/style.css').link()">
     10     <link rel="stylesheet" href="$site.asset('css/fonts.css').link()">
     11     <link rel="alternate" type="application/rss+xml" title="RSS" href="/index.xml">
     12   </head>
     13   <body>
     14     <nav>
     15       <ul class="menu">
     16         <li><a href="/posts">home</a></li>
     17         <li><a href="/about">about</a></li>
     18         <li><a href="/projects">projects</a></li>
     19         <li><a href="/index.xml">rss</a></li>
     20       </ul>
     21       <hr>
     22     </nav>
     23     <div id="main">
     24       <super>
     25     </div>
     26     <footer>
     27       <div :if="$page.custom.getOr('comments', false)">
     28         <h2>comments</h2>
     29         <div style="visibility: hidden" id="comments">comments go here</div>
     30         <div style="visibility: hidden" id="comment_form">comment form goes here</div>
     31         <script>
     32           let comments = document.getElementById("comments");
     33          let urlParam = new URLSearchParams();
     34          urlParam.append("url", document.location.href);
     35          fetch(document.location.origin + "/api/comment?" + urlParam.toString())
     36               .then((response) => response.text())
     37               .then((data) => {
     38                    comments.innerHTML = data;
     39                    comments.style.visibility = "visible";
     40               });
     41          let form = document.getElementById("comment_form");
     42          fetch(document.location.origin + "/api/form?" + urlParam.toString())
     43               .then((response) => response.text())
     44               .then((data) => {
     45                    form.innerHTML = data;
     46                    form.style.visibility = "visible";
     47               });
     48         </script>
     49         <noscript>Comments disabled without javascript!</noscript>
     50       </div>
     51     </footer>
     52   </body>
     53 </html>