glance/internal/assets/templates/page.html

77 lines
3.3 KiB
HTML
Raw Normal View History

2024-04-27 21:10:24 +02:00
{{ template "document.html" . }}
2024-08-07 05:05:10 +02:00
{{ define "document-title" }}{{ .Page.Title }}{{ end }}
2024-04-27 21:10:24 +02:00
{{ define "document-head-before" }}
<script>
const pageData = {
slug: "{{ .Page.Slug }}",
2024-08-05 15:08:16 +02:00
baseURL: "{{ .App.Config.Server.BaseURL }}",
2024-04-27 21:10:24 +02:00
};
</script>
{{ end }}
2024-08-05 00:40:46 +02:00
{{ define "document-root-attrs" }}class="{{ if .App.Config.Theme.Light }}light-scheme {{ end }}{{ if ne "" .Page.Width }}page-width-{{ .Page.Width }}{{ end }}"{{ end }}
2024-08-05 15:08:16 +02:00
2024-04-29 17:47:18 +02:00
{{ define "document-head-after" }}
{{ template "page-style-overrides.gotmpl" . }}
{{ if ne "" .App.Config.Theme.CustomCSSFile }}
<link rel="stylesheet" href="{{ .App.Config.Theme.CustomCSSFile }}?v={{ .App.Config.Server.StartedAt.Unix }}">
{{ end }}
{{ end }}
2024-04-27 21:10:24 +02:00
{{ define "navigation-links" }}
{{ range .App.Config.Pages }}
2024-08-05 15:08:16 +02:00
<a href="{{ $.App.Config.Server.BaseURL }}/{{ .Slug }}" class="nav-item{{ if eq .Slug $.Page.Slug }} nav-item-current{{ end }}">{{ .Title }}</a>
2024-04-27 21:10:24 +02:00
{{ end }}
{{ end }}
{{ define "document-body" }}
2024-08-05 13:00:20 +02:00
<div class="flex flex-column height-100">
2024-08-05 13:42:41 +02:00
{{ if not .Page.HideDesktopNavigation }}
2024-08-05 13:00:20 +02:00
<div class="header-container content-bounds">
<div class="header flex padding-inline-widget widget-content-frame">
<!-- TODO: Replace G with actual logo, first need an actual logo -->
2024-08-10 20:43:50 +02:00
<div class="logo">{{ if ne "" .App.Config.Branding.LogoURL }}<img src="{{ .App.Config.Branding.LogoURL }}" alt="">{{ else if ne "" .App.Config.Branding.LogoText }}{{ .App.Config.Branding.LogoText }}{{ else }}{{ end }}</div>
2024-08-05 13:00:20 +02:00
<div class="nav flex grow">
{{ template "navigation-links" . }}
</div>
2024-04-27 21:10:24 +02:00
</div>
</div>
2024-08-05 13:42:41 +02:00
{{ end }}
2024-04-27 21:10:24 +02:00
2024-08-05 13:00:20 +02:00
<div class="mobile-navigation">
<div class="mobile-navigation-icons">
<a class="mobile-navigation-label" href="#top"></a>
{{ range $i, $column := .Page.Columns }}
<label class="mobile-navigation-label"><input type="radio" class="mobile-navigation-input" name="column" value="{{ $i }}" autocomplete="off"{{ if eq "full" $column.Size }} checked{{ end }}><div class="mobile-navigation-pill"></div></label>
{{ end }}
<label class="mobile-navigation-label"><input type="checkbox" class="mobile-navigation-page-links-input" autocomplete="on"><div class="hamburger-icon"></div></label>
</div>
<div class="mobile-navigation-page-links">
{{ template "navigation-links" . }}
</div>
2024-04-27 21:10:24 +02:00
</div>
2024-08-05 13:15:55 +02:00
<div class="content-bounds grow">
2024-08-05 13:00:20 +02:00
<div class="page" id="page">
<div class="page-content" id="page-content"></div>
<div class="page-loading-container">
<!-- TODO: add a bigger/better loading indicator -->
<div class="loading-icon"></div>
</div>
2024-04-27 21:10:24 +02:00
</div>
</div>
2024-08-10 20:43:50 +02:00
{{ if not .App.Config.Branding.HideFooter }}
2024-08-05 13:15:55 +02:00
<div class="footer flex items-center flex-column">
2024-08-05 13:00:20 +02:00
<div>
<a class="size-h3" href="https://github.com/glanceapp/glance" target="_blank" rel="noreferrer">Glance</a> {{ if ne "dev" .App.Version }}<a class="visited-indicator" title="Release notes" href="https://github.com/glanceapp/glance/releases/tag/{{ .App.Version }}" target="_blank" rel="noreferrer">{{ .App.Version }}</a>{{ else }}({{ .App.Version }}){{ end }}
</div>
2024-04-27 21:10:24 +02:00
</div>
{{ end }}
2024-08-05 13:00:20 +02:00
<div class="mobile-navigation-offset"></div>
2024-04-27 21:10:24 +02:00
</div>
{{ end }}