1
0
forked from x/ContextOS
2018-12-18 09:25:25 +08:00

217 lines
4.0 KiB
Cheetah

{{define "head"}}
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
<title>{{option .Meta "page_title"}}</title>
<style>
html, body {
background-color:#d8d8d8;
width:100%;
height:100%;
margin:0px;
}
header {
color:white;
font-size:20px;
font-family:monospace;
text-align:center;
background-color:#0747a6;
width:100%;
position:fixed;
}
header .title {
padding:6px;
}
header .toggle {
cursor:pointer;
width:40px;
position:absolute;
left:20px;
top:5px;
}
header .toggle:hover {
background-color:blue;
}
header .search {
position:absolute;
right:20px;
top:5px;
}
header .search input {
font-size:14px;
background-color:#91d7f5;
padding:4px;
width:60px;
}
header .search input:focus {
width:120px;
}
nav {
overflow:auto;
float:left;
}
nav.fixed {
position:fixed;
}
nav>ul {
padding:0;
margin:0;
}
nav>ul>li>div {
cursor:pointer;
font-size:18px;
background-color:green;
padding-left:10px;
padding:5px;
width:100%;
}
nav>ul>li>ul>li {
padding:5px;
}
nav>ul>li>ul>li:hover {
background-color:green;
}
nav>ul>li>ul>li>a {
text-decoration-line:none;
}
nav>ul>li>ul>li .mono {
font-family:monospace;
}
article {
float:right;
}
article h2 {
cursor:alias;
}
article h3 {
cursor:alias;
}
article h4 {
cursor:alias;
}
article table {
border-collapse:collapse;
}
article table caption {
font-weight:bold;
border:2px solid green;
}
article table tr:hover {
background:lightgreen;
}
article table th {
background:lightgreen;
border:2px solid green;
text-align:center;
padding:0;
}
article table th:hover {
background-color:red;
cursor:pointer;
}
article table td {
border:2px solid green;
text-align:center;
padding:3px;
}
article table td:hover {
background-color:red;
}
article pre {
color:white;
background-color:#272822;
overflow:scroll;
padding:5px;
border:solid 2px green;
border-left:solid 4px green;
max-width:800px;
margin:0;
font-size:14px;
line-height:16px;
}
article div.number1 {
color:#ff9800;
font-family:monospace;
background-color:#272822;
text-align:right;
padding:5px 0;
border:solid green 2px;
float:left;
}
article div.number1 div {
padding: 0 5px;
}
article div.number1 div:hover {
cursor:alias;
background-color:red;
}
footer {
color:white;
font-size:20px;
font-family:monospace;
text-align:center;
background-color:red;
text-align:center;
vertical-align:middle;
clear:both;
}
footer .title {
padding:6px;
}
</style>
</head>
<body>
{{end}}
{{define "header"}}
<header>
<div class="toggle" onclick="action(event, 'toggle_nav')">三</div>
<div class="search"><input type="text" placeholder="搜索"></div>
<div class="title">shylinux 天行健,君子以自强不息</div>
</header>
{{end}}
{{define "list"}}
<nav>
<ul>
<li><div onclick="action(event, 'toggle_list')">文档</div>
<ul class="list" hidden>
{{range $i, $l := table .}}
<li>
<a href="?wiki_favor={{index $l "file"}}">{{index $l "file"}}</a><br/>
<span class="mono"> {{index $l "time"}} </span>
</li>
{{end}}
</ul>
</li>
<li><div onclick="action(event, 'toggle_list')">目录</div>
<ul class="menu"></ul>
</li>
<li><div onclick="action(event, 'toggle_list')">链接</div>
<ul class="link" hidden></ul>
</li>
</ul>
</nav>
{{end}}
{{define "text"}}
<article>{{result .|meta|unescape}}</article>
{{end}}
{{define "footer"}}
<footer><div class="title">shycontext 地势坤,君子以厚德载物</div></footer>
{{end}}
{{define "tail"}}
<script src="/librarys/context.js"></script>
<script src="/librarys/wiki.js"></script>
</body>
{{end}}