997 lines
31 KiB
Go Template
997 lines
31 KiB
Go Template
{{ define "page.gohtml" }}
|
||
<!DOCTYPE html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>{{ if .SocialMetadata }}{{ if .SocialMetadata.Title }}{{ .SocialMetadata.Title }}{{ else }}{{ .Title }}{{ end }}{{ else }}{{ .Title }}{{ end }} · {{ .WikiName }}</title>
|
||
{{ template "social-metadata" . }}
|
||
<link rel="stylesheet" href="/static/css/main.css">
|
||
<link rel="stylesheet" href="/static/css/modes.css">
|
||
|
||
<link rel="stylesheet" href="/static/css/theme/base.css">
|
||
<link rel="stylesheet" href="/static/css/content-viewer.css">
|
||
<link rel="stylesheet" href="/static/css/city-graph.css">
|
||
<link rel="stylesheet" href="{{ .ThemeCSS }}">
|
||
{{ if .IsHome }}<link rel="stylesheet" href="/static/css/home.css?v=13">{{ end }}
|
||
<script defer src="/static/js/content-viewer.js"></script>
|
||
<script defer src="/static/js/viewer-shortcuts.js"></script>
|
||
{{ if eq .ContentView.Kind "code" }}
|
||
<script type="module" src="/static/vendor/codemirror/editor.bundle.js?v=command-ux-1"></script>
|
||
<link rel="stylesheet" href="/static/vendor/codemirror/editor.css">
|
||
{{ end }}
|
||
</head>
|
||
|
||
<body class="mode-page {{ if .IsHome }}is-home-page{{ end }}"{{ if .IsHome }} style="--home-glass-opacity:{{ .HomeGlassOpacity }}%"{{ end }}>
|
||
{{ if and .IsHome .HomeWallpaperURL }}<img class="home-wallpaper" src="{{ .HomeWallpaperURL }}" alt="" aria-hidden="true" decoding="async" fetchpriority="high" style="opacity:{{ .HomeWallpaperOpacity }}">{{ end }}
|
||
|
||
<header class="topbar">
|
||
|
||
<div class="brand">
|
||
<a href="/">{{ .WikiName }}</a>
|
||
</div>
|
||
|
||
<form class="topbar-search" action="/v/search" method="get">
|
||
<input type="hidden" name="scope" value="{{ if .IsHome }}/{{ else if .Path }}{{ .Path }}{{ else }}/{{ end }}">
|
||
<input name="q" placeholder="{{ if .IsHome }}{{ T "search.global_placeholder" }}{{ else }}{{ T "search.folder_placeholder" }}{{ end }}" aria-label="{{ if .IsHome }}{{ T "search.global_placeholder" }}{{ else }}{{ T "search.folder_placeholder" }}{{ end }}">
|
||
</form>
|
||
|
||
<nav>
|
||
{{ range .NavItems }}
|
||
<a href="{{ .ResolvedHref }}">{{ .Label }}</a>
|
||
{{ end }}
|
||
</nav>
|
||
|
||
{{ template "auth-menu" . }}</header>
|
||
|
||
<main class="container">
|
||
{{ if .IsHome }}{{ template "home-bookmarks" . }}{{ end }}
|
||
|
||
<section>
|
||
|
||
<div class="breadcrumb-bar">
|
||
|
||
{{ if ne .Path "/" }}
|
||
<nav class="breadcrumbs" aria-label="{{ T "viewer.breadcrumbs" }}">
|
||
<a href="/">
|
||
/
|
||
</a>
|
||
|
||
{{ range .Breadcrumbs }}
|
||
|
||
<span class="breadcrumb-sep">
|
||
/
|
||
</span>
|
||
|
||
<a href="{{ .Path }}">
|
||
{{ .Name }}
|
||
</a>
|
||
|
||
{{ end }}
|
||
|
||
</nav>
|
||
{{ end }}
|
||
|
||
<div class="breadcrumb-actions">
|
||
<div class="children-view-switcher" data-children-view-switcher hidden>
|
||
<button type="button" data-children-view="icon" title="{{ T "children.view_icon" }}" aria-label="{{ T "children.view_icon" }}">▦</button>
|
||
<button type="button" data-children-view="detail" title="{{ T "children.view_detail" }}" aria-label="{{ T "children.view_detail" }}">☷</button>
|
||
<button type="button" data-children-view="list" title="{{ T "children.view_list" }}" aria-label="{{ T "children.view_list" }}">≡</button>
|
||
</div>
|
||
|
||
{{ if .ObjectUUID }}
|
||
{{ if and .SlidesEnabled (eq .ContentView.Kind "html") }}<a class="breadcrumb-action-icon" href="/v/slides{{ .Path }}" title="{{ T "slides.title" }}" aria-label="{{ T "slides.title" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 4h18v12H3zM12 16v5m-5 0 5-5 5 5M8 8h8m-8 4h5"/></svg></a>{{ end }}
|
||
<a class="breadcrumb-action-icon" href="/_/view/print/uuid:{{ .ObjectUUID }}" title="{{ T "viewer.print" }}" aria-label="{{ T "viewer.print" }}">
|
||
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M7 9V4h10v5M7 17H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2M7 14h10v6H7z"></path></svg>
|
||
</a>
|
||
<a class="breadcrumb-action-icon" href="/e/-{{ .Path }}" title="{{ T "viewer.edit" }}" aria-label="{{ T "viewer.edit" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m4 16-.8 4.8L8 20l11-11-4-4zM13 6l4 4M3 21h18"></path></svg></a>
|
||
<a class="breadcrumb-action-icon" href="/l/uuid:{{ .ObjectUUID }}" title="{{ T "viewer.links" }}" aria-label="{{ T "viewer.links" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.1.1l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1M14 11a5 5 0 0 0-7.1-.1l-2 2a5 5 0 0 0 7.1 7.1l1.1-1.1"></path></svg></a>
|
||
<a class="breadcrumb-action-icon" href="/v/plain{{ .Path }}" title="{{ T "viewer.raw" }}" aria-label="{{ T "viewer.raw" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m8 9-4 3 4 3M16 9l4 3-4 3M14 5l-4 14"></path></svg></a>
|
||
<a class="breadcrumb-action-icon" href="/v/markdown{{ .Path }}" title="{{ T "viewer.markdown" }}" aria-label="{{ T "viewer.markdown" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 5h18v14H3zM6 15V9l3 3 3-3v6m3-3h3m-1.5-1.5L18 12l-1.5 1.5"></path></svg></a>
|
||
<button type="button" class="breadcrumb-action-icon" data-viewer-delete data-object-uuid="{{ .ObjectUUID }}" title="{{ T "children.delete_selected" }}" aria-label="{{ T "children.delete_selected" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 7h14M9 7V4h6v3m-8 0 1 13h8l1-13M10 11v6m4-6v6"></path></svg></button>
|
||
{{ if and .SocialMetadata .SocialMetadata.URL }}<a class="breadcrumb-action-icon" data-share-x="true" href="https://twitter.com/intent/tweet?url={{ .SocialMetadata.URL | urlquery }}&text={{ .SocialMetadata.ShareText | urlquery }}" target="_blank" rel="noopener noreferrer" title="{{ T "viewer.share" }}" aria-label="{{ T "viewer.share" }}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18.9 2H22l-6.8 7.8L23.2 22h-6.3l-4.9-6.4L2.8 2h6.5l4.5 5.9z"></path></svg></a>{{ end }}
|
||
<div class="content-info" tabindex="0" aria-label="{{ T "viewer.document_info" }}">
|
||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
||
<circle cx="12" cy="12" r="9"></circle>
|
||
<path d="M12 10.5v6"></path>
|
||
<circle class="content-info-dot" cx="12" cy="7.5" r=".75"></circle>
|
||
</svg>
|
||
<div class="content-info-tooltip" role="tooltip">
|
||
<dl>
|
||
<div>
|
||
<dt>{{ T "viewer.filename" }}</dt>
|
||
<dd>{{ if .ContentView.Filename }}{{ .ContentView.Filename }}{{ else }}—{{ end }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>{{ T "viewer.mime_type" }}</dt>
|
||
<dd>{{ .ContentView.ContentType }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>{{ T "viewer.adapter" }}</dt>
|
||
<dd>{{ .ContentView.AdapterID }}</dd>
|
||
</div>
|
||
<div>
|
||
<dt>{{ T "viewer.size" }}</dt>
|
||
<dd>{{ .ContentView.SizeBytes }} bytes</dd>
|
||
</div>
|
||
<div>
|
||
<dt>{{ T "viewer.object_uuid" }}</dt>
|
||
<dd><code>{{ .ContentView.ObjectUUID }}</code></dd>
|
||
</div>
|
||
<div>
|
||
<dt>{{ T "viewer.revision_uuid" }}</dt>
|
||
<dd><code>{{ .ContentView.RevisionUUID }}</code></dd>
|
||
</div>
|
||
<div>
|
||
<dt>{{ T "viewer.document_sha256" }}</dt>
|
||
<dd><code>{{ .ContentView.DocumentHash }}</code></dd>
|
||
</div>
|
||
</dl>
|
||
</div>
|
||
</div>
|
||
{{ end }}
|
||
</div>
|
||
|
||
</div>
|
||
|
||
{{ if .CitySpots }}<nav class="city-localities" aria-label="{{ T "city.localities" }}"><span>{{ if gt (len .CitySpots) 1 }}{{ T "city.magic_page" }}{{ else }}{{ T "city.spot" }}{{ end }}</span>{{ range .CitySpots }}<a href="/v/city/p/{{ .SpotName }}">{{ .DisplayTitle }}</a>{{ end }}</nav>{{ end }}
|
||
{{ if .GovernanceEndpoint }}{{ template "city-governance" . }}{{ end }}
|
||
|
||
<article class="page-html">
|
||
{{ if eq .ContentView.Kind "html" }}
|
||
{{ .RenderedHTML }}
|
||
{{ else if eq .ContentView.Kind "excalidraw" }}
|
||
{{ if .ContentView.ExcalidrawValid }}
|
||
<div class="excalidraw-plugin-host" data-excalidraw-plugin-host>
|
||
<iframe
|
||
class="excalidraw-plugin-frame"
|
||
data-excalidraw-plugin
|
||
src="/_/adaptor/excalidraw/?url={{ .ContentView.RawURL | urlquery }}"
|
||
sandbox="allow-scripts allow-same-origin"
|
||
referrerpolicy="no-referrer"
|
||
title="{{ .ContentView.Filename }}"
|
||
></iframe>
|
||
<div class="excalidraw-viewer" data-excalidraw-viewer data-excalidraw-fallback hidden>
|
||
<div class="excalidraw-toolbar">
|
||
<button type="button" data-excalidraw-fit>{{ T "viewer.fit_screen" }}</button>
|
||
<span>{{ .ContentView.ExcalidrawElements }} {{ T "viewer.elements" }}</span>
|
||
</div>
|
||
<canvas data-excalidraw-canvas tabindex="0" aria-label="{{ .ContentView.Filename }}"></canvas>
|
||
<textarea data-excalidraw-source hidden>{{ .ContentView.Text }}</textarea>
|
||
</div>
|
||
</div>
|
||
{{ else }}
|
||
<p class="muted">{{ .ContentView.ParseError }}</p>
|
||
<pre class="content-code"><code>{{ .ContentView.Text }}</code></pre>
|
||
{{ end }}
|
||
{{ else if eq .ContentView.Kind "csv" }}
|
||
<div class="csv-viewer" role="region" aria-label="{{ .ContentView.Filename }}" tabindex="0">
|
||
<table class="csv-table">
|
||
{{ range $rowIndex, $row := .ContentView.CSVRows }}
|
||
{{ if eq $rowIndex 0 }}<thead><tr>{{ range $row }}<th scope="col">{{ . }}</th>{{ end }}</tr></thead><tbody>{{ else }}<tr>{{ range $row }}<td>{{ . }}</td>{{ end }}</tr>{{ end }}
|
||
{{ end }}
|
||
{{ if .ContentView.CSVRows }}</tbody>{{ end }}
|
||
</table>
|
||
</div>
|
||
{{ if .ContentView.ParseError }}<p class="muted">{{ .ContentView.ParseError }}</p>{{ end }}
|
||
{{ if .ContentView.CSVTruncated }}<p class="muted">{{ T "viewer.csv_truncated" }}</p>{{ end }}
|
||
{{ else if eq .ContentView.Kind "json" }}
|
||
<div class="json-structure-viewer" data-json-viewer data-json-url="{{ .ContentView.JSONURL }}">
|
||
<div class="json-structure-status muted" data-json-status>Loading…</div>
|
||
<div data-json-root></div>
|
||
</div>
|
||
{{ else if eq .ContentView.Kind "code" }}
|
||
<div class="content-code-viewer">
|
||
<textarea id="code-viewer-source" hidden>{{ .ContentView.Text }}</textarea>
|
||
<div
|
||
id="code-viewer"
|
||
class="content-code-editor"
|
||
data-language="{{ .ContentView.Language }}"
|
||
data-window-url="{{ .ContentView.WindowURL }}"
|
||
data-next-offset="{{ .ContentView.NextOffset }}"
|
||
></div>
|
||
<aside id="code-minimap" class="content-code-minimap" aria-hidden="true"></aside>
|
||
{{ if .ContentView.Windowed }}<div class="content-window-sentinel muted" data-content-window-sentinel>Loading…</div>{{ end }}
|
||
</div>
|
||
{{ else if eq .ContentView.Kind "image" }}
|
||
<button class="lightbox-trigger" type="button" data-lightbox-open aria-label="{{ T "viewer.open_fullscreen" }}">
|
||
<img class="content-image" src="{{ .ContentView.RawURL }}" alt="{{ .ContentView.Filename }}">
|
||
</button>
|
||
<dialog class="content-lightbox" data-lightbox>
|
||
<button type="button" data-lightbox-close aria-label="{{ T "viewer.close" }}">×</button>
|
||
<img src="{{ .ContentView.RawURL }}" alt="{{ .ContentView.Filename }}">
|
||
</dialog>
|
||
{{ else if eq .ContentView.Kind "audio" }}
|
||
<div class="media-player audio-player" data-media-player>
|
||
<audio class="content-media" controls preload="metadata" src="{{ .ContentView.RawURL }}"></audio>
|
||
<div class="media-player-toolbar">
|
||
<span data-media-time>0:00 / 0:00</span>
|
||
<label>{{ T "viewer.speed" }}
|
||
<select data-playback-rate><option>.5×</option><option>.75×</option><option selected>1×</option><option>1.25×</option><option>1.5×</option><option>2×</option></select>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
{{ else if eq .ContentView.Kind "video" }}
|
||
<div class="media-player video-player" data-media-player>
|
||
<video class="content-media" controls playsinline preload="metadata" src="{{ .ContentView.RawURL }}"></video>
|
||
<div class="media-player-toolbar">
|
||
<span data-media-time>0:00 / 0:00</span>
|
||
<label>{{ T "viewer.speed" }}
|
||
<select data-playback-rate><option>.5×</option><option>.75×</option><option selected>1×</option><option>1.25×</option><option>1.5×</option><option>2×</option></select>
|
||
</label>
|
||
<button type="button" data-media-pip>{{ T "viewer.pip" }}</button>
|
||
<button type="button" data-media-fullscreen>{{ T "viewer.fullscreen" }}</button>
|
||
</div>
|
||
</div>
|
||
{{ else if eq .ContentView.Kind "pdf" }}
|
||
<div class="pdf-toolbar">
|
||
<button type="button" data-pdf-prev aria-label="{{ T "viewer.previous" }}">←</button>
|
||
<span data-pdf-status>1 / {{ if .ContentView.PDFPages }}{{ .ContentView.PDFPages }}{{ else }}?{{ end }}</span>
|
||
<span data-projection-status aria-live="polite">{{ if eq .ContentView.MetadataStatus "pending" }}{{ T "viewer.metadata_pending" }}{{ else if eq .ContentView.MetadataStatus "failed" }}{{ T "viewer.metadata_failed" }}{{ else if eq .ContentView.MetadataStatus "unavailable" }}{{ T "viewer.metadata_unavailable" }}{{ end }}</span>
|
||
<button type="button" data-projection-retry hidden>{{ T "config.retry" }}</button>
|
||
<button type="button" data-pdf-next aria-label="{{ T "viewer.next" }}">→</button>
|
||
<a href="{{ .ContentView.RawURL }}" target="_blank" rel="noopener">{{ T "viewer.open_pdf" }}</a>
|
||
<a href="{{ .ContentView.RawURL }}" download="{{ .ContentView.Filename }}">{{ T "viewer.download" }}</a>
|
||
</div>
|
||
<div
|
||
class="content-pdf"
|
||
data-pdf-viewer
|
||
data-revision="{{ .ContentView.RevisionUUID }}"
|
||
data-pages="{{ .ContentView.PDFPages }}"
|
||
data-metadata-url="/v/pdf-page?rev={{ .ContentView.RevisionUUID }}&metadata=1"
|
||
data-loading-label="{{ T "viewer.metadata_pending" }}"
|
||
data-failed-label="{{ T "viewer.metadata_failed" }}" data-unavailable-label="{{ T "viewer.metadata_unavailable" }}" data-truncated-label="{{ T "viewer.archive_truncated" }}"
|
||
>
|
||
<img data-pdf-image src="/v/pdf-page?rev={{ .ContentView.RevisionUUID }}&page=1" alt="{{ .ContentView.Filename }}">
|
||
</div>
|
||
{{ else if eq .ContentView.Kind "archive" }}
|
||
<div class="archive-viewer" data-archive-metadata data-metadata-url="{{ .ContentView.MetadataURL }}" data-metadata-status="{{ .ContentView.MetadataStatus }}" data-loading-label="{{ T "viewer.metadata_pending" }}" data-failed-label="{{ T "viewer.metadata_failed" }}" data-unavailable-label="{{ T "viewer.metadata_unavailable" }}" data-truncated-label="{{ T "viewer.archive_truncated" }}">
|
||
<div class="archive-toolbar">
|
||
<a href="?comic=1">{{ T "viewer.open_comic" }}</a>
|
||
<a href="{{ .ContentView.RawURL }}" download="{{ .ContentView.Filename }}">{{ T "viewer.download" }}</a>
|
||
</div>
|
||
<p data-projection-status aria-live="polite">{{ if eq .ContentView.MetadataStatus "pending" }}{{ T "viewer.metadata_pending" }}{{ else if eq .ContentView.MetadataStatus "failed" }}{{ T "viewer.metadata_failed" }}{{ else if eq .ContentView.MetadataStatus "unavailable" }}{{ T "viewer.metadata_unavailable" }}{{ else if .ContentView.ParseError }}{{ .ContentView.ParseError }}{{ else if .ContentView.ArchiveTruncated }}{{ len .ContentView.ArchiveEntries }} {{ T "viewer.entry" }} · {{ T "viewer.archive_truncated" }}{{ end }}</p>
|
||
<button type="button" data-projection-retry hidden>{{ T "config.retry" }}</button>
|
||
{{ if .ComicMode }}
|
||
<div
|
||
class="comic-viewer"
|
||
data-comic-viewer
|
||
data-layout="single"
|
||
data-spread-label="{{ T "viewer.spread" }}"
|
||
data-single-label="{{ T "viewer.single_page" }}"
|
||
>
|
||
<div class="comic-controls">
|
||
<button type="button" data-comic-prev aria-label="{{ T "viewer.previous" }}">←</button>
|
||
<button type="button" data-comic-next aria-label="{{ T "viewer.next" }}">→</button>
|
||
<button type="button" data-comic-layout>{{ T "viewer.spread" }}</button>
|
||
<button type="button" data-comic-fit>{{ T "viewer.fit_screen" }}</button>
|
||
<span data-comic-status></span>
|
||
</div>
|
||
<div class="comic-pages" data-comic-pages>
|
||
{{ range .ContentView.ArchiveEntries }}
|
||
{{ if .IsImage }}<img data-comic-page data-src="{{ .URL }}" alt="{{ .Name }}" hidden>{{ end }}
|
||
{{ end }}
|
||
</div>
|
||
</div>
|
||
{{ else }}
|
||
<table class="archive-entries">
|
||
<thead><tr><th>{{ T "viewer.entry" }}</th><th>{{ T "viewer.size" }}</th></tr></thead>
|
||
<tbody data-archive-entries>
|
||
{{ range .ContentView.ArchiveEntries }}
|
||
<tr><td>{{ if .IsDir }}{{ .Name }}{{ else }}<a href="{{ .URL }}">{{ .Name }}</a>{{ end }}</td><td>{{ .Size }}</td></tr>
|
||
{{ end }}
|
||
</tbody>
|
||
</table>
|
||
{{ end }}
|
||
</div>
|
||
{{ else if eq .ContentView.Kind "email" }}
|
||
<article class="email-viewer">
|
||
<dl class="metadata-viewer">
|
||
{{ range .ContentView.Metadata }}<div><dt>{{ .Name }}</dt><dd>{{ .Value }}</dd></div>{{ end }}
|
||
</dl>
|
||
{{ if .ContentView.ParseError }}<p>{{ .ContentView.ParseError }}</p>{{ end }}
|
||
{{ if .ContentView.EmailHTML }}
|
||
<iframe class="email-html-frame" sandbox src="/v/email-html?path={{ .Path }}" title="{{ .ContentView.Filename }}"></iframe>
|
||
{{ else }}
|
||
<pre class="email-body">{{ .ContentView.Text }}</pre>
|
||
{{ end }}
|
||
</article>
|
||
{{ else if eq .ContentView.Kind "metadata" }}
|
||
<div class="binary-metadata-viewer">
|
||
<dl class="metadata-viewer">
|
||
{{ range .ContentView.Metadata }}<div><dt>{{ .Name }}</dt><dd>{{ .Value }}</dd></div>{{ end }}
|
||
</dl>
|
||
{{ if .ContentView.Text }}<pre>{{ .ContentView.Text }}</pre>{{ end }}
|
||
{{ if .ContentView.ParseError }}<p>{{ .ContentView.ParseError }}</p>{{ end }}
|
||
<a href="{{ .ContentView.RawURL }}" download="{{ .ContentView.Filename }}">{{ T "viewer.download" }}</a>
|
||
</div>
|
||
{{ else }}
|
||
<div class="content-download">
|
||
<p>{{ .ContentView.Filename }}</p>
|
||
<a href="{{ .ContentView.RawURL }}" download="{{ .ContentView.Filename }}">{{ T "viewer.download" }}</a>
|
||
</div>
|
||
{{ end }}
|
||
</article>
|
||
|
||
</section>
|
||
|
||
</main>
|
||
|
||
<div
|
||
class="children-context-menu"
|
||
data-children-context-menu
|
||
data-move-prompt="{{ T "children.move_prompt" }}"
|
||
data-delete-confirm="{{ T "children.delete_confirm" }}"
|
||
data-operation-failed="{{ T "children.operation_failed" }}"
|
||
data-context-path="{{ .Path }}"
|
||
data-rename-prompt="{{ T "children.rename_prompt" }}"
|
||
hidden
|
||
>
|
||
<button type="button" data-children-open>{{ T "children.open" }}</button>
|
||
<button type="button" data-children-rename>{{ T "children.rename" }}</button>
|
||
<button type="button" data-children-copy>{{ T "children.copy" }}</button>
|
||
<button type="button" data-children-paste>{{ T "children.paste" }}</button>
|
||
<div class="children-context-group" data-adapter-group>
|
||
<span>{{ T "children.open_with" }}</span>
|
||
<div data-adapter-actions></div>
|
||
</div>
|
||
<button type="button" data-children-move>{{ T "children.move_selected" }}</button>
|
||
<button type="button" data-children-delete>{{ T "children.delete_selected" }}</button>
|
||
</div>
|
||
|
||
<style>
|
||
|
||
.breadcrumb-bar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 1rem;
|
||
margin-bottom: 1rem;
|
||
min-height: 1.75rem;
|
||
}
|
||
|
||
.breadcrumbs {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 0.35rem;
|
||
min-width: 0;
|
||
margin: 0;
|
||
font-family:
|
||
"JetBrains Mono",
|
||
monospace;
|
||
font-size: 0.86rem;
|
||
}
|
||
|
||
.breadcrumbs a {
|
||
text-decoration: none;
|
||
color: var(--link);
|
||
}
|
||
|
||
.breadcrumbs a:hover {
|
||
color: var(--link-hover);
|
||
text-shadow:
|
||
0 0 0.35rem rgba(120,180,255,0.28);
|
||
}
|
||
|
||
.breadcrumb-sep {
|
||
color: var(--muted);
|
||
}
|
||
|
||
.breadcrumb-actions,
|
||
.children-view-switcher {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: .3rem;
|
||
}
|
||
|
||
.children-view-switcher button {
|
||
display: grid;
|
||
place-items: center;
|
||
width: 1.75rem;
|
||
height: 1.75rem;
|
||
padding: 0;
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: .3rem;
|
||
background: transparent;
|
||
color: var(--muted);
|
||
cursor: pointer;
|
||
}
|
||
|
||
.children-view-switcher[hidden] {
|
||
display: none;
|
||
}
|
||
|
||
.children-view-switcher button:hover,
|
||
.children-view-switcher button.active {
|
||
border-color: var(--link);
|
||
color: var(--link);
|
||
}
|
||
|
||
.content-info {
|
||
position: relative;
|
||
flex: 0 0 auto;
|
||
width: 1.45rem;
|
||
height: 1.45rem;
|
||
color: var(--muted);
|
||
cursor: help;
|
||
outline: none;
|
||
}
|
||
|
||
.breadcrumb-action-icon {
|
||
display: grid;
|
||
place-items: center;
|
||
width: 1.45rem;
|
||
height: 1.45rem;
|
||
padding: 0;
|
||
border: 0;
|
||
background: transparent;
|
||
color: var(--muted);
|
||
cursor: pointer;
|
||
}
|
||
|
||
.breadcrumb-action-icon:hover,
|
||
.breadcrumb-action-icon:focus-visible {
|
||
color: var(--link);
|
||
}
|
||
|
||
.breadcrumb-action-icon svg {
|
||
width: 100%;
|
||
height: 100%;
|
||
fill: none;
|
||
stroke: currentColor;
|
||
stroke-linecap: round;
|
||
stroke-linejoin: round;
|
||
stroke-width: 1.6;
|
||
}
|
||
|
||
.content-info > svg {
|
||
display: block;
|
||
width: 100%;
|
||
height: 100%;
|
||
fill: none;
|
||
stroke: currentColor;
|
||
stroke-linecap: round;
|
||
stroke-width: 1.6;
|
||
}
|
||
|
||
.content-info .content-info-dot {
|
||
fill: currentColor;
|
||
stroke: none;
|
||
}
|
||
|
||
.content-info:hover,
|
||
.content-info:focus-visible {
|
||
color: var(--link);
|
||
}
|
||
|
||
.content-info-tooltip {
|
||
position: absolute;
|
||
z-index: 20;
|
||
top: calc(100% + 0.45rem);
|
||
right: 0;
|
||
display: none;
|
||
width: max-content;
|
||
min-width: 18rem;
|
||
max-width: min(32rem, calc(100vw - 2rem));
|
||
padding: 0.75rem 0.85rem;
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: 0.35rem;
|
||
background: var(--input-bg);
|
||
box-shadow: 0 0.6rem 1.5rem rgba(0, 0, 0, 0.24);
|
||
color: var(--fg);
|
||
cursor: default;
|
||
}
|
||
|
||
.content-info:hover .content-info-tooltip,
|
||
.content-info:focus .content-info-tooltip {
|
||
display: block;
|
||
}
|
||
|
||
.content-info-tooltip dl {
|
||
display: grid;
|
||
gap: 0.45rem;
|
||
margin: 0;
|
||
}
|
||
|
||
.content-info-tooltip dl > div {
|
||
display: grid;
|
||
grid-template-columns: 5.5rem minmax(0, 1fr);
|
||
gap: 0.65rem;
|
||
}
|
||
|
||
.content-info-tooltip dt {
|
||
color: var(--muted);
|
||
}
|
||
|
||
.content-info-tooltip dd {
|
||
min-width: 0;
|
||
margin: 0;
|
||
overflow-wrap: anywhere;
|
||
font-family: "JetBrains Mono", monospace;
|
||
font-size: 0.8rem;
|
||
}
|
||
|
||
.children-list ul {
|
||
margin: 0;
|
||
padding-left: 1.2rem;
|
||
}
|
||
|
||
.children-list li {
|
||
margin: 0.15rem 0;
|
||
}
|
||
|
||
.children-icon-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
|
||
gap: .75rem;
|
||
}
|
||
|
||
.children-icon-item {
|
||
display: grid;
|
||
grid-template-rows: 7rem auto;
|
||
gap: .45rem;
|
||
min-width: 0;
|
||
padding: .5rem;
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: .4rem;
|
||
text-decoration: none;
|
||
}
|
||
|
||
.children-preview,
|
||
.children-type-icon {
|
||
position: relative;
|
||
overflow: hidden;
|
||
width: 100%;
|
||
height: 7rem;
|
||
background: var(--input-bg);
|
||
}
|
||
|
||
.children-preview img,
|
||
.children-preview video,
|
||
.children-preview iframe,
|
||
.children-preview canvas {
|
||
display: block;
|
||
width: 100%;
|
||
height: 100%;
|
||
border: 0;
|
||
object-fit: contain;
|
||
pointer-events: none;
|
||
}
|
||
|
||
.children-type-icon {
|
||
display: grid;
|
||
place-items: center;
|
||
color: var(--muted);
|
||
}
|
||
|
||
.children-type-icon svg {
|
||
width: 3.25rem;
|
||
height: 3.25rem;
|
||
fill: none;
|
||
stroke: currentColor;
|
||
stroke-linecap: round;
|
||
stroke-linejoin: round;
|
||
stroke-width: 1.5;
|
||
}
|
||
|
||
.children-type-folder { color: #e8bd62; }
|
||
.children-type-archive { color: #b998dc; }
|
||
.children-type-audio { color: #74c7b8; }
|
||
.children-type-code { color: #79aee8; }
|
||
.children-type-package { color: #d88d78; }
|
||
|
||
.children-preview-badge {
|
||
position: absolute;
|
||
right: .3rem;
|
||
bottom: .3rem;
|
||
padding: .12rem .32rem;
|
||
border-radius: .2rem;
|
||
background: rgba(0, 0, 0, .72);
|
||
color: white;
|
||
font: .66rem "JetBrains Mono", monospace;
|
||
}
|
||
|
||
.children-icon-name {
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.children-entry {
|
||
cursor: pointer;
|
||
}
|
||
|
||
.children-entry.children-selected {
|
||
outline: 2px solid var(--link);
|
||
outline-offset: -2px;
|
||
background: color-mix(in srgb, var(--link) 16%, transparent);
|
||
}
|
||
|
||
.children-view-list .children-entry {
|
||
border-radius: .2rem;
|
||
}
|
||
|
||
.children-context-menu {
|
||
position: fixed;
|
||
z-index: 100;
|
||
min-width: 13rem;
|
||
padding: .35rem;
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: .35rem;
|
||
background: var(--input-bg);
|
||
box-shadow: 0 .6rem 1.5rem rgba(0, 0, 0, .3);
|
||
}
|
||
|
||
.children-context-menu button {
|
||
display: block;
|
||
width: 100%;
|
||
padding: .5rem .7rem;
|
||
border: 0;
|
||
background: transparent;
|
||
color: var(--fg);
|
||
text-align: left;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.children-context-menu button:hover {
|
||
background: color-mix(in srgb, var(--link) 14%, transparent);
|
||
}
|
||
|
||
.children-loading {
|
||
padding: .7rem;
|
||
color: var(--muted);
|
||
}
|
||
|
||
.children-detail {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
}
|
||
|
||
.children-detail th,
|
||
.children-detail td {
|
||
padding: .45rem .6rem;
|
||
border-bottom: 1px solid var(--border-soft);
|
||
text-align: left;
|
||
}
|
||
|
||
.content-code {
|
||
overflow: auto;
|
||
padding: 1rem;
|
||
border: 1px solid var(--border-soft);
|
||
background: var(--input-bg);
|
||
white-space: pre;
|
||
}
|
||
|
||
.excalidraw-viewer {
|
||
display: grid;
|
||
grid-template-rows: auto minmax(24rem, calc(100vh - 14rem));
|
||
overflow: hidden;
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: 0.4rem;
|
||
background: var(--input-bg);
|
||
}
|
||
|
||
.excalidraw-plugin-frame {
|
||
display: block;
|
||
width: 100%;
|
||
min-height: calc(100vh - 12rem);
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: 0.4rem;
|
||
background: var(--input-bg);
|
||
}
|
||
|
||
.excalidraw-plugin-frame[hidden] {
|
||
display: none;
|
||
}
|
||
|
||
.excalidraw-toolbar {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: flex-end;
|
||
gap: 1rem;
|
||
padding: 0.4rem 0.6rem;
|
||
border-bottom: 1px solid var(--border-soft);
|
||
}
|
||
|
||
.excalidraw-viewer canvas {
|
||
width: 100%;
|
||
height: 100%;
|
||
cursor: grab;
|
||
touch-action: none;
|
||
}
|
||
|
||
.excalidraw-viewer canvas:active {
|
||
cursor: grabbing;
|
||
}
|
||
|
||
.content-code-viewer {
|
||
display: grid;
|
||
grid-template-columns: minmax(0, 1fr) 7rem;
|
||
min-height: calc(100vh - 11rem);
|
||
border: 1px solid var(--border-soft);
|
||
background: var(--input-bg);
|
||
}
|
||
|
||
.content-code-editor {
|
||
min-width: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.content-code-editor .cm-editor {
|
||
height: calc(100vh - 11rem);
|
||
}
|
||
|
||
.content-code-editor .cm-scroller {
|
||
overflow: auto;
|
||
}
|
||
|
||
.content-code-minimap {
|
||
position: relative;
|
||
overflow: hidden;
|
||
border-left: 1px solid var(--border-soft);
|
||
background: color-mix(in srgb, var(--input-bg) 92%, var(--fg));
|
||
cursor: pointer;
|
||
user-select: none;
|
||
}
|
||
|
||
.content-code-minimap-line {
|
||
position: absolute;
|
||
left: 0.35rem;
|
||
height: 1px;
|
||
min-width: 2px;
|
||
max-width: calc(100% - 0.7rem);
|
||
background: color-mix(in srgb, var(--fg) 42%, transparent);
|
||
}
|
||
|
||
.content-code-minimap-viewport {
|
||
position: absolute;
|
||
left: 0;
|
||
right: 0;
|
||
min-height: 1rem;
|
||
border: 1px solid color-mix(in srgb, var(--link) 70%, transparent);
|
||
background: color-mix(in srgb, var(--link) 14%, transparent);
|
||
pointer-events: none;
|
||
}
|
||
|
||
.content-image,
|
||
.content-media {
|
||
display: block;
|
||
max-width: 100%;
|
||
max-height: calc(100vh - 12rem);
|
||
margin: auto;
|
||
}
|
||
|
||
.content-pdf {
|
||
display: grid;
|
||
place-items: start center;
|
||
overflow: auto;
|
||
width: 100%;
|
||
height: calc(100vh - 10rem);
|
||
border: 1px solid var(--border-soft);
|
||
background: #303034;
|
||
}
|
||
|
||
.content-pdf img {
|
||
display: block;
|
||
max-width: 100%;
|
||
height: auto;
|
||
}
|
||
|
||
.pdf-toolbar {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
justify-content: flex-end;
|
||
gap: 1rem;
|
||
margin-bottom: .5rem;
|
||
}
|
||
|
||
.archive-toolbar {
|
||
display: flex;
|
||
gap: 1rem;
|
||
margin-bottom: 1rem;
|
||
}
|
||
|
||
.csv-viewer {
|
||
max-height: min(70vh, 52rem);
|
||
overflow: auto;
|
||
border: 1px solid var(--border-soft);
|
||
border-radius: 0.4rem;
|
||
}
|
||
|
||
.csv-table {
|
||
width: max-content;
|
||
min-width: 100%;
|
||
border-collapse: collapse;
|
||
font-size: 0.9rem;
|
||
}
|
||
|
||
.csv-table th,
|
||
.csv-table td {
|
||
max-width: 32rem;
|
||
padding: 0.35rem 0.55rem;
|
||
border-right: 1px solid var(--border-soft);
|
||
border-bottom: 1px solid var(--border-soft);
|
||
overflow-wrap: anywhere;
|
||
text-align: left;
|
||
vertical-align: top;
|
||
}
|
||
|
||
.csv-table th {
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 1;
|
||
background: var(--panel);
|
||
}
|
||
|
||
.archive-entries {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
}
|
||
|
||
.archive-entries th,
|
||
.archive-entries td {
|
||
padding: .45rem .6rem;
|
||
border-bottom: 1px solid var(--border-soft);
|
||
text-align: left;
|
||
}
|
||
|
||
.comic-viewer {
|
||
position: relative;
|
||
background: #111;
|
||
color: #eee;
|
||
}
|
||
|
||
.comic-controls {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: .5rem;
|
||
padding: .5rem;
|
||
}
|
||
|
||
.comic-pages {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: .25rem;
|
||
min-height: calc(100vh - 15rem);
|
||
}
|
||
|
||
.comic-pages img {
|
||
display: block;
|
||
max-width: min(100%, 90rem);
|
||
max-height: calc(100vh - 16rem);
|
||
width: auto;
|
||
height: auto;
|
||
object-fit: contain;
|
||
}
|
||
|
||
.comic-pages img[hidden] {
|
||
display: none;
|
||
}
|
||
|
||
.comic-viewer[data-layout="spread"] .comic-pages img {
|
||
max-width: calc(50% - .125rem);
|
||
}
|
||
|
||
.comic-viewer:fullscreen {
|
||
display: grid;
|
||
grid-template-rows: auto minmax(0, 1fr);
|
||
width: 100vw;
|
||
height: 100vh;
|
||
}
|
||
|
||
.comic-viewer:fullscreen .comic-pages {
|
||
min-height: 0;
|
||
height: 100%;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.comic-viewer:fullscreen .comic-pages img {
|
||
max-height: 100%;
|
||
}
|
||
|
||
.metadata-viewer {
|
||
display: grid;
|
||
gap: .4rem;
|
||
}
|
||
|
||
.metadata-viewer > div {
|
||
display: grid;
|
||
grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr);
|
||
gap: 1rem;
|
||
padding-bottom: .4rem;
|
||
border-bottom: 1px solid var(--border-soft);
|
||
}
|
||
|
||
.metadata-viewer dt {
|
||
color: var(--muted);
|
||
}
|
||
|
||
.metadata-viewer dd {
|
||
margin: 0;
|
||
overflow-wrap: anywhere;
|
||
}
|
||
|
||
.email-body {
|
||
overflow: auto;
|
||
padding: 1rem;
|
||
white-space: pre-wrap;
|
||
}
|
||
|
||
.email-html-frame {
|
||
width: 100%;
|
||
min-height: calc(100vh - 16rem);
|
||
border: 1px solid var(--border-soft);
|
||
background: white;
|
||
}
|
||
|
||
.json-structure-viewer { border:1px solid var(--border-soft);border-radius:.4rem;padding:.75rem;min-height:12rem;overflow:auto }
|
||
.json-structure-status { margin-bottom:.5rem }
|
||
.json-structure-item { display:grid;grid-template-columns:1.25rem minmax(8rem,auto) minmax(0,1fr) auto;align-items:start;gap:.45rem;padding:.18rem 0 .18rem .4rem;border-left:1px solid var(--border-soft) }
|
||
.json-structure-toggle { border:0;background:transparent;color:var(--link);padding:0;cursor:pointer }
|
||
.json-structure-key { color:var(--link);overflow-wrap:anywhere }
|
||
.json-structure-value { white-space:pre-wrap;overflow-wrap:anywhere }
|
||
.json-structure-kind { color:var(--muted);font-size:.78rem }
|
||
.json-structure-children { grid-column:2 / -1 }
|
||
.json-structure-more { margin:.45rem 0 .45rem 1.5rem }
|
||
|
||
|
||
.is-root-page .breadcrumbs {
|
||
display: none;
|
||
}
|
||
|
||
|
||
.is-home-page .breadcrumbs {
|
||
display: none;
|
||
}
|
||
|
||
</style>
|
||
|
||
{{ if eq .ContentView.Kind "code" }}
|
||
<script>
|
||
window.addEventListener("DOMContentLoaded", () => {
|
||
const source = document.getElementById("code-viewer-source")
|
||
const target = document.getElementById("code-viewer")
|
||
const minimap = document.getElementById("code-minimap")
|
||
if (!source || !target || !minimap || !window.PagesWikiEditor) return
|
||
const viewer = window.PagesWikiEditor.createViewer(
|
||
target,
|
||
source.value,
|
||
target.dataset.language || "text",
|
||
minimap
|
||
)
|
||
const sentinel = document.querySelector("[data-content-window-sentinel]")
|
||
if (!sentinel || !target.dataset.windowUrl) return
|
||
let loading = false
|
||
const observer = new IntersectionObserver(async entries => {
|
||
if (!entries.some(entry => entry.isIntersecting) || loading) return
|
||
const offset = Number(target.dataset.nextOffset || 0)
|
||
if (!offset) { observer.disconnect(); sentinel.remove(); return }
|
||
loading = true
|
||
try {
|
||
const url = new URL(target.dataset.windowUrl, location.href)
|
||
url.searchParams.set("offset", String(offset))
|
||
url.searchParams.set("limit", String(128 * 1024))
|
||
const response = await fetch(url, {credentials: "same-origin"})
|
||
if (!response.ok) throw new Error(`HTTP ${response.status}`)
|
||
const data = await response.json()
|
||
viewer.dispatch({changes:{from:viewer.state.doc.length,insert:data.text}})
|
||
target.dataset.nextOffset = data.truncated ? String(data.next_offset) : ""
|
||
sentinel.textContent = data.truncated ? "Loading…" : ""
|
||
if (!data.truncated) { observer.disconnect(); sentinel.remove() }
|
||
} catch (error) {
|
||
sentinel.textContent = error.message
|
||
observer.disconnect()
|
||
} finally { loading = false }
|
||
}, {rootMargin:"900px 0px"})
|
||
observer.observe(sentinel)
|
||
})
|
||
</script>
|
||
{{ end }}
|
||
|
||
{{ template "home-appearance" . }}{{ template "home-palette" . }}</body>
|
||
</html>
|
||
{{ end }}
|