64 lines
3.3 KiB
HTML
64 lines
3.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>{{.Title}}</title>
|
|
<link rel="stylesheet" href="/_/style.css" />
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<nav class="breadcrumb">
|
|
<a href="/">~</a>
|
|
{{range .Crumbs}}<span class="sep">/</span
|
|
><a href="{{.URL}}">{{.Name}}</a>{{end}}
|
|
</nav>
|
|
{{if .CanEdit}}<a class="edit-btn" href="?edit">EDIT</a>{{end}}
|
|
</header>
|
|
<main>
|
|
{{if .EditMode}}
|
|
<form class="edit-form" method="POST" action="{{.PostURL}}">
|
|
<div class="editor-toolbar">
|
|
<button type="button" class="btn-tool" data-action="bold" title="Bold">**</button>
|
|
<button type="button" class="btn-tool" data-action="italic" title="Italic">*</button>
|
|
<span class="toolbar-sep"></span>
|
|
<button type="button" class="btn-tool" data-action="h1" title="Heading 1">#</button>
|
|
<button type="button" class="btn-tool" data-action="h2" title="Heading 2">##</button>
|
|
<button type="button" class="btn-tool" data-action="h3" title="Heading 3">###</button>
|
|
<span class="toolbar-sep"></span>
|
|
<button type="button" class="btn-tool" data-action="code" title="Inline code">`</button>
|
|
<button type="button" class="btn-tool" data-action="codeblock" title="Code block">```</button>
|
|
<span class="toolbar-sep"></span>
|
|
<button type="button" class="btn-tool" data-action="link" title="Link">[]</button>
|
|
<button type="button" class="btn-tool" data-action="quote" title="Blockquote">></button>
|
|
<button type="button" class="btn-tool" data-action="ul" title="Unordered list">-</button>
|
|
<button type="button" class="btn-tool" data-action="ol" title="Ordered list">1.</button>
|
|
<button type="button" class="btn-tool" data-action="hr" title="Horizontal rule">---</button>
|
|
</div>
|
|
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
|
|
<div class="form-actions">
|
|
<a class="btn-cancel" href="{{.PostURL}}">CANCEL</a>
|
|
<button class="btn-save" type="submit">SAVE</button>
|
|
</div>
|
|
</form>
|
|
<script src="/_/editor.js"></script>
|
|
{{else}} {{if .Content}}
|
|
<div class="content">{{.Content}}</div>
|
|
{{end}} {{if .Entries}}
|
|
<div class="listing">
|
|
<div class="listing-header">Contents</div>
|
|
{{range .Entries}}
|
|
<div class="listing-item">
|
|
<span class="icon">{{.Icon}}</span>
|
|
<a href="{{.URL}}">{{.Name}}</a>
|
|
<span class="meta">{{.Meta}}</span>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
{{else if not .Content}}
|
|
<p class="empty">Empty folder — <a href="?edit">[CREATE]</a></p>
|
|
{{end}} {{end}}
|
|
</main>
|
|
</body>
|
|
</html>
|