From b12942fb32082729e862eb53b8c3962534561e83 Mon Sep 17 00:00:00 2001 From: Markus Wüstenberg Date: Thu, 3 Nov 2022 11:32:16 +0100 Subject: Delete low-value helper components (#115) I'd rather reserve the package for components that have proven repeatedly useful, like `Classes` and `HTML5`.--- components/documents.go | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 components/documents.go (limited to 'components/documents.go') diff --git a/components/documents.go b/components/documents.go deleted file mode 100644 index c7d8f8d..0000000 --- a/components/documents.go +++ /dev/null @@ -1,33 +0,0 @@ -// Package components provides high-level components and helpers that are composed of low-level elements and attributes. -package components - -import ( - g "github.com/maragudk/gomponents" - . "github.com/maragudk/gomponents/html" -) - -// HTML5Props for HTML5. -// Title is set no matter what, Description and Language elements only if the strings are non-empty. -type HTML5Props struct { - Title string - Description string - Language string - Head []g.Node - Body []g.Node -} - -// HTML5 document template. -func HTML5(p HTML5Props) g.Node { - return Doctype( - HTML(g.If(p.Language != "", Lang(p.Language)), - Head( - Meta(Charset("utf-8")), - Meta(Name("viewport"), Content("width=device-width, initial-scale=1")), - TitleEl(g.Text(p.Title)), - g.If(p.Description != "", Meta(Name("description"), Content(p.Description))), - g.Group(p.Head), - ), - Body(g.Group(p.Body)), - ), - ) -} -- cgit 1.4.1