Moved TOC from sidebar to separate page
This commit is contained in:
parent
3cadb54adc
commit
b67e14bb57
2 changed files with 30 additions and 57 deletions
|
@ -8,20 +8,20 @@
|
||||||
<title>{{ if .EntryTitle }}{{ .EntryTitle }} - {{ end }}{{ .Title }}</title>
|
<title>{{ if .EntryTitle }}{{ .EntryTitle }} - {{ end }}{{ .Title }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<label class="sidebar-switch">
|
{{ if .Entry -}}
|
||||||
<div class="sidebar-symbol">≡</div>
|
<div class="homebtn"><a href="/">home</a></div>
|
||||||
<input type="checkbox" {{- if not .Entry }}checked{{ end }}>
|
|
||||||
<div class="sidebar">
|
|
||||||
{{- range .TOC -}}
|
|
||||||
<div><a href="{{ . }}">{{ . }}</a></div>
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<h1>{{ .EntryTitle }}</h1>
|
<h1>{{ .EntryTitle }}</h1>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{{ .Entry }}
|
{{ .Entry }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{- else -}}
|
||||||
|
<div class="toc">
|
||||||
|
{{- range .TOC -}}
|
||||||
|
<div><a href="{{ . }}">{{ . }}</a></div>
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
{{- end}}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -2,42 +2,23 @@ body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
justify-content: left;
|
align-items: center;
|
||||||
align-items: top;
|
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
}
|
}
|
||||||
.sidebar-symbol {
|
a:hover { text-decoration: underline; }
|
||||||
margin-left: .5rem;
|
|
||||||
margin-top: .5rem;
|
|
||||||
width: 2rem;
|
|
||||||
height: 2rem;
|
|
||||||
font-size: 1.8rem;
|
|
||||||
font-family: monospace;
|
|
||||||
text-align: center;
|
|
||||||
user-select: none;
|
|
||||||
cursor: pointer;
|
|
||||||
pointer-events: all;
|
|
||||||
}
|
|
||||||
.sidebar-switch { pointer-events: none; }
|
|
||||||
.sidebar-switch > input { display: none; }
|
|
||||||
.sidebar-switch > .sidebar { display: none; }
|
|
||||||
.sidebar-switch > input:checked + .sidebar { display: flex; }
|
|
||||||
.sidebar {
|
|
||||||
flex-direction: column;
|
|
||||||
pointer-events: all;
|
|
||||||
width: max-content;
|
|
||||||
padding: 1rem;
|
|
||||||
gap: .25rem;
|
|
||||||
}
|
|
||||||
a {
|
a {
|
||||||
color: black;
|
color: black;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
a:hover { text-decoration: underline; }
|
|
||||||
|
.homebtn {
|
||||||
|
position: absolute;
|
||||||
|
top: 1rem;
|
||||||
|
left: 1rem;
|
||||||
|
}
|
||||||
.main {
|
.main {
|
||||||
padding-right: 2rem;
|
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -51,34 +32,26 @@ a:hover { text-decoration: underline; }
|
||||||
.main > h1 {
|
.main > h1 {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.content { white-space: pre-line; }
|
.content { white-space: pre-line; }
|
||||||
|
|
||||||
@media only screen and (max-width: 750px) {
|
.toc {
|
||||||
body {
|
box-sizing: border-box;
|
||||||
flex-direction: column;
|
padding: 2rem;
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.sidebar-symbol {
|
|
||||||
margin-left: unset;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.sidebar-switch {
|
|
||||||
width: 90vw;
|
|
||||||
background-color: white;
|
|
||||||
}
|
|
||||||
.sidebar {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: max-content;
|
}
|
||||||
padding: 1rem 0;
|
|
||||||
gap: .4rem;
|
@media only screen and (max-width: 750px) {
|
||||||
}
|
|
||||||
.main {
|
.main {
|
||||||
margin-top: .5rem;
|
margin-top: 4rem;
|
||||||
padding-right: 0;
|
|
||||||
}
|
}
|
||||||
.main > h1, .content {
|
.main > h1, .content {
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
}
|
}
|
||||||
|
.homebtn {
|
||||||
|
left: unset;
|
||||||
|
right: 1rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue