index page larger header (does not work)

This commit is contained in:
f0x 2024-07-30 16:49:55 +02:00
parent 01174fd648
commit 01871cdb04
2 changed files with 45 additions and 41 deletions

View File

@ -60,7 +60,7 @@ func (m *Module) indexHandler(c *gin.Context) {
Instance: instance, Instance: instance,
OGMeta: apiutil.OGBase(instance), OGMeta: apiutil.OGBase(instance),
Stylesheets: []string{}, Stylesheets: []string{},
Extra: map[string]any{"showStrap": true}, Extra: map[string]any{"showStrap": true, "largeHeader": true},
} }
apiutil.TemplateWebPage(c, page) apiutil.TemplateWebPage(c, page)

View File

@ -22,7 +22,7 @@
If some if/else macro is used multiple times, declare it once here instead. If some if/else macro is used multiple times, declare it once here instead.
When invoking these nested templates, remember to pass in the values passed When invoking these nested templates, remember to pass in the values passed
to the executing template, ie., use '{{ template "example" . }}' not to the executing template, ie., use '{{ template "example" . }}' not
'{{ template "example" }}', otherwise you'll end up with empty variables. '{{ template "example" }}', otherwise you'll end up with empty variables.
*/ -}} */ -}}
{{- define "thumbnailType" -}} {{- define "thumbnailType" -}}
@ -43,43 +43,47 @@ image/webp
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8"> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="{{- if .robotsMeta -}}{{- .robotsMeta -}}{{- else -}}noindex, nofollow{{- end -}}"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
{{- if .ogMeta }} <meta name="robots" content="{{- if .robotsMeta -}}{{- .robotsMeta -}}{{- else -}}noindex, nofollow{{- end -}}">
{{- include "page_ogmeta.tmpl" . | indent 2 }} {{- if .ogMeta }}
{{- else }} {{- include "page_ogmeta.tmpl" . | indent 2 }}
{{- end }} {{- else }}
{{- if .rssFeed }} {{- end }}
<link rel="alternate" type="application/rss+xml" href="{{- .rssFeed -}}" title="{{- template "instanceTitle" . -}}"> {{- if .rssFeed }}
{{- else }} <link rel="alternate" type="application/rss+xml" href="{{- .rssFeed -}}" title="{{- template "instanceTitle" . -}}">
{{- end }} {{- else }}
{{- if .account }} {{- end }}
<link rel="alternate" type="application/activity+json" href="/users/{{- .account.Username -}}"> {{- if .account }}
{{- else if .status }} <link rel="alternate" type="application/activity+json" href="/users/{{- .account.Username -}}">
<link rel="alternate" type="application/activity+json" href="/users/{{- .status.Account.Username -}}/statuses/{{- .status.ID -}}"> {{- else if .status }}
{{- else }} <link rel="alternate" type="application/activity+json"
{{- end }} href="/users/{{- .status.Account.Username -}}/statuses/{{- .status.ID -}}">
<link rel="icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}"> {{- else }}
<link rel="apple-touch-icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}"> {{- end }}
<link rel="apple-touch-startup-image" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}"> <link rel="icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
{{- include "page_stylesheets.tmpl" . | indent 2 }} <link rel="apple-touch-icon" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
{{- range .javascript }} <link rel="apple-touch-startup-image" href="{{- .instance.Thumbnail -}}" type="{{- template "thumbnailType" . -}}">
<script type="text/javascript" src="{{- . -}}" async="" defer=""></script> {{- include "page_stylesheets.tmpl" . | indent 2 }}
{{- end }} {{- range .javascript }}
<title>{{- template "instanceTitle" . -}}</title> <script type="text/javascript" src="{{- . -}}" async="" defer=""></script>
</head> {{- end }}
<body class="page"> <title>{{- template "instanceTitle" . -}}</title>
<header class="page-header"> </head>
{{- include "page_header.tmpl" . | indent 3 }}
</header> <body class="page">
<div class="page-content"> <header class="page-header{{ if .largeHeader}} large{{end}}">
{{- include .pageContent . | indent 3 | outdentPre }} {{- include "page_header.tmpl" . | indent 3 }}
</div> </header>
<footer class="page-footer"> <div class="page-content">
{{- include "page_footer.tmpl" . | indent 3 }} {{- include .pageContent . | indent 3 | outdentPre }}
</footer> </div>
</body> <footer class="page-footer">
{{- include "page_footer.tmpl" . | indent 3 }}
</footer>
</body>
</html> </html>