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