aboutsummaryrefslogtreecommitdiff
path: root/template.html
blob: 366d7d9d44cee8f7a6385521fed09ca8dad52e54 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>$title$</title>
    <link rel="stylesheet" href="./pandoc.css">
    $if(toc)$
    <style>
      /* Container for positioning */
      .container {
        position: relative;
        margin: 0 auto;
      }

      /* Main content stays the same as original */
      .content {
        margin: auto;
        max-width: 42em;
        padding: 0em;
      }

      /* Sidebar floats to the right of the content */
      .sidebar {
        position: fixed;
        top: 2em;
        left: calc(50% + 22em); /* 50% + half of content width + small gap */
        width: 250px;
        height: fit-content;
        padding: 1em;
        background: #f8f8f8;
        border-left: 1px solid #eee;
        border-radius: 4px;
      }

      .toc {
        font-size: 0.9em;
      }

      .toc h3 {
        margin-top: 0;
        font-size: 1.2em;
        color: #333;
      }

      .toc ul {
        list-style: none;
        padding-left: 1em;
        margin: 0.5em 0;
      }

      .toc li {
        margin: 0.5em 0;
        line-height: 1.4;
      }

      .toc a {
        color: #666;
        text-decoration: none;
        transition: color 0.2s;
      }

      .toc a:hover {
        color: #0645ad;
      }

      @media only screen and (max-width: 1200px) {
        .sidebar {
          display: none;
        }
      }
    </style>
    $endif$
  </head>
  <body>
    <div class="container">
      <main class="content">
        <a href="..">« Back</a>
        <h1>$title$</h1>
        $body$
      </main>
      $if(toc)$
      <nav class="sidebar">
        <div class="toc">
          <h3>Table of Contents</h3>
          $toc$
        </div>
      </nav>
      $endif$
    </div>
  </body>
</html>