~bigbes/sr-ht-dolt

ref: b6a015582614b2a0ec7d07984db1ce7e8e9f8523 sr-ht-dolt/web/templates/layout.html -rw-r--r-- 1.9 KiB
b6a01558 — Eugene Blikh web: drop the author from a memory's revision line 5 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{{/*
  The SourceHut chrome. The brand, the service switcher, the login block and the
  environment banner are NOT rendered here: they come from sr-ht-ecore's shared
  partials ("srht-env-banner", "srht-nav"), which every custom service on this
  instance draws from one copy. The dot is a handler's view struct, which embeds
  chrome.Page, so the fields those partials read promote into it.

  What is left here is the document itself and the content hole. The wrapper's
  width is .ContainerClass rather than a literal "container": the row browser
  hands out "container-fluid" so a wide table gets the whole viewport, and every
  other page gets the centered default chrome.Page already carries.

  The file is the layout's body rather than a {{define "layout"}} block: pages
  names each set after this file and executes the set itself, so a body wrapped
  in a define would leave the template that is actually executed empty.

  The content hole is {{template}} and never {{block}}: a block would define an
  empty default for "content" on every page at once, which is exactly what
  pages.Load refuses a page for at startup.
*/ -}}
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{{.Title}}</title>
    {{/* The stylesheet and the favicon both come from the shared partial, which
         guards each rather than emitting it empty: <link href=""> re-requests
         the page it is on, one extra page load per page load. The favicon href
         is the chrome's, so a build that ships no logo links ecore's built-in
         data: URI instead of 404ing once per page. */}}
    {{template "srht-head-links" .}}
  </head>
  <body>
    {{template "srht-env-banner" .}}
    <nav class="container navbar navbar-light navbar-expand-sm">
      {{template "srht-nav" .}}
    </nav>
    <div class="{{.ContainerClass}}">
      {{template "content" .}}
    </div>
  </body>
</html>