opg-go-common

module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT

README

opg-go-common

codecov PkgGoDev

Common go packages used by OPG: Managed by opg-org-infra & Terraform

Using common UI components

Components that include a template element make this available to the consuming service with Golang's embed directive. This initialises the content of a file or directory to a variable (string or embed.FS), which can then be accessed in the usual manner. The consuming service can import and parse this variable into the template map.

Pagination

Typical use of the pagination component is as follows, with the position of the component in the id and aria label updated accordingly:

<div class="govuk-grid-row">
  <nav id="bottom-pagination" aria-label="Bottom pagination">
    {{ template "pagination" .Pagination }}
  </nav>
</div>

Directories

Path Synopsis
Package template simplifies parsing a set of templates with common layouts.
Package template simplifies parsing a set of templates with common layouts.

Jump to

Keyboard shortcuts

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