head

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Meta

func Meta(i Info) templ.Component

Meta is the start of <head>: charset, viewport, theme-color, favicon and manifest; on colibris with dark mode, the script that switches a dark-OS client to the dark variants before the first paint (etherpad-lite #7606). It must come before the stylesheets.

Types

type Info

type Info struct {
	// Root leads from the page to the site root: "" for /, "../" for
	// /p/:pad, "../../" for /p/:pad/timeslider. URLs are relative to it, so
	// the pages work behind a reverse proxy that serves Etherpad under a
	// path prefix.
	Root string
	// Lang and Dir are the page's <html lang> and dir.
	Lang           string
	Dir            string
	SkinName       string
	SkinVariants   string
	EnableDarkMode bool
	// Pad marks the pad and timeslider pages: not indexed, no referrer.
	Pad bool
}

Info describes a page for Meta.

func For

func For(s *settings.Settings, language, root string, pad bool) Info

For builds the Info of a page in language (the language cookie).

func (Info) DarkThemeColor

func (i Info) DarkThemeColor() string

DarkThemeColor is the theme-color on a client in dark mode, "" when dark mode cannot switch on.

func (Info) HTMLClass

func (i Info) HTMLClass() string

HTMLClass is the class of the pad pages' <html>: the configured variants.

func (Info) PrePaintDark

func (i Info) PrePaintDark() bool

PrePaintDark tells whether the page switches to dark before it paints.

func (Info) ThemeColor

func (i Info) ThemeColor() string

ThemeColor is the light theme-color, "" when the skin's colours are not known.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL